SQL (Insert/Delete) Testing ? - IBM AS400

This is a discussion on SQL (Insert/Delete) Testing ? - IBM AS400 ; Since SQL is very powerful is there an easy way to simulate whatif(s) if such SQL commands are ran against a PF. My current work around to this is copying files and then evaluating my results, I did not know ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: SQL (Insert/Delete) Testing ?

  1. SQL (Insert/Delete) Testing ?

    Since SQL is very powerful is there an easy way to simulate whatif(s)
    if such SQL commands are ran against a PF. My current work around to
    this is copying files and then evaluating my results, I did not know
    if there is an easiear way to do this. I have used the apyjrnchg
    command and rmvjrnchg command to move records back etc but did not
    know if there is a quick and easy way to do this, thanks.


  2. Re: SQL (Insert/Delete) Testing ?

    il 17/10/2008 13.43, Scrive iseriesflorida 43711712:
    > Since SQL is very powerful is there an easy way to simulate whatif(s)
    > if such SQL commands are ran against a PF. My current work around to
    > this is copying files and then evaluating my results, I did not know
    > if there is an easiear way to do this. I have used the apyjrnchg
    > command and rmvjrnchg command to move records back etc but did not
    > know if there is a quick and easy way to do this, thanks.
    >

    You can do with interactive SQL. Look at the help (pressing F1) of
    parameter PROCESS of STRSQL command, or changing the same SQL session
    attribute from inside STRSQL (pressing F13 + 1)

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  3. Re: SQL (Insert/Delete) Testing ?

    On Oct 17, 12:43*pm, iseriesflorida wrote:
    > Since SQL is very powerful is there an easy way to simulate whatif(s)
    > if such SQL commands are ran against a PF. *My current work around to
    > this is copying files and then evaluating my results, I did not know
    > if there is an easiear way to do this. *I have used the apyjrnchg
    > command and rmvjrnchg command to move records back etc but did not
    > know if there is a quick and easy way to do this, thanks.


    Do you mean you would like to see how many records would be inserted/
    updated/deleted ?
    If so then changing the statement to a select would be the best way.
    The next best & possibly quite poor is to ensure all your files are
    journalled & start an sql transaction eg SET TRANSACTION ISOLATION
    LEVEL READ UNCOMMITTED
    then rollback when you are done. This has the downside that other
    processes can see your uncommitted chnages & possibly make decisions
    based on them. The other downside is that the rollback is actually a
    reverse update so it makes the physical changes again wheras commit is
    quite a quick operation (apparently) STRSQL can prompt set transaction
    for you. There is also the option to set COMMIT from the STRSQL
    command or F13 option 1 & I am unsure as to the reason for this as it
    dosnt make sql hold locks on inserted rows.
    If you call stored procedures or have triggers you might find an
    extraaneous commit or rollback which fouls up this testing.

    Jonathan.

+ Reply to Thread