> How can I specify column delimiter while selecting data from a table?
Are you talking about using one of the utilities for import/export?
A regular select statement will put the data into an appropriate host
variable. Are you talking about some way of limiting the data that
goes into the host variable?
Something like
select substr(c1, 1, locate(' ', c1)) from sometable ?
I tried the following on the sample database and it worked
select substr(firstnme, 1, locate('N', firstnme)) from employee
You could replace "N" with the delimiter of your choice.
--
Lorne Sunley
What do you want to do? Do you have an example? Are you using some sort of
programming language? Then you usually retrieve the columns into separate
variables. Do you want to EXPORT data? Then you have the COLDEL option.
--
Knut Stolze
DB2 Spatial Extender
IBM Silicon Valley Lab
db2 "select * from zipcode" >output.out
case2
db2 list applications show detail > output.out2
"Knut Stolze" <sto...@us.ibm.com> wrote in message
news:slrnacgq84...@stolze.svl.ibm.com...
Sorry, but I still don't understand what you want to do. Both statements
have a similar output (at least on my system). Could you explain what you
get and what you want to get?
I assume that you run the statement on the command line. Given that, you
can use any scripting language or tool (Perl, awk, sed, ...) to format the
output in any way you like.
Besides, one is a SQL statement that selects data from a table, the other is
a db2 command (not an SQL statement) that retrieves some other information,
which are not in a table in the database.