问题描述
大家好!
我想使用包含以下声明的应用程序将记录插入表格中:
EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;
EXEC SQL END DECLARE SECTION;
hvInt_Stor = MMDB_STORAGE_TYPE_INTERNAL;
hvExt_Stor = MMDB_STORAGE_TYPE_EXTERNAL;
EXEC SQL INSERT INTO EMPLOYEE VALUES(
''128557'',/ * id * /
''Anita Jones'',/ * name * /
DB2IMAGE(/ * Image Extender UDF * /
CURRENT SERVER,/ *数据库服务器名称在* /
/ CURRENT SERVER寄存器* /
''/ employee / images / ajones.bmp''/ *图像源文件* /
''ASIS'',/ *保留图像格式* /
:hvInt_Stor,/ *将图像存储在DB中作为BLOB * /
''Anita'''s''''',* * comment * /
DB2AUDIO(/ * Audio Extender UDF * /
CURRENT SERVER,/ *数据库服务名字在* /
/ * CURRENT SERVER寄存器* /
''/ employee / sounds / ajones.wav'',/ *音频源文件* /
''WAVE'',/ *音频格式* /
:hvExt_Stor,/ *保留服务器文件中的内容* /
''Anita' '''s''')/ *评论* /
);
也许这是个愚蠢的问题,但是:我应该使用什么编译器?我应该包括哪些
图书馆?我辛苦工作了两个星期......我现在正在使用
Microsoft Visual C ++(之前是Borland C 5.5编译器),但是
我可以''编译这个程序没有错误(通常错误是库里面的
:sqltypes.h)
1.如何强制这个编译器只在可能的情况下使用IBM库?
2.也许有人可以告诉我如何编写程序,包括上面显示的
语句?
我接近崩溃:-(
Vavel
Hi all!
I want to insert the record into the table by
using an application program that includes the following statements:
EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;
EXEC SQL END DECLARE SECTION;
hvInt_Stor = MMDB_STORAGE_TYPE_INTERNAL;
hvExt_Stor = MMDB_STORAGE_TYPE_EXTERNAL;
EXEC SQL INSERT INTO EMPLOYEE VALUES(
''128557'', /*id*/
''Anita Jones'', /*name*/
DB2IMAGE( /*Image Extender UDF*/
CURRENT SERVER, /*database server name in*/
/CURRENT SERVER register*/
''/employee/images/ajones.bmp'' /*image source file*/
''ASIS'', /*keep the image format*/
:hvInt_Stor, /*store image in DB as BLOB*/
''Anita''''s picture''), /*comment*/
DB2AUDIO( /*Audio Extender UDF*/
CURRENT SERVER, /*database server name in*/
/*CURRENT SERVER register*/
''/employee/sounds/ajones.wav'', /*audio source file*/
''WAVE'', /* audio format */
:hvExt_Stor, /*retain content in server file*/
''Anita''''s voice'') /*comment*/
);
Maybe that''s silly question,but : what compiler should I use? and which
libraries should I include? I toil over this for 2 weeks... I''m using
Microsoft Visual C++ at this moment( Borland C 5.5 compiler before),but
I can''t compile this programme without errors (commonly errors are
inside library: sqltypes.h)
1. How to force this compiler to use IBM libaries only when it is possible?
2. Maybe someone could tell me how to write programme,that include
statements that were shown above??
I''m close to break down :-(
Vavel
推荐答案
你有没有考虑过查看你的DB2副本附带的应用程序
编程/构建手册?这些手册
描述了编译你的程序并描述哪些编译器已用DB2测试过。他们还提供了许多你可以模仿的各种语言的程序示例。
我必须假设您没有看到这些示例中的任何一个因为您出现
以在整个插入中散布大量评论
声明。如果你删除那些评论,我希望你的编译好多了。
运气好。
犀牛
Have you given any thought to looking at the Application
Programming/Building manuals that come with your copy of DB2? These manuals
describe the process of compiling your programs and describe which compilers
have been tested with DB2. They also give many examples of programs in a
variety of languages that you can imitate.
I have to assume you didn''t look at any of these examples because you appear
to have a large number of comments interspersed throughout your Insert
statement. If you remove those comments, I expect you''ll have much better
luck with your compile.
Rhino
但是我的编译器根本没有查看我的陈述,因为在库中有一个
错误,而编译语句。也许有人看到了这个可以帮助我的例子。这很容易说:一切都在
手册......
问候
Vavel
But my compiler didn''t look at my statement at all because there was an
errors in libaries,while statements were compiled. Maybe someone have
seen example that would help me. It''s easy to say: "everything is in
manual"...
greetings
Vavel
1.应用程序开发指南:构建和运行应用程序
2. DB2客户端的快速入门
3. DB2 UDB对Windows环境的利用
我知道,如果有人在多次询问某些问题的第一个答案
是RTFM。但我看过上面列出的手册,但是我没有找到答案。我不是说这本手册没有答案
但是我找不到。这就是我寻求帮助的原因。
1.Application Development Guide:Building and Running Applications
2.Quick Beginnings for DB2 Clients
3. DB2 UDB Exploitation of the Windows Environment
I know that if someone asked about something first answer in many times
is RTFM. But I''ve looked at manuals that I''ve listed above, but I
didn''t find answer. I don''t say that there is no answer in this manuals
but I can''t find it.That''s why I asked for help.
但是我的编译器根本不看我的陈述,因为在库中有一个
错误,而编译语句。也许有人看到了可以帮助我的例子。很容易说:一切都在
手册中......
But my compiler didn''t look at my statement at all because there was an
errors in libaries,while statements were compiled. Maybe someone have
seen example that would help me. It''s easy to say: "everything is in
manual"...
代码看起来像C中的嵌入式SQL - Informix术语,ESQL / C.
您需要找到将其转换为
a C源文件的正确预处理器,然后使用正确的文件编译该C源代码
标题(和库)到对象或可执行文件中。
-
Jonathan Leffler #include< disclaimer.h>
电子邮件:,
DBD守护者:: Informix v2003.04 - -
The code looks like Embedded SQL in C - in Informix terms, ESQL/C.
You need to find the correct preprocessor that will convert that into
a C source file, and then compile that C source with the correct
headers (and libraries) into an object or executable.
--
Jonathan Leffler #include <disclaimer.h>
Email: jl******@earthlink.net, jl******@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
这篇关于应用程序 - 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!