Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

DB2 and embedded SQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Klaus Jeschke - 16 Mar 2006 20:15 GMT
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++.
Lorne Sunley - 17 Mar 2006 04:49 GMT
> Hi, I'm not sure, whether this is the right place for my question. If not,
> please point me to the correct group.
[quoted text clipped - 5 lines]
> 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)?

Signature

Lorne Sunley

Mark A - 17 Mar 2006 05:06 GMT
"Lorne Sunley" <lsunley@mts.net> wrote in message news:lbZtd1ZY5f9V-pn2-

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

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.
Jan M. Nelken - 17 Mar 2006 18:03 GMT
> "Lorne Sunley" <lsunley@mts.net> wrote in message news:lbZtd1ZY5f9V-pn2-
>> Do you have the application development client installed (on Windows)?
[quoted text clipped - 6 lines]
> 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
Gert van der Kooij - 17 Mar 2006 12:31 GMT
> Hi, I'm not sure, whether this is the right place for my question. If not,
> please point me to the correct group.
[quoted text clipped - 5 lines]
> 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.
Jan M. Nelken - 17 Mar 2006 18:07 GMT
> Hi, I'm not sure, whether this is the right place for my question. If not,
> please point me to the correct group.
[quoted text clipped - 5 lines]
> 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
Klaus Jeschke - 18 Mar 2006 21:03 GMT
> 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
Gert van der Kooij - 19 Mar 2006 02:32 GMT
> Thanks for this hint, I tried it.
>
[quoted text clipped - 28 lines]
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.