Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: help with this simple proc?

Re: help with this simple proc?

From: Glen A Stromquist <glen_stromquist_at_nospam.yahoo.com>
Date: Sat, 03 May 2003 18:31:49 GMT
Message-ID: <pWTsa.24905$yv1.1919131@news2.telusplanet.net>


Rene Nyffenegger wrote:

> 

>> 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?
> 
> 
> %num1 is a misnomer and should read num1.
> 
> Probably, you aren't granted insert or select rights directly on
> table1 and/or table2, only via a role.
> 
> Always post error messages.
> 
> 
> hth
> Rene Nyffenegger
> 
> 
> 

Sorry - the %num1 was a typo, its &num1 for a variable. Table1 and Table2 are both in my schema so I own them, but I'll double check the rights when I get back to work on monday. (or perhaps later today if my dial-up connection to the citrix server behaves) Received on Sat May 03 2003 - 13:31:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US