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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Variable

Re: SQL Variable

From: Arto Viitanen <arto.viitanen_at_csc.fi>
Date: Fri, 27 Apr 2007 08:48:47 +0300
Message-ID: <46318ebf$0$4153$ba624cd0@newsread.funet.fi>


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
Received on Fri Apr 27 2007 - 00:48:47 CDT

Original text of this message

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