|
-
April 4th, 2003, 01:26 PM
#1
A question about Oracle stored procedure
Hi,
I have a question about Oracle stored procedure.
I have a table that contains fields ITEM1, ITEM2, ... ITEM120. Can I do a loop to go through them following the logic as:
totCnt = 0
for i = 1 .. 120
fieldname='ITEM' & to_string(i)
select count(*) cnt
from table1
where fieldname='1234'
totCnt = totCnt + cnt
insert into table2 (totCnt)
loop
Can I do this? If I can, how can I make Oracle know that fieldname is a name of a table column.
Thanks a lot for your help!
Cristal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|