Anmelden

View Full Version : Zugriff vom SQlRPGLE AUF DB2 Linux



Seiten : [1] 2 3

woodstock99
08-07-15, 09:49
Hallo zusammen ,

hat jemand erfahrung wie man von einem SQLRPGLE auf eine DB2(linux) zugreift.

WrkRDBDIRE eintrag vorhanden .
SQLPACKAGE auch auf beiden System vorhanden .
SQl Connect funktioniert auch nur ich bekomme keine Daten .


Hab mal 2 Wege aufprobiert .

Beim SQl: Select Count(*) into :Counter from Libaa.filebb
erhalte ich folgende Fehlermeldung

Message ID . . . . . . : SQL0727 Severity . . . . . . . : 30

Message . . . . : Evaluation of global variable *N in *N failed.
Cause . . . . . : An error occurred during evaluation of the DEFAULT clause
of global variable *N in *N. The SQLCODE associated with the failure is
204. The SQLSTATE is 42704. The message tokens are LIBaa.Filebb.
This failure may also indicate an error occurred on a system other than
DB2 for IBM i during implicit system action 5.
Recovery . . . : Refer to the joblog or see the product documentation for
more information regarding the detected error. Correct the error and try
the request again.


Bei

String1 = 'Select Max(PK) from Database.Libaa.FileBB';
Exec SQL Prepare DynCsrC1 From :String1;

erhalte ich folgendes

Message ID . . . . . . : SQL0204 Severity . . . . . . . : 30
Message type . . . . . : Diagnostic
Date sent . . . . . . : 08.07.15 Time sent . . . . . . : 10:46:25

Message . . . . : filebb in Libaa type *N not found.
Cause . . . . . : Filebb in Libaa type *N was not found. If the member
name is *ALL, the table is not partitioned. If this is an ALTER TABLE
statement and the type is *N, a constraint or partition was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, trigger or sequence object was not found.
If a function was not found, Fileaa is the service program that
contains the function. The function will not be found unless the external
name and usage name match exactly. Examine the job log for a message that
gives more details on which function name is being searched for and the name
that did not match.
Recovery . . . : Change the name and try the request again. If the object


Per STRSQl funktioniert es .


Gruss

woodstock99
08-07-15, 10:17
Problem selber gelöst :)

B.Hauser
08-07-15, 10:52
Und wie?
Ich schätze, dass das einige interessieren würde.

Birgitta

woodstock99
08-07-15, 13:39
ich habe alles nochmal neu aufgesetzt .
CRTSQLRPGI wandeln mit bestimmten parameter
Sqlpackage lokal und auf dem Remote erstellt und es funzt . Commit Steuerung eingestellt (*none) geht gar nicht und die lokalen tabellen müssen journalisiert sein .

Oder was meinst du mit wie ?

das einzige wo ich jetzt gerade hänge ist der direkte Insert im Programm .

Insert into lokale.lib.file +
Select * from remotedb.lib.file where ....
das mag er nicht ;( .

BenderD
08-07-15, 14:42
... in einem SQL Statement kann man nur in abgezählten Ausnahmen 2 unterschiedliche Datenbanken ansprechen (insert into lokal select ... from Server.schema.Tabelle <three part alias> sollte mit neuerem Release gehen) ansonsten kann man mit set Connection zwischen den Connections pendeln.

D*B

woodstock99
08-07-15, 15:09
@bender,

nur wie ??
per STRSQL funzt das aber im SQLRPGLE
funzt das nicht

Insert into lokale.lib.file +
Select * from remotedb.lib.file where ....
nur warum ?

fehlermeldung :
Message ID . . . . . . : SQL0727 Severity . . . . . . . : 30
Message type . . . . . : Diagnostic
Date sent . . . . . . : 08.07.15 Time sent . . . . . . : 16:12:41

Message . . . . : Evaluation of global variable *N in *N failed.
Cause . . . . . : An error occurred during evaluation of the DEFAULT clause
of global variable *N in *N. The SQLCODE associated with the failure is
204. The SQLSTATE is 42704. The message tokens are




das pendeln das du meinst ist doch sätze einzeln verarbeiten.
fetch
connection wechseln , update fahren , connection wechseln nächster fetch....

BenderD
08-07-15, 15:12
... einzeln verarbeitet wird das sowieso.
Mit three part alias muss die aktuelle Connection local sein und dann

Insert into lib.file +
Select * from remotedb.lib.file where...

woodstock99
08-07-15, 15:27
ach du scheisse bin ich ......
Aber vielen Dank . Manchmal steht man nicht nur im Wald .....

woodstock99
09-07-15, 07:57
jetzt erhalte ich folgende fehlermeldung wenn ich den commit absetze :

"Insert into lib.file +
Select * from remotedb.lib.file where..."



xxx rows inserted in xx in aa.
GET DIAGNOSTICS statement complete.
DRDA resource does not allow SQL cursor hold.



Message ID . . . . . . : CPD835D Severity . . . . . . . : 20
Message type . . . . . : Diagnostic
Date sent . . . . . . : 09.07.15 Time sent . . . . . . : 08:54:19

Message . . . . : DRDA resource does not allow SQL cursor hold.
Cause . . . . . : A commit or rollback operation, with SQLHOLD(YES)
specified, was performed for commitment definition *DFTACTGRP. However, the
relational database xxx at remote location *N, or IP address
::ffff:172.21.13.15, does not allow cursor hold. If the remote location is
*ARDPGM, the relational database is located by using an application
requester driver program.
Recovery . . . : Retry the commit or rollback operation using SQLHOLD(NO).
Technical description . . . . . . . . : The commitment definition identifier
is X'5CC4C6E3C1C3E3C7D9D7'. The activation group number is X'00000002'.

weiss da jemand rat?

BenderD
09-07-15, 08:08
... steht doch schon drin, commit hold geht nicht mit der remote DB.

D*B