I think the fact your error message was more clear is because distinct
oracle version or setup, here we use 10.2.0.4.0. Problem really was with
the select, using SELECT INTO worked like a charm!
Special thanks, you saved me a lot of time.
Matheus
Em Qui, 2011-12-22 às 14:47 +0000, Drav Sloan escreveu:
> Matheus Garcia wrote:
> > First of all, forgot to say, but I was using 3.1, now I upgraded to
> > 3.3.0. Running on Linux.
>
> Well you are now on latest version with 3.3.0 :)
>
> > I tried
> > SELECT :var FROM dual
> > and squirrel asked me for the value of var, very good, thanks!
> >
> > Then I tried the code:
> > DECLARE
> > v1 NUMBER(3);
> > BEGIN
> > v1 := 3;
> > select v1 from dual
> > END;
> > /
> >
> > After adding the slash in the end, instead of
> > "java.lang.IllegalArgumentException: No SQL selected for execution.",
> > I'm getting the following error:
> >
> > Error: ORA-06550: line 7, column 1:
> > PLS-00103: Encountered the symbol "end-of-file" when expecting one of
> > the following:
>
> You _may_ need to load the oracle plugin, which again is under
> Plugins -> Summary and is simply called 'oracle' (but as far
> as I know that just enables things like the database output window).
>
> If I run the statement:
>
> DECLARE
> v1 NUMBER(3);
> BEGIN
> v1 := 3;
> select v1 from dual
> END;
> /
>
> I get:
>
> Error: ORA-06550: line 5, column 2:
> PLS-00428: an INTO clause is expected in this SELECT statement
>
> SQLState: 65000
> ErrorCode: 6550
> Position: 991
>
>
>
>
>
> .. all procedural oracle code uses SELECT INTO. However, if I do:
>
> DECLARE
> v1 NUMBER(3);
> BEGIN
> select 3 into v1 from dual;
> dbms_output.put_line(v1||chr(13));
> END;
> /
>
> I get '3' in the oracle output window ('View Oracle Database Output'
> quick icon opens this up)
>
> Regards
>
> D.
--
Matheus Garcia Barbosa de Figueiredo
Tel.: (31) 2108 - 7018
Analista de Sistemas
Gerência de Desenvolvimento de Sistemas - GDS
Gerência-Geral de Sistemas de Informação - GSI
Assembleia Legislativa de Minas Gerais - ALMG
|