db2 export

db2 export

Post by Jorri » Thu, 31 Jan 2002 23:36:41



SQL command EXPORT:

    export to dump.txt to del
    modified by chardel''
    select * from table

About "chardel". Is it possible not to have a character delimiter/qualifier?

Thanks in advance!

Jorrit

 
 
 

db2 export

Post by Knut Stol » Fri, 01 Feb 2002 04:04:11



> SQL command EXPORT:

>     export to dump.txt to del
>     modified by chardel''
>     select * from table

> About "chardel". Is it possible not to have a character delimiter/qualifier?

Is there a particular reason why you want to do that?  I don't quite
understand why you want to do that in the first place.

How would export/import be able to distinguish between the string '12345'
and the numeric value 12345, then?  How should db2 handle strings like
'abc,def', i.e. where a column delimiter is embedded in the string?

But you can use perl/python/sed/awk to strip out the delimiters from the
resulting file.

--
Knut Stolze
DB2 Spatial Extender
IBM Silicon Valley Lab

 
 
 

db2 export

Post by Spark » Fri, 01 Feb 2002 07:20:08


The answer to your question is NO.  Why would you want to do that?  If your
trying to produce an ASCII fixed length file EXPORT will not do that so you
might look into the command called db2batch.  To get rid of the character
delimiters you'd need a PERL script or something similiar to do that.


Quote:

> SQL command EXPORT:

>     export to dump.txt to del
>     modified by chardel''
>     select * from table

> About "chardel". Is it possible not to have a character

delimiter/qualifier?
Quote:

> Thanks in advance!

> Jorrit

 
 
 

db2 export

Post by paul.ver.. » Sat, 02 Feb 2002 00:01:35


You must have a delimiter in export, so from the command line simply try

db2 -x "select CHAR(col1) || CHAR(col2) || CHAR(col3) ... from table"  >
output.txt

;-)

Regards
Paul Vernon

 
 
 

db2 export

Post by Knut Stol » Sat, 02 Feb 2002 04:57:08



> You must have a delimiter in export, so from the command line simply try

> db2 -x "select CHAR(col1) || CHAR(col2) || CHAR(col3) ... from table"  >
> output.txt

You can also use such a select statement directly in the export command.

--
Knut Stolze
DB2 Spatial Extender
IBM Silicon Valley Lab

 
 
 

db2 export

Post by paul.ver.. » Sat, 02 Feb 2002 21:22:38


Quote:> You can also use such a select statement directly in the export command.

Aye, but you will still get the character delimiter around the single
concatenated column with export.

I wonder if there is any performance difference between export and select

Quote:> file ??

Regards
Paul Vernon
 
 
 

db2 export

Post by Knut Stol » Sun, 03 Feb 2002 04:44:13



>> You can also use such a select statement directly in the export command.

> Aye, but you will still get the character delimiter around the single
> concatenated column with export.

Yep, that's true - I forgot about that.

Quote:> I wonder if there is any performance difference between export and select
> > file ??

Good question.  I know there is no difference for the Spatial Extender's
export functionality, but that is something else that db2's export to a
delimited file.

--
Knut Stolze
DB2 Spatial Extender
IBM Silicon Valley Lab

 
 
 

1. DB2 Export function

Please help!!!!!!!!!!!!!!!
Im developing a application which access data on a DB2 database. One
task should be to export data from the database to a file in different
formats. I know the DB2 command ?EXPORT", it would be optimal solution.
The problem is I need such function in my program not as a separate
application call. I studied the SDK for DB2 (Ver. 2.1.2) and I found the
function ?sqluexpr" which performs this operation. Now where is the
problem?
My application is written in Pascal (Delphi3) on Win NT and I cant use
the libraries delivered with the SDK. The only solution (I think) to
solve this problem is to call the function stored in DLL. Then I
translated part of the header Files and tried to call this function in
the DB2Util.dll without success. From the C samples I pointed out that
the function need some kind of runtime environment to work.
How can I do this? Should I call some other functions before that? Which
DLL files are the right?
I am sure it is possible!

Thanks for your help

Peter


2. Can I install SQL Server 6.5 under NT Workstation????

3. sql*loader using db2 exported file

4. Using temp lobs in a function

5. Accessing directly DB2 export files

6. Ingres on Linux

7. DB2 Export

8. dbase IV format file

9. DB2 EXPORT FAILURE/CRASH

10. db2 export warnings

11. Coding a DB2 export app - dire need of ideas!

12. backup/export/import from DB2 to DB2

13. back up -- import - export -- DB2 to DB2