if :P1_ACCNT_NO is null thenIn the create_account procedure, I do
htmldb_util.set_session_state('P1_ACCNT_NO',v('P1_REAL_ACCNT_NO'));The page has a unconditional branch back to itself
write v('P1_ACCNT_NO') and l_accnt_no to a debug table
if :P1_ACCNT_NO is null thenit works fine i.e. P1_ACCNT_NO gets the proper value in session state.
:P1_ACCNT_NO := :P1_REAL_ACCNT_NO;
if :P1_ACCNT_NO is null then...the engine parses the block, keeping track of bind variable names which it initializes with the current value of the corresponding items from session state. Then it executes the block dynamically and as the last step updates items in session state whose values are not the same as post-execution values of their corresponding bind variables. This allows statements like :P1_X := 'foo' or my_proc(:P1_X /* out */); to actually change the value of P1_X. In your example, the item P1_ACCNT_NO is updated after the block is executed based on the same rule -- the bind variable and the item value are different, not because the bind variable changed, but because the item changed.
mypkg.create_account; /* this procedure changes P1_ACCNT_NO in session state */
but in these rare cases, you do need to.Just so I understand, what rare cases would these be? Processes which call a packaged procedure/function that uses htmldb_util.set_session_state to set session state?