lizzzard
asked on
stored procedure... please help..
HI,
I have to write a stored procedure, but I'm not very good at it...obviously.
For myself I made an example of what it should do. It's in a kind of fake-language, but it should show what the problem is:
@DATE_F : DATETIME
@OBJ : CHAR(3)
@DATE_B : DATETIME
@AAN : TINYINT
for each record in BES where BES.OBJ=@OBJ and AAN_T=@AAN and BES.DATB='01/01/1901'
do
if BES.DATF='01/01/1901'
{BES.DATF = @DATE_F }
endif
if BES.BEDF - BES.ONIN > 0
{BES.CLI_TEL = 1
BES.DATB = @DATE_F
BES.BEDB = BES.BEDF - BES.ONIN
if BES.BWB = '3' then
{BES.AAN_T = BES.AAN_T + 1}}
endif
done
Now... how should I write my sp to accomplish this?
Thanks for any advice..
Regards, Alex
I have to write a stored procedure, but I'm not very good at it...obviously.
For myself I made an example of what it should do. It's in a kind of fake-language, but it should show what the problem is:
@DATE_F : DATETIME
@OBJ : CHAR(3)
@DATE_B : DATETIME
@AAN : TINYINT
for each record in BES where BES.OBJ=@OBJ and AAN_T=@AAN and BES.DATB='01/01/1901'
do
if BES.DATF='01/01/1901'
{BES.DATF = @DATE_F }
endif
if BES.BEDF - BES.ONIN > 0
{BES.CLI_TEL = 1
BES.DATB = @DATE_F
BES.BEDB = BES.BEDF - BES.ONIN
if BES.BWB = '3' then
{BES.AAN_T = BES.AAN_T + 1}}
endif
done
Now... how should I write my sp to accomplish this?
Thanks for any advice..
Regards, Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Lizzzard,
Nope. It's not a problem. Syntax is CREATE PROC myproc (@DATE_F DATETIME, @OBJ CHAR(3), @DATE_B DATETIME , @AAN TINYINT ).
Hope that helps.
D.
Nope. It's not a problem. Syntax is CREATE PROC myproc (@DATE_F DATETIME, @OBJ CHAR(3), @DATE_B DATETIME , @AAN TINYINT ).
Hope that helps.
D.
ASKER
Thanks,
I will try, you'll hear from me soon.
I will try, you'll hear from me soon.
ASKER