dbTalk Databases Forums  

field seperator in select / wrong statement ?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss field seperator in select / wrong statement ? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kai Baumgart
 
Posts: n/a

Default field seperator in select / wrong statement ? - 08-26-2003 , 09:14 AM






Hi,

is there a way to set a field-seperator for the output? I have to get a
row of fields which also can contain spaces. So the blank for the
field-seperator is unuseful.

I'd tried (found in the web):

$ db2 "SELECT name || ';' || uid FROM foo.bar WHERE login='test'"

returned:
SQL0440N No authorazied routine named "||" of type "" having compatible
arguments was found. SQLSTATE=42884

also tried

$ db2 "SELECT CONCAT (name, ';', uid) as mytest from foo.bar where
login='test'"

returned nearly the same:
QL0440N No authorazied routine named "CONCAT" of type "" having compatible
arguments was found. SQLSTATE=42884

has anyone some hints?

regards,

Kai

Server: IBM DB2 UDB 7.2.2 running on AIX
Client: IBM DB2 8.1 running on Linux


Reply With Quote
  #2  
Old   
Anton Versteeg
 
Posts: n/a

Default Re: field seperator in select / wrong statement ? - 08-26-2003 , 09:56 AM






Both
db2 "SELECT name || ';' || uid FROM foo.bar WHERE login='test'"
and
db2 "SELECT name concat ';' concat uid FROM foo.bar WHERE login='test'"
should work

Kai Baumgart wrote:

Quote:
Hi,

is there a way to set a field-seperator for the output? I have to get
a row of fields which also can contain spaces. So the blank for the
field-seperator is unuseful.

I'd tried (found in the web):

$ db2 "SELECT name || ';' || uid FROM foo.bar WHERE login='test'"

returned:
SQL0440N No authorazied routine named "||" of type "" having compatible
arguments was found. SQLSTATE=42884

also tried

$ db2 "SELECT CONCAT (name, ';', uid) as mytest from foo.bar where
login='test'"

returned nearly the same:
QL0440N No authorazied routine named "CONCAT" of type "" having
compatible
arguments was found. SQLSTATE=42884

has anyone some hints?

regards,

Kai

Server: IBM DB2 UDB 7.2.2 running on AIX
Client: IBM DB2 8.1 running on Linux

--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.