From: Lennart Jonsson on
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
> 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
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
Try db2 "SELECT * FROM "myTable""
;-)


--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

From: Helmut Tessarek on
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.
*/