| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Variable
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, FinlandReceived on Fri Apr 27 2007 - 00:48:47 CDT
![]() |
![]() |