[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[no subject]



hello all,

I will greatly appreciate some views on my problem.

I am on Oracle 7.3 and SQR 4.3 (and PS 7.5). I am trying
to get the equivalen of a "FOR " Loop in SQR. (Which I
understand is not available in SQR)

I am attempting something like the pseudo code below.
The objective is that I am picking up three rows for one
VENDOR from a single source table and inserting three
rows into one target table (PS_VENDOR_ADDR).

I would greatly appreciate some direction on how to
emulate the
below pseudo code  in SQR :

#INCR=0;
#LOCTYPE1 =10;
#LOCTYPE3 =20;
#LOCTYPE2 = 35;

FOR #INCR 1 TO 3 (EVALUATE #INCR
WHEN =1
select $a,$b,$c from ADDR_TABLE WHERE LOCTYPE =#LOCTYPE1;
WHEN =2
select $a,$b,$c from ADDR_TABLE WHERE LOCTYPE=#LOCTYPE2;
WHEN =3
select $a,$b,$c from ADDR_TABLE WHERE LOCTYPE=#LOCTYPE3;
WHEN OTHER
EXIT;
INSERT $a,$b,$c INTO target_table !(as address
seqno#INCR)
#INCR+1  )
!!The earlier you can help the better our whole team is
doing 12-14 hrs a day to catch deadlines !!

Thanks in advance,

vikram