[NEWSboard IBMi Forum]
Seite 1 von 2 1 2 Letzte
  1. #1
    Registriert seit
    Nov 2007
    Beiträge
    371

    Zugriff vom SQlRPGLE AUF DB2 Linux

    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

  2. #2
    Registriert seit
    Nov 2007
    Beiträge
    371
    Problem selber gelöst

  3. #3
    Registriert seit
    Aug 2001
    Beiträge
    2.873
    Und wie?
    Ich schätze, dass das einige interessieren würde.

    Birgitta
    Birgitta Hauser

    Anwendungsmodernisierung, Beratung, Schulungen, Programmierung im Bereich RPG, SQL und Datenbank
    IBM Champion seit 2020 - 4. Jahr in Folge
    Birgitta Hauser - Modernization - Education - Consulting on IBM i

  4. #4
    Registriert seit
    Nov 2007
    Beiträge
    371
    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 ;( .

  5. #5
    Registriert seit
    Mar 2002
    Beiträge
    5.287
    ... in einem SQL Statement kann man nur in abgezählten Ausnahmen 2 unterschiedliche Datenbanken ansprechen (insert into lokal select ... from Server.schema.Tabelle sollte mit neuerem Release gehen) ansonsten kann man mit set Connection zwischen den Connections pendeln.

    D*B
    AS400 Freeware
    http://www.bender-dv.de
    Mit embedded SQL in RPG auf Datenbanken von ADABAS bis XBASE zugreifen
    http://sourceforge.net/projects/appserver4rpg/

  6. #6
    Registriert seit
    Nov 2007
    Beiträge
    371
    @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....

  7. #7
    Registriert seit
    Mar 2002
    Beiträge
    5.287
    ... 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...
    AS400 Freeware
    http://www.bender-dv.de
    Mit embedded SQL in RPG auf Datenbanken von ADABAS bis XBASE zugreifen
    http://sourceforge.net/projects/appserver4rpg/

  8. #8
    Registriert seit
    Nov 2007
    Beiträge
    371
    ach du scheisse bin ich ......
    Aber vielen Dank . Manchmal steht man nicht nur im Wald .....

  9. #9
    Registriert seit
    Nov 2007
    Beiträge
    371
    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?

  10. #10
    Registriert seit
    Mar 2002
    Beiträge
    5.287
    ... steht doch schon drin, commit hold geht nicht mit der remote DB.

    D*B
    AS400 Freeware
    http://www.bender-dv.de
    Mit embedded SQL in RPG auf Datenbanken von ADABAS bis XBASE zugreifen
    http://sourceforge.net/projects/appserver4rpg/

  11. #11
    Registriert seit
    Nov 2007
    Beiträge
    371
    ich muss aber mit commit arbeiten weil commit * none die remote DB nicht zulässt .

  12. #12
    Registriert seit
    Mar 2002
    Beiträge
    5.287
    ... aber nicht mit hold!
    AS400 Freeware
    http://www.bender-dv.de
    Mit embedded SQL in RPG auf Datenbanken von ADABAS bis XBASE zugreifen
    http://sourceforge.net/projects/appserver4rpg/

Similar Threads

  1. SQLRPGLE und Printerfile
    By Toschie in forum IBM i Hauptforum
    Antworten: 12
    Letzter Beitrag: 02-02-15, 14:28
  2. SQLRPGLE: Abfrage als Tabelle
    By ExAzubi in forum NEWSboard Programmierung
    Antworten: 10
    Letzter Beitrag: 10-11-14, 10:12
  3. V7R1 Fehler Umwandlung SQLRPGLE
    By Peet in forum NEWSboard Programmierung
    Antworten: 9
    Letzter Beitrag: 29-10-14, 07:54
  4. SQLRPGLE und offene Dateien
    By Tonazzo in forum NEWSboard Programmierung
    Antworten: 5
    Letzter Beitrag: 16-06-14, 09:30
  5. Compilierung SQLRPGLE
    By B.Hauser in forum IBM i Hauptforum
    Antworten: 4
    Letzter Beitrag: 01-10-01, 17:31

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •