首页 > 其他 > 详细

Host variables

时间:2015-06-30 20:16:20      阅读:209      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!