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

HELP ME problem with *.sqc

P: n/a
Hi to all ng

I 'm a non expert user og db2 and i made a program that it connect to db2
and after goes to a table, verify that exists a value and after return
success or not.

My problem is that for the connection and for the verify I made a library,
all the library and program made in c language, and seems that is not knows
the sql code
the error is SQLSTATE [51002]

For complete informatio i said that this program function right well in db2
version 7.2 but when I transport in db2 v8 after the rebind i have this
problem
thank in advance for all people that can help me

Sergio
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
eap90210 wrote:
Hi to all ng

I 'm a non expert user og db2 and i made a program that it connect to db2
and after goes to a table, verify that exists a value and after return
success or not.

My problem is that for the connection and for the verify I made a library,
all the library and program made in c language, and seems that is not
knows the sql code
the error is SQLSTATE [51002]

For complete informatio i said that this program function right well in
db2 version 7.2 but when I transport in db2 v8 after the rebind i have
this problem


How exactly did you do the "rebind"? SQLSTATE 51002 says that a package
could not be found. So I guess that something in the bind-process didn't
work out as you expected.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

P: n/a
Thanks to answer me.

I bind the program in this way :
bind carven.bnd

I create this program, called carven, that when it issue call a static
library call libtrk, in order to connect to db and this step is ok.
After execute a cursor, open/fetch, and this step is ok.
After in a loop for every record try to translate a value. for this reason i
call a function in the library. Here happen that all statment before the
query it was execute perfectly but do not execute the query, i don't know
why. After, always in the library, write in the log file the failure 51002.

I start with a devolep machine that is a Unix Aix machine, that have a user
equal to schema equal to istance name

When I copied in the staging machine, the environment is : user is different
from a istance name but is equal to a schema but it different from a schema
of develop machine.

Ah! other program that read a file idoc and write in the load table work
right well.

Regards
Sergio
"Knut Stolze" <st****@de.ibm.com> ha scritto nel messaggio
news:d5**********@fsuj29.rz.uni-jena.de...
eap90210 wrote:
Hi to all ng

I 'm a non expert user og db2 and i made a program that it connect to
db2
and after goes to a table, verify that exists a value and after return
success or not.

My problem is that for the connection and for the verify I made a
library,
all the library and program made in c language, and seems that is not
knows the sql code
the error is SQLSTATE [51002]

For complete informatio i said that this program function right well in
db2 version 7.2 but when I transport in db2 v8 after the rebind i have
this problem


How exactly did you do the "rebind"? SQLSTATE 51002 says that a package
could not be found. So I guess that something in the bind-process didn't
work out as you expected.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

Nov 12 '05 #3

P: n/a
eap90210 wrote:
Thanks to answer me.

I bind the program in this way :
bind carven.bnd

I create this program, called carven, that when it issue call a static
library call libtrk, in order to connect to db and this step is ok.
After execute a cursor, open/fetch, and this step is ok.
After in a loop for every record try to translate a value. for this reason
i call a function in the library. Here happen that all statment before the
query it was execute perfectly but do not execute the query, i don't know
why. After, always in the library, write in the log file the failure
51002.
Please let me know if I got this right:

(1) you execute same static SQL statements successfully
(2) then you make a call to a function in the "libtrk" library
(3) once you return from the called function, the subsequent static SQL
statements fail with SQLSTATE 51002

Is this correct?

Is static SQL executed in the function(s) in the libtrk library?
Is the logic of (1) and (3) in the same package, i.e. the same transalation
unit/file?
I start with a devolep machine that is a Unix Aix machine, that have a
user equal to schema equal to istance name

When I copied in the staging machine, the environment is : user is
different from a istance name but is equal to a schema but it different
from a schema of develop machine.

Everything is all right on the development machine? And it only fails on
the staging system?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

P: n/a
best thanks for your answer

and ..
(1) you execute same static SQL statements successfully Yes ! the first command, I mean the connect, stay in this library
( libtrk ) . After the connection, the main program execute a cursor ( and
it's ok ). after ..
I call again (2) then you make a call to a function in the "libtrk" library Yes for traslate the value ( so exec sql select value1 into
:bind_variable from table1 where condition ( with a primary key ) )
(3) once you return from the called function, the subsequent static SQL
statements fail with SQLSTATE 51002 YES !
Is static SQL executed in the function(s) in the libtrk library? YES
Is the logic of (1) and (3) in the same package, i.e. the same
transalation
unit/file? Sorry but i don't understand very well. This library is call in
order to connect to db2, and s called for traslation. and the first time is
good, after no.
I don't know if it is in same package, i don't know db2, I tell
that the command dump -n carven | more give me the following reult :
***Import File Strings***
INDEX PATH BASE MEMBER
0 /db2v8/inet/sqllib/lib:/db2v8/inet/prgc:/usr/lpp/xlopt:/usr/lib:/lib
1 libc.a shr.o
2 libdb2.a shr.o

So the library is static!

Everything is all right on the development machine? And it only fails on
the staging system?
Yes, I say that the only difference between develop machine than
staging machine is the command get alert configuration for database in the
develop machine, for every idicator name is set to NO instead of in the
staging machine is set to YES.
In the develop machine if I write db2 + enter and after I write
connect the db2 tell me "SQL1024N A database connection does not exist.
SQLSTATE=08003" instead of the staging machine that allow me to enter in db2

thanks in advance

regards

sergio

"Knut Stolze" <st****@de.ibm.com> ha scritto nel messaggio
news:d6**********@fsuj29.rz.uni-jena.de... eap90210 wrote:
Thanks to answer me.

I bind the program in this way :
bind carven.bnd

I create this program, called carven, that when it issue call a static
library call libtrk, in order to connect to db and this step is ok.
After execute a cursor, open/fetch, and this step is ok.
After in a loop for every record try to translate a value. for this
reason
i call a function in the library. Here happen that all statment before
the
query it was execute perfectly but do not execute the query, i don't know
why. After, always in the library, write in the log file the failure
51002.


Please let me know if I got this right:

(1) you execute same static SQL statements successfully
(2) then you make a call to a function in the "libtrk" library
(3) once you return from the called function, the subsequent static SQL
statements fail with SQLSTATE 51002

Is this correct?

Is static SQL executed in the function(s) in the libtrk library?
Is the logic of (1) and (3) in the same package, i.e. the same
transalation
unit/file?
I start with a devolep machine that is a Unix Aix machine, that have a
user equal to schema equal to istance name

When I copied in the staging machine, the environment is : user is
different from a istance name but is equal to a schema but it different
from a schema of develop machine.

Everything is all right on the development machine? And it only fails on
the staging system?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.