> On May 10, 7:50 am, Andrea <netsecur
@tiscali.it> wrote:
> > hi,
> > i would like to run this simple procedure:
> > create or replace procedure p_test as
> > BEGIN
> > FINE := 'NO';
> > EXIT WHEN FINE = 'YES';
> > accept ID char prompt "INSERT DOT FOR CONTINUE"
> > select * from prova;
> > IF ID := '.' THEN
> > FINE := 'YES';
> > END IF;
> > END LOOP;
> > END;
> > /
> > but it sho me error:
> > 6/8 PLS-00103: Encountered the symbol "ID" when expecting one of the
> > following:
> > := . ( @ % ;
> > can someone help me please?
> > thanks
> You cannot use 'accept' in a PL/SQL block; it is a SQL*Plus command.
> AFAIK you cannot have an interactive PL/SQL block. What, exactly, are
> you trying to accomplish? There is likely a much better way to do
> whatever it is you're trying to do.
On May 10, 8:20 am, Andrea <netsecur
@tiscali.it> wrote:
> On 10 Mag, 14:56, "fitzjarr
@cox.net" <fitzjarr
@cox.net> wrote:
> > On May 10, 7:50 am, Andrea <netsecur@tiscali.it> wrote:
> > > hi,
> > > i would like to run this simple procedure:
> > > create or replace procedure p_test as
> > > BEGIN
> > > FINE := 'NO';
> > > EXIT WHEN FINE = 'YES';
> > > accept ID char prompt "INSERT DOT FOR CONTINUE"
> > > select * from prova;
> > > IF ID := '.' THEN
> > > FINE := 'YES';
> > > END IF;
> > > END LOOP;
> > > END;
> > > /
> > > but it sho me error:
> > > 6/8 PLS-00103: Encountered the symbol "ID" when expecting one of the
> > > following:
> > > := . ( @ % ;
> > > can someone help me please?
> > > thanks
> > You cannot use 'accept' in a PL/SQL block; it is a SQL*Plus command.
> > AFAIK you cannot have an interactive PL/SQL block. What, exactly, are
> > you trying to accomplish? There is likely a much better way to do
> > whatever it is you're trying to do.
> i have this sql for to verify a input barcode from user :
> accept ID char prompt "INSERT BARCODE TO VERIFY:"
> select a.identifier,b.card_number_1
> card_number,a.surname,a.name,b.clear_code,a.parameter_2,
> a.parameter_3,b.on_ctu_disable
> from ac_employee a,ac_card b,ac_card_site c
> where a.identifier like '%&ID'
> and b.clear_code like '%&ID'
> and c.card_id in (select card_id from ac_card where clear_code like
> '%&ID');
> now i would like to input more than one barcode (even a list of
> barcode), and i have think that a loop with a procedure is the better
> choice..
> there is some method for gather this result?
> thanks- Hide quoted text -
>
I should think either a Pro*C/C++, OCI or OCCI program would be more
suited to such activity. PL/SQL is not intended to be an interactive
language. Even a shell script would provide such functionality as you
can read input from the keyboard; without using a list of values a
shell script would need to open a connection for each barcode
verified, verify or reject the barcode entered and close that
connection, looping for more input from the user. A Pro*C/C++, OCI or
OCCI program could open one connection and use it to verify any number
of barcodes, a more efficient mechanism.
I would consult the documentation at http://tahiti.oracle.com.
David Fitzjarrell
-----------------------------------------------Reply-----------------------------------------------
On 10 May, 13:50, Andrea <netsecur
@tiscali.it> wrote:
> hi,
> i would like to run this simple procedure:
> create or replace procedure p_test as
> BEGIN
> FINE := 'NO';
> EXIT WHEN FINE = 'YES';
> accept ID char prompt "INSERT DOT FOR CONTINUE"
> select * from prova;
> IF ID := '.' THEN
> FINE := 'YES';
> END IF;
> END LOOP;
> END;
> /
> but it sho me error:
> 6/8 PLS-00103: Encountered the symbol "ID" when expecting one of the
> following:
> := . ( @ % ;
> can someone help me please?
> thanks
Apart from what David has told you, you might consider trying the
following query:
select keyword
from v$reserved_words
where keyword like 'ID%';
HTH
-g
-----------------------------------------------Reply-----------------------------------------------
On Thu, 10 May 2007 05:50:24 -0700, Andrea wrote:
> hi,
> i would like to run this simple procedure:
> create or replace procedure p_test as BEGIN
> FINE := 'NO';
> EXIT WHEN FINE = 'YES';
> accept ID char prompt "INSERT DOT FOR CONTINUE"
> select * from prova;
> IF ID := '.' THEN
> FINE := 'YES';
> END IF;
> END LOOP;
> END;
> /
> but it sho me error:
> 6/8 PLS-00103: Encountered the symbol "ID" when expecting one of the
> following:
> := . ( @ % ;
> can someone help me please?
Yes. Manuals.
--
http://www.mladen-gogala.com
-----------------------------------------------Reply-----------------------------------------------
On Thu, 10 May 2007 06:44:34 -0700, fitzjarr
@cox.net wrote:
> I should think either a Pro*C/C++, OCI or OCCI program would be more
> suited to such activity.
And Perl. Everybody keeps forgetting about Perl.
--
http://www.mladen-gogala.com
-----------------------------------------------Reply-----------------------------------------------
On May 10, 3:13 pm, Mladen Gogala <mgogala.SPAM
@not-at-verizon.net>
wrote:
> On Thu, 10 May 2007 06:44:34 -0700, fitzjarr
@cox.net wrote:
> > I should think either a Pro*C/C++, OCI or OCCI program would be more
> > suited to such activity.
> And Perl. Everybody keeps forgetting about Perl.
> --http://www.mladen-gogala.com
A year ago you were complaining about Perl not supporting array
interfaces. Is that no longer the case? Not being snippity, I really
don't know and am curious. (I saw
http://groups.google.com/group/perl.dbi.dev/browse_thread/thread/1661... and
http://groups.google.com/group/perl.dbi.users/browse_thread/thread/9c... but that just made me more curious as to what I've missed.)
jg
--
@home.com is bogus.
And while looking, found http://groups.google.com/group/johns-jokes/web/1998-jokes-archive
has a perl reference...
-----------------------------------------------Reply-----------------------------------------------
thread/16617dcc91eca5dc/b7d41190e88892b8?lnk=st&q=&rnum=2#b7d41190e88892b8
thread/9c826edf190e3d44/5d2bb9d1ef7d7931?lnk=st&q=&rnum=5#5d2bb9d1ef7d7931
> but that just made me more curious as to what I've missed.)
Perl now supports array interface, which makes it great. If John Scoles
of the Pythian Group is reading this, many thanks for that! Great job!
Perl supports array interface as of DBD::Oracle 1.17a. The current version
is 1.19.
--
http://www.mladen-gogala.com