![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
was unexpected at this time. |
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
On May 20, 6:03*pm, Morch <mairh... (AT) gmail (DOT) 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 |
#4
| |||
| |||
|
|
On May 20, 6:14*pm, The Boss <nlt... (AT) baasbovenbaas (DOT) demon.nl> wrote: On May 20, 6:03*pm, Morch <mairh... (AT) gmail (DOT) 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 |
#5
| |||
| |||
|
|
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. |
#6
| |||
| |||
|
|
You have to use double quotes in a UNIX shell as well. |
|
On 20.05.10 14:17 , Morch wrote: [...] Stupid Windoze. |
#7
| |||
| |||
|
|
My first reaction as well, but it actually worked with quotes: [lelle@...]$ db2 'select count(*) from price' 1 ----------- 11765 |
#8
| |||
| |||
|
|
On 2010-05-21 02:07, Helmut Tessarek wrote: You have to use double quotes in a UNIX shell as well. My first reaction as well, but it actually worked with quotes: [lelle@...]$ db2 'select count(*) from price' |
|
1 ----------- 11765 1 record(s) selected. On 20.05.10 14:17 , Morch wrote: [...] Stupid Windoze. Agreed ;-) /Lennart |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Try db2 "SELECT * FROM "myTable"" ;-) |
![]() |
| Thread Tools | |
| Display Modes | |
| |