Introduction to the actual application code of Oracle variable binding

Source: Internet
Author: User

The following articles mainly use the actual application code to introduce the actual application of Oracle variable binding. I saw information about Oracle variable binding on the relevant website two days ago, the following is a detailed description of the article.

 
 
  1. create table t (a varchar2(20),b varchar2(20)); 

Use Oracle to bind variables

 
 
  1. declare  
  2. v_sql varchar2(50);  
  3. begin  
  4. for i in 1..100000 loop  
  5. v_sql := 'insert into t values (:1,:2)';  
  6. execute immediate v_sql using 'a'||i,'b'||i;  
  7. end loop;  
  8. commit;  
  9. end;  
  10. /  

Clear table

 
 
  1. truncate table t; 

Do not use Oracle to bind variables

 
 
  1. declare  
  2. begin  
  3. for i in 1..100000 loop  
  4. insert into t values ('a'||i,'b'||i);  
  5. end loop;  
  6. commit;  
  7. end;  
  8. /   

The above content is the description of Oracle variable binding, hoping to help you in this regard.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.