views:

160

answers:

2

Hi,

i am using ExecuteOracleNonQuery and getting rowid as output parameter.How can i optimize subsequent related queries by using rowid?

A: 

Perhaps if you posted the query you're using it would be more clear what it is you're trying to achieve?

The Oracle ROWID identifes a row in a table (but is not unique within the Database). By using ExecuteOracleNonQuery you are only affecting one row if it returns the ROWID, I'm not sure however what it is you plan to do with your 'subsequent related queries'.

pierre
Forexample i have a procedure which inserts invoice records to table.When user wants to make 100 invoices,in my opinion rowid can improve performance.MSDN says that to get rowid allows you to uniquely identify a row in the Oracle database which can allow you to increase performance.But there is not an example about how to do it.http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oraclecommand.executeoraclenonquery.aspx
Alexander
A: 

A rowid can be used in SELECT, INSERT, UPDATE and DELETE.

SELECT *
FROM mytable
WHERE rowid = :rowid

ROWID is a oracle keyword to directly access a datarow. To access a datarow through rowid there is no index lookup necessary.

Use OracleDbType.RowID to define the type of the parameter :rowid.

Christian13467
Christian, Thanks for your answer but how can i use it when i insert a new row to table?ExeceuteNonQuery accepts rowid as parameter and should i run this query to get rowid and then use it as parameter?Is that all?
Alexander
On oracle there is INSERT INTO ... RETURNING rowid INTO :rowid. You can return any column value to have it for later updates or any.
Christian13467