DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: bind variables

  1. #1
    Join Date
    Nov 2000
    Posts
    35
    To avoid parsing of sql statements it is recommended to use bind variables . HOw to use bind variables in to avoid parsing ? any advice please ..

  2. #2
    Join Date
    Aug 2000
    Posts
    462
    The point is that if you submit the EXACT same SQL statement to the Oracle server, the statement will be parsed the first time, and the parsed version of the statement will hopefully still be in memory when you repeat that statement. Imagine you want to find two people in a table, using two successive SQL statements. You could issue these two statements:

    select * from people_table where ssn=123456789;
    select * from people_table where ssn=234567890;

    In that preceeding case, both SQL statements would be parsed, costing you performance.

    Instead, consider this (functional, not executable) example:

    v_ssn := 123456789;
    select * from people_table where ssn = :v_ssn;
    v_ssn := 234567890;
    select * from people_table where ssn = :v_ssn;

    The SQL statement is EXACTLY the same, thus the parsing will not take place for the second execution. This will improve performance.

  3. #3
    Join Date
    Nov 2000
    Posts
    212
    it depends what tool you use to submit sql to server: C, forms, java, VB, delphi?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width