Oracle variable binding statement

Source: Internet
Author: User


Oracle variable binding statements do not like to see the use of procedure | concatenates SQL statements, so an example of variable binding is provided. It is only for reference in Java code create or replace procedure using_test (t_name nvarchar2) as v_id char; v_sex char; begin www.2cto.com execute immediate 'select id, sex from test_zyy where name =: 1 'into v_id, v_sex using t_name; dbms_output.put_line ('ID: '| v_id | 'gender:' | v_sex); exception when others then dbms_output.put_line ('corresponding information cannot be found! '); End using_test; some people say that the process will customize the optimization code. Well, I don't know whether this is a hearsay or I really know the code from nb, however, there is an Alter system set cursor_sharing = similar statement that can force the use of the shared area. www.2cto.com converts the hard parsing method into soft parsing-binding variables. However, this method is not recommended, because in some conditions, the execution speed is reduced. The most obvious example is the paging rownum.

Related Article

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.