You can use the DESCRIBE statement to obtain host variable information for any SELECT statement that has been prepared (using PREPARE), and store that information into the SQL descriptor area (SQLDA).
When the DESCRIBE statement gets executed in your application, the database manager defines your host variables in an SQLDA. Once the host variables are defined in the SQLDA, you can use the FETCH statement to assign values to the host variables, using a cursor.
-
Declaring the SQLDA structure in a dynamically executed SQL program
An SQLDA contains a
variable number of occurrences of SQLVAR entries, each of which contains
a set of fields that describe one column in a row of data. There are
two types of SQLVAR entries: base SQLVAR entries and secondary SQLVAR
entries. -
Preparing a dynamically executed SQL statement using the minimum SQLDA structure
Use the information provided here as an example of how
to allocate the minimum SQLDA structure for a statement. -
Allocating an SQLDA structure with sufficient SQLVAR entries for dynamically executed SQL statements
After you determine
the number of columns in the result table, you must allocate storage
for a second full-size SQLDA. The first SQLDA is used for input parameters
and the second full-size SQLDA is used for output parameters. -
Describing a SELECT statement in a dynamically executed SQL program
After you allocate sufficient space for the second SQLDA
(in this example, calledfulsqlda), you must code
the application to describe the SELECT statement. -
Acquiring storage to hold a row
Before the application can fetch a row of the result table
using an SQLDA structure, the application must first allocate storage
for the row. -
Processing the cursor in a dynamically executed SQL program
After you allocate the
SQLDA structure, you can open the cursor associated with the SELECT
statement and fetch rows. -
Allocating an SQLDA structure for a dynamically executed SQL program
Allocate an SQLDA structure for your application so that
you can use it to pass data to and from your application. -
Transferring data in a dynamically executed SQL program using an SQLDA structure
You have greater flexibility
when you transfer data using an SQLDA instead of using lists of host
variables. For example, you can use an SQLDA to transfer data that
has no native host language equivalent, such as DECIMAL data in the
C language. -
Processing interactive SQL statements in dynamically executed SQL programs
You can write an application
using dynamic SQL to process arbitrary SQL statements. For example,
if an application accepts SQL statements from a user, the application
must be able to issue the statements without any prior knowledge of
the statements. -
Determination of statement type in dynamically executed SQL programs
When an SQL statement
is prepared, you can determine information concerning the type of
statement by examining the SQLDA structure. This information is placed
in the SQLDA structure either at statement preparation time with the
INTO clause, or by issuing a DESCRIBE statement against a previously
prepared statement. -
Processing variable-list SELECT statements in dynamically executed SQL programs
A varying-list SELECT
statement is one in which the number and types of columns that are
to be returned are not known at precompilation time. -
Saving SQL requests from end users
If the users of your application can issue SQL requests
from the application, you might want to save these requests.
瞧一瞧迷一般的SQLDA的更多相关文章
-
瞧一瞧,看一看呐,用MVC+EF快速弄出一个CRUD,一行代码都不用写,真的一行代码都不用写!!!!
瞧一瞧,看一看呐用MVC+EF快速弄出一个CRUD,一行代码都不用写,真的一行代码都不用写!!!! 现在要写的呢就是,用MVC和EF弄出一个CRUD四个页面和一个列表页面的一个快速DEMO,当然是在不 ...
-
【转载】网易极客战记官方攻略-地牢- 迷一般的 Kithmaze
关卡连接: https://codecombat.163.com/play/level/riddling-kithmaze 如果你第一次走上歧途,改变你的循环来找到出路. 简介: 敬请期待! 默认代码 ...
-
瞧一瞧!这儿实现了MongoDB的增量备份与还原(含部署代码)
一 需求描述 我们知道数据是公司的重要资产,业务的系统化.信息化就是数字化.数据高效的存储与查询是系统完善和优化的方向,而数据库的稳定性.可靠性是实现的基础.高可用和RPO(RecoveryPoint ...
-
Win10一周年纪念版,瞧一瞧Linux子系统
Bash Bash是一个命令处理器,通常运行于文本窗口中,并能执行用户直接输入的命令.Bash还能从文件中读取命令,这样的文件称为脚本.和其他Unix shell 一样,它支持文件名替换(通配符匹配) ...
-
走进 AQS 瞧一瞧看一看
并发中有一块很重要的东西就是AQS.接下来一周的目标就是它. 看复杂源码时,一眼望过去,这是什么?不要慌,像剥洋葱一样,一层层剥开(哥,喜欢"扒开"这个词). 参考资源: http ...
-
2020最新的web前端体系和路线图,想学web前端又不知道从哪开始的快来瞧一瞧呀
web前端其实是相对于服务器语言是简单的,并且对于初学者是非常友好的,因为在前期学习能够看到很好的效果.但是他的路线 也就是学习体系不成熟,所以导致很多初学者不知道怎么学?下面我就讲讲web前端的体系 ...
-
瞧一瞧React Fiber
啥是React Fiber? React Fiber,简单来说就是一个从React v16开始引入的新协调引擎,用来实现Virtual DOM的增量渲染. 说人话:就是一种能让React视图更新过程变 ...
-
手写Spring AOP,快来瞧一瞧看一看撒!
目录 AOP分析 Advice实现 定义Advice接口 定义前置.后置.环绕和异常增强接口 Pointcut实现 定义PointCut接口 定义正则表达式的实现类:RegExpressionPoin ...
-
Java 反编译工具哪家强?对比分析瞧一瞧
前言 Java 反编译,一听可能觉得高深莫测,其实反编译并不是什么特别高级的操作,Java 对于 Class 字节码文件的生成有着严格的要求,如果你非常熟悉 Java 虚拟机规范,了解 Class 字 ...
随机推荐
-
C语言SOCKET编程指南
1.介绍 Socket 编程让你沮丧吗?从man pages中很难得到有用的信息吗?你想跟上时代去编Internet相关的程序,但是为你在调用 connect() 前的bind() 的结构而不知所措? ...
-
[Leetcode] Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
-
android开发虚拟机不能正常启动
点击 window---perspective---DDMS---查看设备状态, 如果显示没有可用设备,则在AVD manager中重 启即可, 若列表中有设备,但显示offline 可采用一下方式 ...
-
WPF程序如何自定义启动窗口并传参
首先,找到App.xaml,将Application标签中的StartupUri属性去掉; 然后可以在MainWindow.xaml.cs中重载构造函数,并添加自己想要的参数; 然后在App.xaml ...
-
C#关闭窗口代码
if (MessageBox.Show("请您确认是否退出(Y/N)", "系统提示", MessageBoxButtons.YesNo, MessageBox ...
-
电脑远程工具:mstsc
外网远程控制:电脑远程连接在开始程序中搜:mstsc 然后直接敲IP地址 工具:dell sonicwall netextender.exe mstsc.exe 内网远程控制:使用TeamVi ...
-
一款基于jQuery的支持鼠标拖拽滑动焦点图
记得之前我们分享过一款jQuery全屏广告图片焦点图,图片切换效果还不错.今天我们要分享另外一款jQuery焦点图插件,它的特点是支持鼠标拖拽滑动,所以在移动设备上使用更加方便,你只要用手指滑动屏幕即 ...
-
[转]ORACLE 异常错误处理
本文转自:http://www.cnblogs.com/soundcode/archive/2012/01/10/2318385.html 本篇主要内容如下: 5.1 异常处理概念 5.1.1 预定义 ...
-
JS数组filter()、map()、some()、every()、forEach()、lastIndexOf()、indexOf()实例
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat=&qu ...
-
JavaScript 变量、类型与计算
变量类型 变量计算 变量 题目: JavaScript 中使用typeof能得到的有哪些类型? ``` 1.1 变量类型 (1).js中的数据类型:字符串.数字.布尔.数组.对象.Null.Undef ...