Tech Tips
What is ORA 30926 ?
We all tend to face quite a few issues when running the Oracle program and using the queries in it. It is during these queries that we see the issues like ORA 30926 and others pop up. Oracle is a quintessential product and is used extensively by many. We here look into different issues popping up under Oracle query and help to resolve them. Let’s find out.
What is ORA 30926 ?
This is an issue which is resulted from the query that specifies the Using clause in it. This is seen when for say Table_A is part of the parent table and the Rowid sequence is returned several times in order. This can be easily resolved though. But before that here’s a snapshot of how the error comes while running the query:
MERGE INTO table_1 a
Using
(Select a.ROWID row_id, ‘Y’
From table_1 a, table_2 b, table_3 c
WHERE a.mbr = c.mbr
AND b.head = c.head
And b.type of action <> ‘5’) src
WHEN MATCHED THEN UPDATE SET in correct = ‘Y’
How to resolve the error?
This error can be resolved with ease by using Distinct in the query. This will give the query a constant value and help to clear the error. Also, do make sure that your query is correct. Here are a few things to take care of:
- Make sure that your query is correct.
- Take a look at the data table and see if anything is conflicting with the query.
Now here’s a snapshot of how you can use DISTINCT in the query:
MERGE INTO table_1 a
Using
(Select distinct ta.ROWID row_id,
From table_1 a, table_2 b, table_3 c
WHERE a.mbr = c.mbr
AND b.head = c.head
And b.type of action <> ‘5’) src
ON (a.ROWID = src.row.id)
WHEN MATCHED THEN UPDATE SET in correct = ‘Y’
Hope this resolved your error.