Embedded SQL Program Design

Source: Internet
Author: User
Embedded SQL program design; 38EXECSQLCONNECTTOred. t

Embedded SQL Program Design: RED_CURSOR red_CURSOR CONNECT TO servername. databasename AS connection_name user login. password connection connection_name DISCONNECT connection_name SQL CONNECT TO red. book AS con1 USER sa; 38 exec SQL CONNECT TO red. t

Embedded SQL Program Design

RED_CURSOR red_CURSOR connect to servername. databasename AS connection_name user login. password connection connection_nameDISCONNECT connection_name SQL CONNECT TO red. book AS con1 USER sa; 38 exec SQL CONNECT TO red. test AS con2 USER sa; 39 exec SQL disconnect CON1 40 exec SQL disconnect CON2SQL begin declare section 47 INT CompanyIDSQL end declare section "WHERE CompanyID =: CompanID" SQL SELECT FROM Company 58 WHERE Address =: ADDRESSstmt_name FROM: hvarSQL begin declare section "insert into company values (?,?) "CompanynameSQL end declare sectionprintf (" input unit code: ") 81 SCANF (" % S ", COMPANYID) 82 PRINTF (" input unit name :") 83 scanf ("% s", companyname) 84 exec SQL prepare stmt FROM: stmtcon 85 exec SQL EXECUTE stmt USING: COMPANYID ,: companynamesql begin declare section SQL end declare section 91 exec SQL select companyname into: COMPANYNAMEcursor_name insensitive scroll cursor for select_stmt column_list defines the CURSOR and opens SQL COMPANYI D, companyname SQL open C1SQL begin declare sectioncompanynamesql end declare section (SQLCODE = 0) 122 {123 exec SQL FETCH C1 INTO: COMPANYID,: COMPANYNAME124 PRINTF ("% S, % S ", COMPANYID, COMPANYNAME) 125} SQL BEGIN DECLARE SECTION" SELECT COMPANYID FROM COMPANY WHERE COMPANYNAME =? ";" Beijing Yishen Company "; section SQL SELECT_STATEMENT; SQL139 PREPARE SELECT_STATEMENT FROM: szcommandsql open CON_CURSOR USING: SZCOMPANYNAME; 142 exec SQL FETCH CON_CURSOR INTO: SZCOMPANYID ;,

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.