码迷,mamicode.com
首页 > 其他好文 > 详细

Host variables

时间:2015-06-30 20:19:38      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

Host variables are data items declared in a host application program and used in both host language statements and embedded SQL statements. They provide communication between SQL statements and the host language statements. An input host variable transfers data from a host language program to an SQL/MX database, and an output host variable transfers data from a database to the program. A host variable is a C variable with a data type that corresponds to an SQL data type.
    You use host variables to provide communication between C and SQL statements and to receive data from a database or to insert data into a database. When you specify a host variable in an SQL statement, precede the host variable name with a colon (:). In C statements, you do not need the colon, as shown:
EXEC SQL SELECT column1 INTO :host_variable1 FROM =table
WHERE column1 > :host_variable2;
strcpy(new_name, host_variable1);

 





Host variables

标签:

原文地址:http://www.cnblogs.com/ECNB/p/4611292.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!