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 10 3407
Can you give me the error message ?
Thanks Michael
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
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.
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 !!!!
"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.
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 ?
"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).
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,
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/
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, ... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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()
|
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...
|
by: JohnQ |
last post by:
Is the C++ precompiler the same as a C precompiler? If not, how much
different is it?
John
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |