Guest_imported
New member
- Jan 1, 1970
- 0
Hi
I need to write an SP as follows : -
Passing in will be values X & Y.
I have a 2-field table : Field 1 char
Field 2 date.
If X matches Field 1, use Y to update Field 2.
If X does not match, then insert a new record with X & Y.
If either of the above 2 successful, then return a 0.
If neither succesful,(ie Y not numeric) then return a 1.
i.e. select "err" = 'status'. ('status' = 0 or 1).
I have written straightforward Selects before within SP's, but nothing like this.
The OS is UNIX.
I know there is "@@error", and also the "return status", but I can't find the code to interrogate them.
Help !
I need to write an SP as follows : -
Passing in will be values X & Y.
I have a 2-field table : Field 1 char
Field 2 date.
If X matches Field 1, use Y to update Field 2.
If X does not match, then insert a new record with X & Y.
If either of the above 2 successful, then return a 0.
If neither succesful,(ie Y not numeric) then return a 1.
i.e. select "err" = 'status'. ('status' = 0 or 1).
I have written straightforward Selects before within SP's, but nothing like this.
The OS is UNIX.
I know there is "@@error", and also the "return status", but I can't find the code to interrogate them.
Help !