473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DB2 Precompiler Problems !?

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

Aug 10 '06 #1
10 3407

Can you give me the error message ?

Thanks Michael

Aug 10 '06 #2

Micha schrieb:
Can you give me the error message ?

Thanks Michael
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

Aug 10 '06 #3

RainerF schrieb:
Micha schrieb:
Can you give me the error message ?

Thanks Michael

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.

Aug 10 '06 #4

Micha schrieb:
RainerF schrieb:
Micha schrieb:
Can you give me the error message ?
>
Thanks Michael
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.
i don't think so
this statement without order By and Fetch Compiles on the 3270
Environment without Problems,
Other SQL Like

OPEN CURSOR .... WITH HOLD FOR
SELECT ........
FROM ........
WHERE .......
ORDER BY

FETCH .....
INTO

also work fine

it seems that the generated Code is the Problem and that the PC
Precompiler on the Windowsplattform is working different to the 3270
PRECOMPILER.
But only if I try the Combination with INTO and ORDER BY !!!!

Aug 10 '06 #5
"RainerF" <ra*****************@chello.atwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
i don't think so
this statement without order By and Fetch Compiles on the 3270
Environment without Problems,
Other SQL Like

OPEN CURSOR .... WITH HOLD FOR
SELECT ........
FROM ........
WHERE .......
ORDER BY

FETCH .....
INTO

also work fine

it seems that the generated Code is the Problem and that the PC
Precompiler on the Windowsplattform is working different to the 3270
PRECOMPILER.
But only if I try the Combination with INTO and ORDER BY !!!!
A fetch with static SQL into a host variables can only retrieve one row, so
the precompiler probably thinks the ORDER BY is redundant (it does not
understand that you limited the number of rows fetched by the FETCH FIRST 1
ROW ONLY).

If you convert this to a cursor with ORDER BY and then do one fetch, it
should work OK.
Aug 10 '06 #6

Mark A schrieb:
"RainerF" <ra*****************@chello.atwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
i don't think so
this statement without order By and Fetch Compiles on the 3270
Environment without Problems,
Other SQL Like

OPEN CURSOR .... WITH HOLD FOR
SELECT ........
FROM ........
WHERE .......
ORDER BY

FETCH .....
INTO

also work fine

it seems that the generated Code is the Problem and that the PC
Precompiler on the Windowsplattform is working different to the 3270
PRECOMPILER.
But only if I try the Combination with INTO and ORDER BY !!!!

A fetch with static SQL into a host variables can only retrieve one row, so
the precompiler probably thinks the ORDER BY is redundant (it does not
understand that you limited the number of rows fetched by the FETCH FIRST 1
ROW ONLY).

If you convert this to a cursor with ORDER BY and then do one fetch, it
should work OK.
Yes I think so too, and will try it today, but i still do not
understand why the PC Precompiler has no Problems, if thats an Problem
it should be a Problem on both Compilers and not only on one or it
sohould work on both Compilers or ?

Aug 11 '06 #7
"RainerF" <ra*****************@chello.atwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>
Yes I think so too, and will try it today, but i still do not
understand why the PC Precompiler has no Problems, if thats an Problem
it should be a Problem on both Compilers and not only on one or it
sohould work on both Compilers or ?
The DB2 for z/OS precompiler was written at the IBM software lab in Silicon
Valley (formerly known as the Santa Teresa Lab), and the DB2 LUW precompiler
was written at the IBM software lab in Toronto (and prior to that, at labs
in Austin, and Boca Raton).

DB2 for z/OS and DB2 for LUW are different products, but they try to
maintain consistency at the DML level. You might want to open a PMR on this
to see if IBM is willing to fix it (but probably not in time for your
requirements).
Aug 11 '06 #8

Mark A schrieb:
"RainerF" <ra*****************@chello.atwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...

Yes I think so too, and will try it today, but i still do not
understand why the PC Precompiler has no Problems, if thats an Problem
it should be a Problem on both Compilers and not only on one or it
sohould work on both Compilers or ?

The DB2 for z/OS precompiler was written at the IBM software lab in Silicon
Valley (formerly known as the Santa Teresa Lab), and the DB2 LUW precompiler
was written at the IBM software lab in Toronto (and prior to that, at labs
in Austin, and Boca Raton).

DB2 for z/OS and DB2 for LUW are different products, but they try to
maintain consistency at the DML level. You might want to open a PMR on this
to see if IBM is willing to fix it (but probably not in time for your
requirements).
Well as i Promised I tried the Open Curser and Fetch only the first
Line and now it works
correct as it is supposed to do
Thanks for the background information about the two Compilers Ithought
that both were written from the same team, well maybe i will write the
PRM but it is not necessary any more,

Aug 11 '06 #9
I think the bigger question is about the SQL (i.e. the SQL compiler)
being used, not the pre-compiler. DB2 for zOS, starting with V8 has been
doing a lot of catchup to DB2 for LUW in the SQL department. So it
depends on which version of DB2 for zOS you're on.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 11 '06 #10

Serge Rielau schrieb:
I think the bigger question is about the SQL (i.e. the SQL compiler)
being used, not the pre-compiler. DB2 for zOS, starting with V8 has been
doing a lot of catchup to DB2 for LUW in the SQL department. So it
depends on which version of DB2 for zOS you're on.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Well we use DB2 Version 7 and the Programming Language is C/C++
Well I am not using ProgrammCode with special Windows Functionality,
cause the same Code is going to be compiled on Windows/Linux and IBM
3270 Operating System
we also try to use no special DB2 Features cause even the Database
should be customizable, DB2 , Oracle, ...

Aug 14 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos De Matos | last post by:
Hello all, Has anyone written a project/code/document on a possible implementation for a c# precompiler? I want to build a precompiler that will modify attributed code, then submit the...
8
by: Bill Pursell | last post by:
This question must be FAQ, but I can't find it: I'm baffled by the following: $ cat a.c #define foo(x) foo##x_ #define bar(x) bar##x##_ foo() foo(1) bar()
6
by: Kulgan | last post by:
Hi All I am working on migrating an ASP.NET 1.1 web app to 2.0. I have got everything building and running, but I am having problems with the precompiler. It starts to precompile the web site...
22
by: JohnQ | last post by:
Is the C++ precompiler the same as a C precompiler? If not, how much different is it? John
104
by: JohnQ | last post by:
Well apparently not since one can step thru template code with a debugger. But if I was willing to make the concession on debugging, templates would be strictly a precompiler thing? I have a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.