fiqs8stwme6s806a

welcome to my space

SQL - Here's what happened!

  • Hello,

    I created this Sql statement in my SQLRPGLE program.

    C/exec sql
    c+ INSERT INTO QTEMP/RPTAGSTMP (RMSDATEASG, ATTRNYCODE, RMSACCTNUM,
    c+ RMSCORPNM1, RMSCORPNM2, RMSHOMEPHN, RMSOFFCPHN, BALANCE,
    c+ RMSLASTPMT, LSTCOMMNT2)
    c+ SELECT H.RMSDATEASG, H.ATTRNYCODE, H.RMSACCTNUM,
    c+ D.RMSCORPNM1, D.RMSCORPNM2, D.RMSHOMEPHN,
    c+ D.RMSOFFCPHN, H.BALANCE, H.RMSLASTPMT,D.LSTCOMMNT2
    c+ FROM QRYMASTER H JOIN RMSPMASTER D
    c+ ON H.RMSFILENUM = D.RMSFILENUM
    c+ WHERE H.ATTRNYCODE = :InAgency
    c+ and H.RMSDATEASG >= :InBegDtT and H.RMSDATEASG <= :InEndDtT
    c/end-exec


    The program compiled and I ran it. Nothing was produced. I talked with IBM and they said that if the file(s) in my SQL statement isn't being journaled then I need to compile my SQLRPGLE program with a *NONE in Commitment Control line.


    Object . . . . . . . . . . . . . > RPT106R2 Name
    Library . . . . . . . . . . . > DACLIB Name, *CURLIB
    Source file . . . . . . . . . . > QRPGSRC Name, QRPGLESRC
    Library . . . . . . . . . . . > DACLIB Name, *LIBL, *CURLIB
    Source member . . . . . . . . . > RPT106R2 Name, *OBJ
    Commitment control . . . . . . . *NONE *CHG, *ALL, *CS, *NONE...
    Relational database . . . . . . *LOCAL
    Compile type . . . . . . . . . . > *PGM *PGM, *SRVPGM, *MODULE
    Listing output . . . . . . . . . *NONE *NONE, *PRINT
    Text 'description' . . . . . . . *SRCMBRTXT

    Just a helpful hint.

    DAC


  • You can also add With NC to the end of your SQL:


    C/exec sql
    c+ INSERT INTO QTEMP/RPTAGSTMP (RMSDATEASG, ATTRNYCODE, RMSACCTNUM,
    c+ RMSCORPNM1, RMSCORPNM2, RMSHOMEPHN, RMSOFFCPHN, BALANCE,
    c+ RMSLASTPMT, LSTCOMMNT2)
    c+ SELECT H.RMSDATEASG, H.ATTRNYCODE, H.RMSACCTNUM,
    c+ D.RMSCORPNM1, D.RMSCORPNM2, D.RMSHOMEPHN,
    c+ D.RMSOFFCPHN, H.BALANCE, H.RMSLASTPMT,D.LSTCOMMNT2
    c+ FROM QRYMASTER H JOIN RMSPMASTER D
    c+ ON H.RMSFILENUM = D.RMSFILENUM
    c+ WHERE H.ATTRNYCODE = :InAgency
    c+ and H.RMSDATEASG >= :InBegDtT and H.RMSDATEASG <= :InEndDtT
    c+ With NC
    c+/end-exec


  • you can do this also in your program


    c/exec sql
    c+ set option commit=*none,
    c+ datfmt=*iso
    c/end-exec







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about SQL - Here's what happened! , Please add it free.
    edit

    Mexico