DB2预编译器问题! [英] DB2 Precompiler Problems !?
问题描述
嗨伙计,
我的问题是:
我的SQL语句结构:
SELECT TABLEA.FIELDA,
TABLEA.FIELDB,
TABLEA.FIELDC,
TABLEA.FIELDD,
TABLEA.FIELDE,
TABLEA.FIELDF,
TABLEA.FIELDG,
TABLEA.FIELDH,
TABLEA。 FIELDI,
TABLEA.FIELDJ,
TABLEB.FIELDA,
TABLEA.FIELDK
INTO:mystruct-> ; FIELDA,
:mystruct-> FIELDB,
:mystruct-> FIELDC,
:mystruct-> FIELDD,
:mystruct-> FIELDE,
:mystruct-> FIELDF,
:mystruct-> FIELDG,
:mystruct-> FIELDH,
:mystruct-> FIELDI,
:mystruct-> FIELDJ,
:mystruct-> ; FIELDK,
:mystruct-> FIELDL
FROM TABLEA,TABLEB
WHERE TABLEB.FIELDM =:mystruct-> FIELDM
AND TABLEA.FIELDH = TABLEB.FIELDA
AND TABLEA_DELKEY = 0
AND TABLEA_SYSSTATUS = 0
AND TABLEB_DELKEY = 0
AND TAVLEB_SYSSTATUS = 0
ORDER BY TABLEA.FIELDB DESC
FETCH仅限第一行;
Pc Db2编译器编译此语句没有问题
但是HOST(3270)DB2预编译器无法编译这个
语句
两个Plattforms都运行DB2 Version 7 Programmcode是用C语言编写的。
有谁知道为什么3270预编译器无法编译这个
语句?
感谢Rainer
Hi Folks,
My Problem is:
My SQL Statement Structure:
SELECT TABLEA.FIELDA,
TABLEA.FIELDB,
TABLEA.FIELDC,
TABLEA.FIELDD,
TABLEA.FIELDE,
TABLEA.FIELDF,
TABLEA.FIELDG,
TABLEA.FIELDH,
TABLEA.FIELDI,
TABLEA.FIELDJ,
TABLEB.FIELDA,
TABLEA.FIELDK
INTO :mystruct->FIELDA,
:mystruct->FIELDB,
:mystruct->FIELDC,
:mystruct->FIELDD,
:mystruct->FIELDE,
:mystruct->FIELDF,
:mystruct->FIELDG,
:mystruct->FIELDH,
:mystruct->FIELDI,
:mystruct->FIELDJ,
:mystruct->FIELDK,
:mystruct->FIELDL
FROM TABLEA, TABLEB
WHERE TABLEB.FIELDM = :mystruct->FIELDM
AND TABLEA.FIELDH = TABLEB.FIELDA
AND TABLEA_DELKEY = 0
AND TABLEA_SYSSTATUS = 0
AND TABLEB_DELKEY = 0
AND TAVLEB_SYSSTATUS = 0
ORDER BY TABLEA.FIELDB DESC
FETCH FIRST ROW ONLY;
The Pc Db2 Compiler has no Problem Compiling this Statement
but the HOST (3270) DB2 Precompiler is not able to compile this
statement
Both Plattforms run DB2 Version 7 the Programmcode is written in C
Does anybody know why the 3270 Precompiler is unable to Compile this
statement ?
Thanks Rainer
推荐答案
你能给我错误信息吗?
谢谢Michael
Can you give me the error message ?
Thanks Michael
>
Micha schrieb:
Micha schrieb:
你能给我错误信息吗?
谢谢Michael
Can you give me the error message ?
Thanks Michael
当然:
CCN5256(S)类型&的参数char *无法使用类型为unsigned char [5]的
表达式初始化。
第3416.11行:CCN6205(I)转换为
参数1的strcpy(char *,const char *)。
第3416行在我的cpp源中
是SQL-Statement和另一个人我们发现3270
DB2预编译器不允许使用订单选择INTO语句
相同的语句没有订单by and fetch(没有编译错误),但是工作
不正确
Of Course:
CCN5256 (S) A parameter of type "char *" cannot be initialized with an
expression of type "unsigned char [5]".
line 3416.11: CCN6205 (I) The error occurred while converting to
parameter 1 of "strcpy(char *, const char *)".
line 3416 in my cpp source
is the SQL-Statement and with an other guy we found out that the 3270
DB2 Precompiler does not allow a Select INTO Statement with Order By
Same statement witout order by and fetch (no Compile Errors), but works
not correct
RainerF schrieb :
RainerF schrieb:
Micha schrieb:
Micha schrieb:
你能给我错误信息吗?
谢谢Michael
Can you give me the error message ?
Thanks Michael
当然:
CCN5256(S)类型为char的参数*"无法使用类型为unsigned char [5]的
表达式初始化。
第3416.11行:CCN6205(I)转换为
参数1的strcpy(char *,const char *)。
第3416行在我的cpp源中
是SQL-Statement和另一个人我们发现3270
DB2预编译器不允许使用订单选择INTO语句
相同的语句没有订单by和fetch(没有编译错误),但是工作
不正确
Of Course:
CCN5256 (S) A parameter of type "char *" cannot be initialized with an
expression of type "unsigned char [5]".
line 3416.11: CCN6205 (I) The error occurred while converting to
parameter 1 of "strcpy(char *, const char *)".
line 3416 in my cpp source
is the SQL-Statement and with an other guy we found out that the 3270
DB2 Precompiler does not allow a Select INTO Statement with Order By
Same statement witout order by and fetch (no Compile Errors), but works
not correct
我不确定,但它可以,主机上的预编译器
不理解主机变量名称中的> - 签名。也许
非法?!
请尝试使用其他名称。
I''m not sure, but it can be possible, that the precompiler on the host
don''t understand the ">"-sign in the name of your host variables. Maybe
illegal?!
Try it with other name.
这篇关于DB2预编译器问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!