From: Morch on
I'm using the CLP on a Windows XP machine, DB2 ESE 9.5. I connect to
the SAMPLE database and issue the following command :

db2 select * from proj where deptno <> 'E21'

and the response I get is :

> was unexpected at this time.

If I use the command editor application (GUI thingie) and enter the
same command (minus the "db2") it all works fine.

It seems that the CLP dislikes the <> operator for some reason.

Can anyone elucidate me on this?

Mairhtin
From: The Boss on
On May 20, 6:03 pm, Morch <mairh...(a)gmail.com> wrote:
> I'm using the CLP on a Windows XP machine, DB2 ESE 9.5.  I connect to
> the SAMPLE database and issue the following command :
>
> db2 select * from proj where deptno <> 'E21'
>
> and the response I get is :
>
> > was unexpected at this time.
>
> If I use the command editor application (GUI thingie) and enter the
> same command (minus the "db2") it all works fine.
>
> It seems that the CLP dislikes the <> operator for some reason.
>
> Can anyone elucidate me on this?
>
> Mairhtin

In CLP you should 'double quote' your SQL-statements to prevent wrong
interpretations like this by the OS.
Change your statement like this:
db2 "select * from proj where deptno <> E'21'"

HTH

--
Jeroen
From: The Boss on
On May 20, 6:14 pm, The Boss <nlt...(a)baasbovenbaas.demon.nl> wrote:
> On May 20, 6:03 pm, Morch <mairh...(a)gmail.com> wrote:
>
>
>
>
>
> > I'm using the CLP on a Windows XP machine, DB2 ESE 9.5.  I connect to
> > the SAMPLE database and issue the following command :
>
> > db2 select * from proj where deptno <> 'E21'
>
> > and the response I get is :
>
> > > was unexpected at this time.
>
> > If I use the command editor application (GUI thingie) and enter the
> > same command (minus the "db2") it all works fine.
>
> > It seems that the CLP dislikes the <> operator for some reason.
>
> > Can anyone elucidate me on this?
>
> > Mairhtin
>
> In CLP you should 'double quote' your SQL-statements to prevent wrong
> interpretations like this by the OS.
> Change your statement like this:
> db2 "select * from proj where deptno <> E'21'"
>
> HTH
>

Sorry for the typo, E'21' should be 'E21' of course.

--
Jeroen
From: Morch on
Thanks for that. I tried single quotes around the command, like I
would do in a Unix Shell prompt, and when it failed, I raised my fists
to the heavens and cursed. I didn't try double quotes. Stupid
Windoze.

M


On May 20, 11:17 am, The Boss <nlt...(a)baasbovenbaas.demon.nl> wrote:
> On May 20, 6:14 pm, The Boss <nlt...(a)baasbovenbaas.demon.nl> wrote:
>
>
>
> > On May 20, 6:03 pm, Morch <mairh...(a)gmail.com> wrote:
>
> > > I'm using the CLP on a Windows XP machine, DB2 ESE 9.5.  I connect to
> > > the SAMPLE database and issue the following command :
>
> > > db2 select * from proj where deptno <> 'E21'
>
> > > and the response I get is :
>
> > > > was unexpected at this time.
>
> > > If I use the command editor application (GUI thingie) and enter the
> > > same command (minus the "db2") it all works fine.
>
> > > It seems that the CLP dislikes the <> operator for some reason.
>
> > > Can anyone elucidate me on this?
>
> > > Mairhtin
>
> > In CLP you should 'double quote' your SQL-statements to prevent wrong
> > interpretations like this by the OS.
> > Change your statement like this:
> > db2 "select * from proj where deptno <> E'21'"
>
> > HTH
>
> Sorry for the typo, E'21' should be 'E21' of course.
>
> --
> Jeroen

From: Helmut Tessarek on
You have to use double quotes in a UNIX shell as well.

On 20.05.10 14:17 , Morch wrote:
> Thanks for that. I tried single quotes around the command, like I
> would do in a Unix Shell prompt, and when it failed, I raised my fists
> to the heavens and cursed. I didn't try double quotes. Stupid
> Windoze.


--
Helmut K. C. Tessarek
DB2 Performance and Development

/*
Thou shalt not follow the NULL pointer for chaos and madness
await thee at its end.
*/