Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Confusion with for loop
Steve Holdoway wrote:
>It might be worth making sure username is always spelt with a capital
>U at the beginning???
>
>Steve
>On Thu, 9 Oct 2003 10:35:26 +0200, Marc Eggenberger
><marc.eggenberger_at_itc.alstom.com> wrote:
>
>
>
>>Hi there.
>>
>>I tried to use an FOR LOOP in an anonymous block (in the SQL Window in
>>TOAD to be more specific).
>>
>>I tried this:
>>
>>DECLARE
>> CURSOR username_cur IS
>>
>>
> ^
>
>
>> SELECT Username FROM omsmaeg.eins;
>>
>>BEGIN
>> FOR Username_rec IN Username_cur
>> LOOP
>> UPDATE USER_DEF SET Dvol = 'BI-DFS01\DFS' WHERE Username
>> = Username_rec.Username
>> END LOOP;
>> COMMIT;
>>END;
>>
>>
>>I used this in procedures already. But now it says me I need to declare
>>Username_rec. Isnt this the work of the FOR LOOP to do it implicit?
>>
>>What am I doing wrong here?
>>
>>
Oracle is only case sensitive in string comparisons. The capitalization
of a field name is irrelevant.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Thu Oct 09 2003 - 10:43:18 CDT