Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Variable
On Apr 27, 1:48 pm, Arto Viitanen <arto.viita..._at_csc.fi> wrote:
> beerora wrote:
> > Hi,
>
> > I've got following error
>
> > old 7: strTblName := '&1';
> > new 7: strTblName := 'TB_B4000';
> > ERROR:
> > ORA-01756: quoted string not properly terminated
>
> > And my SQL is
>
> > declare
> > strTblName char;
> > s number;
> > b date;
> > BEGIN
> > b:=sysdate;
> > strTblName := '&1';
> > END;
>
> > Pls guide me what mistakes in my SQL.
>
> > Thanks.
>
> > Cheers,
>
> You declared strTblName as char, which takes one char. So when
> you assign 'TB_B4000' to it, only the first character is assigned.
> And as you have only one ', the string is not terminated.
>
> Solution? Declare strTblName as VARCHAR(20) (for example).
>
> --
> Arto Viitanen, CSC Ltd.
> Espoo, Finland- Hide quoted text -
>
> - Show quoted text -
Thanks Arto.
After I've changed to varchar or varchar2, still got the same error.
Cheers Received on Fri Apr 27 2007 - 02:08:34 CDT