This will be weird.
I have a procedure with commit control = *none like below. I'm getting a scenario wherein if I call GetSomething right after I PutSomething, it doesn't pull! I confirm it is in the file. I think on the fly it happens too fast and it's getting from a table a data that is not there yet. Is this a thing with DB2? Is this a case where I should use write and chain(n)?
I have a procedure with commit control = *none like below. I'm getting a scenario wherein if I call GetSomething right after I PutSomething, it doesn't pull! I confirm it is in the file. I think on the fly it happens too fast and it's getting from a table a data that is not there yet. Is this a thing with DB2? Is this a case where I should use write and chain(n)?
Code:
PutSomething('Value1') ; GetSomething('Value1') ; <--- Nothing
Code:
Dcl-proc PutSomething ; Dcl-pi *n Ind ; Anything Char(10) ; End-pi ; Exec Sql Insert Into SomeTable Values(Anything) ; Return '1' ; End-proc ;
Code:
Dcl-proc GetSomething ; Dcl-pi *n Like(Anything) ; Anything Char(10) ; End-pi ; Dcl-s w_Anything Like(Anything) Inz(' ') ; Exec Sql Select Anything into :w_Anything from SomeTable where Anything =: Anything ; Return Anything ; End-proc ;
Comment