By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,585 Members | 2,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,585 IT Pros & Developers. It's quick & easy.

DB2 and embedded SQL

P: n/a
Hi, I'm not sure, whether this is the right place for my question. If not,
please point me to the correct group.

I have to port an application (from OS/2 to WinXP) that runs on PC and
connects to a DB2 database on MVS-host. The application is written in C and
uses embedded SQL. On OS/2 there is a tool called SQLPREP.exe that processes
the embedded sql (from sqc file). Where do I get the corresponding tool for
Windows? It is neither part of my DB2 installation nor of the (MS) Visual
C++.
Mar 16 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Thu, 16 Mar 2006 19:15:20 UTC, Kl****@web.de (Klaus Jeschke) wrote:
Hi, I'm not sure, whether this is the right place for my question. If not,
please point me to the correct group.

I have to port an application (from OS/2 to WinXP) that runs on PC and
connects to a DB2 database on MVS-host. The application is written in C and
uses embedded SQL. On OS/2 there is a tool called SQLPREP.exe that processes
the embedded sql (from sqc file). Where do I get the corresponding tool for
Windows? It is neither part of my DB2 installation nor of the (MS) Visual
C++.


Do you have the application development client installed (on Windows)?

--
Lorne Sunley
Mar 17 '06 #2

P: n/a
"Lorne Sunley" <ls*****@mts.net> wrote in message news:lbZtd1ZY5f9V-pn2-

Do you have the application development client installed (on Windows)?

--
Lorne Sunley


The necessary code to precompile, compile, and bind programs with embedded
SQL is located on the DB2 server that he installed. The application
development client is not required.

The OP should read the "Application Development Guide: Building and Running
Applications" manual to find the information that is needed. PDF versions of
the DB2 manuals can be downloaded from the IBM website at no charge.
Mar 17 '06 #3

P: n/a
In article <Xn*************************@151.189.20.10>, Kl****@web.de
says...
Hi, I'm not sure, whether this is the right place for my question. If not,
please point me to the correct group.

I have to port an application (from OS/2 to WinXP) that runs on PC and
connects to a DB2 database on MVS-host. The application is written in C and
uses embedded SQL. On OS/2 there is a tool called SQLPREP.exe that processes
the embedded sql (from sqc file). Where do I get the corresponding tool for
Windows? It is neither part of my DB2 installation nor of the (MS) Visual
C++.


Check the '<db2path>\SQLLIB\samples\cpp\' directory. It contains the
bld* scripts you need to compile your sources.
Mar 17 '06 #4

P: n/a
Mark A wrote:
"Lorne Sunley" <ls*****@mts.net> wrote in message news:lbZtd1ZY5f9V-pn2-
Do you have the application development client installed (on Windows)?

--
Lorne Sunley


The necessary code to precompile, compile, and bind programs with embedded
SQL is located on the DB2 server that he installed. The application
development client is not required.

The OP should read the "Application Development Guide: Building and Running
Applications" manual to find the information that is needed. PDF versions of
the DB2 manuals can be downloaded from the IBM website at no charge.


Hmmm - OP server is on MVS - as his post suggested.

Jan M. Nelken
Mar 17 '06 #5

P: n/a
Klaus Jeschke wrote:
Hi, I'm not sure, whether this is the right place for my question. If not,
please point me to the correct group.

I have to port an application (from OS/2 to WinXP) that runs on PC and
connects to a DB2 database on MVS-host. The application is written in C and
uses embedded SQL. On OS/2 there is a tool called SQLPREP.exe that processes
the embedded sql (from sqc file). Where do I get the corresponding tool for
Windows? It is neither part of my DB2 installation nor of the (MS) Visual
C++.


SQLPREP - shows an old vintage of DB2 - perhaps Version 2.x...(Circa 1995.. you
will have more problems with porting code
11 years old).

You need to Install Application Development client on Windows machine and
establish connectivity to z/OS host (MVS is long
gone too). Either use DB2 Connect Server somewhere on the network - or use DB2
Connect Personal Edition on you Windows
XP machine.

Somehow I think you will post your questions very frequently from now on -
unless you recode the application in Java

(Java code with DB2 UDB Universal JCC Driver Type 4 - only needs Java runtime;
DB2 Connect license file and connectivity
to z/OS).
Best regards,

Jan M. Nelken

PS: SQLPREP is replaced in DB2 world by command: db2 prep ...

Full syntax is:

{PREP | PRECOMPILE} filename [ACTION {ADD | REPLACE [RETAIN {YES | NO}]
[REPLVER version-id]}] [BINDFILE [USING bind-file]]
[BLOCKING {UNAMBIG | ALL | NO}] [CALL_RESOLUTION {IMMEDIATE | DEFERRED}]
[COLLECTION schema-name] [CONNECT {1 | 2}]
[DATETIME {DEF | USA | EUR | ISO | JIS | LOC}] [DECTYPE {NOCONVERT | CONVERT}]
[DEFERRED_PREPARE {NO | YES | ALL}] [DEGREE {1 | degree-of-parallelism | ANY}]
[DISCONNECT {EXPLICIT | CONDITIONAL | AUTOMATIC}]
[DYNAMICRULES {BIND | RUN | INVOKEBIND | INVOKERUN | DEFINEBIND | DEFINERUN}]
[EXPLAIN {NO | YES | REOPT | ALL}] [EXPLSNAP {NO | YES | REOPT | ALL}]
[FEDERATED {NO | YES}] [FUNCPATH schema-name [{,schema-name} ... ]]
[GENERIC string] [INSERT {DEF | BUF}] [ISOLATION {CS |RR |UR |RS |NC}]
[LANGLEVEL {SAA1|MIA|SQL92E}] [LEVEL consistency-token] [LONGERROR {YES NO}]
[MESSAGES message-file] [NOLINEMACRO]
[OPTLEVEL {0 | 1}] [OUTPUT filename] [OWNER authorization-id]
[PACKAGE [USING package-name]] [PREPROCESSOR "preprocessor-command"]
[QUALIFIER qualifier-name] [QUERYOPT optimization-level]
[REOPT {NONE | ONCE | ALWAYS}]
[SQLCA {SAA | NONE}] [SQLERROR {NOPACKAGE | CHECK | CONTINUE}]
[SQLFLAG {MVSDB2V23 | MVSDB2V31 | MVSDB2V41 | SQL92E} SYNTAX]
[SQLRULES {DB2 | STD}] [SQLWARN {YES | NO}] [STATICREADONLY {NO | YES}]
[SYNCPOINT {ONEPHASE | TWOPHASE | NONE}] [SYNTAX]
[TARGET {IBMCOB | MFCOB | MFCOB16 | C | CPLUSPLUS | FORTRAN | ANSI_COBOL |
BORLAND_C | BORLAND_CPLUSPLUS}] [TRANSFORM GROUP transform-group]
[VALIDATE {RUN | BIND}] [WCHARTYPE {CONVERT | NOCONVERT}] [VERSION version-id]
************************************************** *****************************
* The following options are valid only if connected to a host or iSeries Server
************************************************** *****************************
[CCSIDG double-ccsid] [CCSIDM mixed-ccsid] [CCSIDS sbcs-ccsid]
[CHARSUB {DEFAULT | BIT | SBCS | MIXED}] [CNULREQD {YES | NO}]
[DBPROTOCOL {DRDA | PRIVATE}] [DEC {31 | 15}] [DECDEL {PERIOD | COMMA}]
[ENCODING {ASCII | EBCDIC | UNICODE | ccsid}] [IMMEDWRITE {NO | YES | PH1}]
[KEEPDYNAMIC {NO | YES}] [OPTHINT hint-id] [OS400NAMING {SQL | SYSTEM}]
[PATH schema-name] [RELEASE {COMMIT | DEALLOCATE}]
[SORTSEQ {HEX | JOBRUN}] [STRDEL {APOSTROPHE | QUOTE}] [TEXT label]
Jan M. Nelken
Mar 17 '06 #6

P: n/a
"Jan M. Nelken" <Un**********@Invalid.Domain> wrote in
news:441aecba$1@kcnews01:
SQLPREP - shows an old vintage of DB2 - perhaps Version 2.x...(Circa
1995.. you will have more problems with porting code
11 years old).
I don't know. I am the new one in this company.
You need to Install Application Development client on Windows machine
and establish connectivity to z/OS host (MVS is long
MVS still running on host maschine (/370 maybe old, too)
gone too). Either use DB2 Connect Server somewhere on the network - or
use DB2 Connect Personal Edition on you Windows
XP machine.
Thanks,I will see whether I can get it somewhere.
Somehow I think you will post your questions very frequently from now
on - unless you recode the application in Java
Sorry, there's no chance. Management dictates the rules :-((
(Java code with DB2 UDB Universal JCC Driver Type 4 - only needs Java
runtime; DB2 Connect license file and connectivity
to z/OS).
As mentioned above - there is no chance (the new employee has to do what the
big boss say, and keep his mouth shut).

PS: SQLPREP is replaced in DB2 world by command: db2 prep ...

Thanks for this hint, I tried it.

But - now I have another problem, maybe one can help me, too:

I tried a little example:

EXEC SQL INCLUDE SQLCA

EXEC SQL BEGIN DECLARE SECTION;
char ATTR1[2];
char ATTR2[2];
EXEC SQL END DECLARE SECTION;

EXEC SQL SELECT ATTR1 INTO :ATTR1 FROM TXA.TBL WHERE ATTR2 = :ATTR2;

and I get a message

SQL30073 "0x2112" Parametervalue "0x0000" not supported.

I did not find the meaning of this message (with value "0x2112") anywhere
(GOOGLE was not friendly to me).

If I enter the select directly I get the correct result.
Best regards,

Jan M. Nelken


Thanks.

Best regards back,
Klaus
Mar 18 '06 #7

P: n/a
In article <Xn*************************@151.189.20.10>, Kl****@web.de
says...

Thanks for this hint, I tried it.

But - now I have another problem, maybe one can help me, too:

I tried a little example:

EXEC SQL INCLUDE SQLCA

EXEC SQL BEGIN DECLARE SECTION;
char ATTR1[2];
char ATTR2[2];
EXEC SQL END DECLARE SECTION;

EXEC SQL SELECT ATTR1 INTO :ATTR1 FROM TXA.TBL WHERE ATTR2 = :ATTR2;

and I get a message

SQL30073 "0x2112" Parametervalue "0x0000" not supported.

I did not find the meaning of this message (with value "0x2112") anywhere
(GOOGLE was not friendly to me).

If I enter the select directly I get the correct result.
Best regards,

Jan M. Nelken


Thanks.

Best regards back,
Klaus


I've found a description about this error message in the redbook at
http://www.redbooks.ibm.com/redbooks/pdfs/sg246435.pdf
that this message might be changed into a more describing message when
using at least FP5. Maybe updating to the latest fixpack level might
help you also to get a more meaningfull message.

Mar 19 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.