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: sybrandb <sybrandb_at_gmail.com>
Date: 27 Apr 2007 02:06:56 -0700
Message-ID: <1177664816.564434.229720@r30g2000prh.googlegroups.com>


On Apr 27, 9:08 am, beerora <beersa.bee..._at_gmail.com> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -

Can not reproduce.
Please post an *exact* transcript.
You shouldn't include TB_B4000 in quotes when you specify it. The quotes are already there.

--
Sybrand Bakker
Senior Oracle DBA
Received on Fri Apr 27 2007 - 04:06:56 CDT

Original text of this message

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