Sybrand Bakker wrote:
>
> "Glen A Stromquist" <glen_stromquist_at_no.spam.yahoo.com> wrote in message
> news:C3Csa.21238$yv1.1637867_at_news2.telusplanet.net...
>> I am trying to write a simple proc to call from an access form to
>> populate a table with random entries. It is as follows:
>> =========================
>> declare
>>
>> num1 number;
>>
>> begin
>> delete from table2;
>> commit;
>> insert into table2
>> select * from (select col1,col2 from
>> table1 where col3 is not null
>> order by dbms_random.value) where rownum <= %num1;
>> commit;
>> end;
>>
>> ===========================
>>
>> It runs fine from sqlplus when I enter "@proc_name", but wont run if I
>> enter " exec proc_name" nor will it compile.
>> As you can see I haven't spent a lot of time writing PL/SQL - can anyone
>> help here?
>>
>> TIA
>>
>
> The code above is an anonymous block. It is NOT a procedure!
> A procedure definition starts with create or replace procedure.
>
>
Sorry - I didn't include the entire text in the post - I was creating the
procedure in DBA studio and couldnt get it to compile, there is a "create
or replace procedure" at the start.
When I copied the body of it and saved it as a .sql file and ran it from
sqlplus I got a "plsql procedure succesfully completed"
GS
Received on Fri May 02 2003 - 20:45:14 CDT