‎2009 Feb 13 7:02 AM
Hi Team,
Please suggest me the best practice.
If I have to validate a field from DB.
Which stmt is preffered. Is it Select Single or Select Count.
Note : Target - Just to check if the record is exists in DB.
Please suggest the best way.
Thanks in Advance.
Ravindar.
‎2009 Feb 13 7:05 AM
‎2009 Feb 13 7:06 AM
hi,
Use select up to 1 rows,bcoz
select single shoul be used if u are comparing all key fields in the query else u have to use select up to 1 rows.
‎2009 Feb 13 7:07 AM
‎2009 Feb 13 7:08 AM
Hi Ravindar,
Search the SCN before posting the basic question. You can find lot of treads for your query.
Reported!!!
‎2009 Feb 13 7:08 AM
hi,
Using select up to 1 row is better way than the select single,
because select single hits the database more than once , where select up to 1 row hits only once in your program, hence a performance improver.
Thanks and regards
Sharath
‎2009 Feb 13 7:09 AM
Hi,
It depends on your specified where clause.
If you are specifying full key part in where condition , then it is better to use SELECT SINGLE.
Regards
Pinaki
‎2009 Feb 13 7:11 AM
Hi,
Select Single will take only one matching record from the database and stores inot buffer.
Select upto 1 rows will take all the records which are matching to that condition into the buffer.
so performance wise select upto 1 row is better than select single.
Regards,
jaya
‎2009 Feb 13 7:19 AM