From: Lennart Jonsson on 21 May 2010 01:12 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
From: Helmut Tessarek on 21 May 2010 01:22 > My first reaction as well, but it actually worked with quotes: > > [lelle@...]$ db2 'select count(*) from price' > > 1 > ----------- > 11765 :-) Try: db2 'select * from proj where deptno <> 'E21'' -- Helmut K. C. Tessarek DB2 Performance and Development /* Thou shalt not follow the NULL pointer for chaos and madness await thee at its end. */
From: danfan46 on 21 May 2010 01:45 Lennart Jonsson wrote: > 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' > The difference between single and double qoutes is that within double quotes the shell with perform shell variable subsitution, between single qoutes not. echo "$HOSTNAME" ==> myhost echo '$HOSTNAME' ==> $HOSTNAME > 1 > ----------- > 11765 > > 1 record(s) selected. > > >> On 20.05.10 14:17 , Morch wrote: > [...] >> Stupid Windoze. >> > > Agreed ;-) > > > /Lennart
From: Serge Rielau on 21 May 2010 02:56 Try db2 "SELECT * FROM "myTable"" ;-) -- Serge Rielau SQL Architect DB2 for LUW IBM Toronto Lab
From: Helmut Tessarek on 21 May 2010 03:24 Good point. [db2inst1(a)tessus2 ~]$ db2 "select * from "myTable"" SQL0204N "DB2INST1.MYTABLE" is an undefined name. SQLSTATE=42704 [db2inst1(a)tessus2 ~]$ db2 "select * from \"myTable\"" C1 ----------- 0 record(s) selected. But db2 'select * from proj where deptno <> \'E21\'' does not work. That is the reason why I never use single quotes... On 21.05.10 2:56 , Serge Rielau wrote: > Try db2 "SELECT * FROM "myTable"" > ;-) > > -- Helmut K. C. Tessarek DB2 Performance and Development /* Thou shalt not follow the NULL pointer for chaos and madness await thee at its end. */
First
|
Prev
|
Pages: 1 2 Prev: IMPORT vs. LOAD Next: DB2 Version 8 - Date format automatic translation between USA and ISO |