473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Export to CSV-File

Hello all,

is there another way to export data to a csv-file (comma-separated format)?
We tried the EXPORT-command and got the following error
"
SQL1325N The remote database environment does not support the command
or one of the command options.

Explanation: An attempt has been made to issue a DB2 workstation database
specific command or command option against a host database through DB2
Connect or federated server. The following commands generate this error when
issued against a DB2 for MVS*, DB2 for OS/400* or SQL/DS* database:

a.. OPSTAT (Collect Operational Status)
b.. DARI (Database Application Remote Interface)
c.. GETAA (Get Administrative Authorizations)
d.. GETTA (Get Table Authorizations)
e.. PREREORG (Prepare to Reorganize Table)
f.. REORG (Call Reorganize Function)
g.. RQSVPT/ENSVPT/RLBSVPT (Subtransaction Requests)
h.. RUNSTATS (Run Statistics).
i.. COMPOUND SQL ATOMIC STATIC (Atomic Compound SQL)
j.. ACTIVATE DATABASE
k.. DEACTIVATE DATABASE
As well, the following commands generate this error with incorrect options:

a.. IMPORT (Import table) The filetype must be IXF, commitcount must be 0,
and the first word in the Action String (e.g. "REPLACE into ...") must be
INSERT.
b.. EXPORT (Export table) The filetype must be IXF.
The command cannot be processed.

User Response: Do not attempt to issue this command against a host database
through DB2 Connect or federated server.

"
Well, is there a workaround or am I hopelessly stuck?

Thanks for any help in advance!

Bye!
Oli
Nov 12 '05 #1
6 33781
You can simulate export to CSV with a Select statement.
For instance:

select '"""' concat rtrim(charcol1) concat '""",' , '"""' concat
rtrim(charcol2) concat '""",' , numcol3 from table

Oliver Stratmann wrote:
Hello all,

is there another way to export data to a csv-file (comma-separated format)?
We tried the EXPORT-command and got the following error
"
SQL1325N The remote database environment does not support the command
or one of the command options.

Explanation: An attempt has been made to issue a DB2 workstation database
specific command or command option against a host database through DB2
Connect or federated server. The following commands generate this error when
issued against a DB2 for MVS*, DB2 for OS/400* or SQL/DS* database:

a.. OPSTAT (Collect Operational Status)
b.. DARI (Database Application Remote Interface)
c.. GETAA (Get Administrative Authorizations)
d.. GETTA (Get Table Authorizations)
e.. PREREORG (Prepare to Reorganize Table)
f.. REORG (Call Reorganize Function)
g.. RQSVPT/ENSVPT/RLBSVPT (Subtransaction Requests)
h.. RUNSTATS (Run Statistics).
i.. COMPOUND SQL ATOMIC STATIC (Atomic Compound SQL)
j.. ACTIVATE DATABASE
k.. DEACTIVATE DATABASE
As well, the following commands generate this error with incorrect options:

a.. IMPORT (Import table) The filetype must be IXF, commitcount must be 0,
and the first word in the Action String (e.g. "REPLACE into ...") must be
INSERT.
b.. EXPORT (Export table) The filetype must be IXF.
The command cannot be processed.

User Response: Do not attempt to issue this command against a host database
through DB2 Connect or federated server.

"
Well, is there a workaround or am I hopelessly stuck?

Thanks for any help in advance!

Bye!
Oli


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #2
Hello Anton,

if this is the only way I will implement it. Though it is a bit tedious
because I have to export quite a lot of different tables.
If there is no other way. I will start to write a Select which generates
SELECT-statements as depicted by You below.

Thank You for Your help!

Bye!
Oli

"Anton Versteeg" <an************@nnll.ibm.com> schrieb im Newsbeitrag
news:cb**********@sp15en20.hursley.ibm.com...
You can simulate export to CSV with a Select statement.
For instance:

select '"""' concat rtrim(charcol1) concat '""",' , '"""' concat
rtrim(charcol2) concat '""",' , numcol3 from table

Oliver Stratmann wrote:
Hello all,

is there another way to export data to a csv-file (comma-separated format)? We tried the EXPORT-command and got the following error
"
SQL1325N The remote database environment does not support the command or one of the command options.

Explanation: An attempt has been made to issue a DB2 workstation database specific command or command option against a host database through DB2
Connect or federated server. The following commands generate this error when issued against a DB2 for MVS*, DB2 for OS/400* or SQL/DS* database:

a.. OPSTAT (Collect Operational Status)
b.. DARI (Database Application Remote Interface)
c.. GETAA (Get Administrative Authorizations)
d.. GETTA (Get Table Authorizations)
e.. PREREORG (Prepare to Reorganize Table)
f.. REORG (Call Reorganize Function)
g.. RQSVPT/ENSVPT/RLBSVPT (Subtransaction Requests)
h.. RUNSTATS (Run Statistics).
i.. COMPOUND SQL ATOMIC STATIC (Atomic Compound SQL)
j.. ACTIVATE DATABASE
k.. DEACTIVATE DATABASE
As well, the following commands generate this error with incorrect options:
a.. IMPORT (Import table) The filetype must be IXF, commitcount must be 0, and the first word in the Action String (e.g. "REPLACE into ...") must be INSERT.
b.. EXPORT (Export table) The filetype must be IXF.
The command cannot be processed.

User Response: Do not attempt to issue this command against a host database through DB2 Connect or federated server.

"
Well, is there a workaround or am I hopelessly stuck?

Thanks for any help in advance!

Bye!
Oli


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #3
Oliver Stratmann wrote:
Hello Anton,

if this is the only way I will implement it. Though it is a bit tedious
because I have to export quite a lot of different tables.
If there is no other way. I will start to write a Select which generates
SELECT-statements as depicted by You below.


1. Export to .IXF file format all your host tables.
2. For each of the table:
a) import into local database (here IXF format comes handy - it
will create table for you;
b) export table in CSV;
c) drop table (but why are you exporting in CSV format when you
already have table in local database from step a?)
3. Have a beer (job finished).

Jan M. Nelken
Nov 12 '05 #4
"Jan M. Nelken" <Un**********@Invalid.Domain> wrote in message
1. Export to .IXF file format all your host tables.
2. For each of the table:
a) import into local database (here IXF format comes handy - it
will create table for you;
b) export table in CSV;
c) drop table (but why are you exporting in CSV format when you
already have table in local database from step a?)


The above looks like easiest solution for quite a lot of tables.

Here's another just in case - for each table, build your query based
upon system tables. The query builder would be a little bit of work,
but you only need to write that once - and embed it into a function or
whatever. Then just call it for each table you want to export.

buck
Nov 12 '05 #5
Buck Nuggets wrote:
Here's another just in case - for each table, build your query based
upon system tables. The query builder would be a little bit of work,
but you only need to write that once - and embed it into a function or
whatever. Then just call it for each table you want to export.


Just as a starting point - I would run:

db2 -xtvf export.script -o doexport.script

where export.script would contain followin lines:
------------------- Begin of script-------------------
select
'export to '
concat
substr(tabschema,1,length(rtrim(tabschema)))
concat
'.'
concat
substr(tabname,1,length(rtrim(tabname)))
concat
'.IXF of ixf SELECT * FROM '
concat
substr(tabschema,1,length(rtrim(tabschema)))
concat
'.'
concat
substr(tabname,1,length(rtrim(tabname)))
from
syscat.tables
where
tabschema not in ('SYSIBM','SYSCAT','SYSSTAT','SYSTOOLS','SYSTEM')
;
------------------- End of script-------------------

Jan M. Nelken
Nov 12 '05 #6
DB2 for z/OS V8 supports LOAD/UNLOAD for delimited data.
Not sure if you can wait that long though, since migration to V8 is not
that trivial.

Oliver Stratmann wrote:
Hello Anton,

if this is the only way I will implement it. Though it is a bit tedious
because I have to export quite a lot of different tables.
If there is no other way. I will start to write a Select which generates
SELECT-statements as depicted by You below.

Thank You for Your help!

Bye!
Oli

"Anton Versteeg" <an************@nnll.ibm.com> schrieb im Newsbeitrag
news:cb**********@sp15en20.hursley.ibm.com...
You can simulate export to CSV with a Select statement.
For instance:

select '"""' concat rtrim(charcol1) concat '""",' , '"""' concat
rtrim(charcol2) concat '""",' , numcol3 from table

Oliver Stratmann wrote:
Hello all,

is there another way to export data to a csv-file (comma-separated
format)?
We tried the EXPORT-command and got the following error
"
SQL1325N The remote database environment does not support the
command
or one of the command options.

Explanation: An attempt has been made to issue a DB2 workstation
database
specific command or command option against a host database through DB2
Connect or federated server. The following commands generate this error
when
issued against a DB2 for MVS*, DB2 for OS/400* or SQL/DS* database:

a.. OPSTAT (Collect Operational Status)
b.. DARI (Database Application Remote Interface)
c.. GETAA (Get Administrative Authorizations)
d.. GETTA (Get Table Authorizations)
e.. PREREORG (Prepare to Reorganize Table)
f.. REORG (Call Reorganize Function)
g.. RQSVPT/ENSVPT/RLBSVPT (Subtransaction Requests)
h.. RUNSTATS (Run Statistics).
i.. COMPOUND SQL ATOMIC STATIC (Atomic Compound SQL)
j.. ACTIVATE DATABASE
k.. DEACTIVATE DATABASE
As well, the following commands generate this error with incorrect
options:
a.. IMPORT (Import table) The filetype must be IXF, commitcount must
be 0,
and the first word in the Action String (e.g. "REPLACE into ...") must
be
INSERT.
b.. EXPORT (Export table) The filetype must be IXF.
The command cannot be processed.

User Response: Do not attempt to issue this command against a host
database
through DB2 Connect or federated server.

"
Well, is there a workaround or am I hopelessly stuck?

Thanks for any help in advance!

Bye!
Oli


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands



--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Zeff | last post by:
Hi all, I'm trying to generate a csv file from an ldap query (by generating a string by concatenating with comma's - echo of the string in the browser looks fine). Is there a simple way...
1
by: kk | last post by:
Hi, I am trying to set up scheduled export in DB2. DB2 seems to be missing the ability to export column names for CSV. Apparently 'method N' is only for ixf and wsf files. I have a C# and/or...
3
by: John Graham | last post by:
I thought this would be easier, however I seem to be struggling with this. I'd like to create a command button that will look at a certain query I have created and export the records as a csv...
1
by: johnlim20088 | last post by:
Hi All, I does have a question about export datagrid data to csv. Well, I know the common solution is 1) select the data again and put in the datatable, then export to csv. BUT I don't want...
13
by: lightning | last post by:
I have a search form that returns records to another form, rather than a table. Here are my questions: 1) Is it possible to export the form results (as opposed to query results) to CSV? I've been...
2
by: Designing Solutions WD | last post by:
Hello, I have some questions on my options available. I have to export some tables to csv files to enable another department to process the files. What I need is a way to do this in ms sql...
3
by: babdya | last post by:
Hi there, I need to extract huge amount of data from a DB2 dabase periodically. The extracted data needs to be exported to CSV format. I have thought of writing a Java piece of code to connect to...
2
by: naish | last post by:
Hey i have on question? I have CSV data and i want to import it to the excel sheet. I know about Microsoft.Office.Interop.Excel but still i am not able to do it. Thks in advance Nai
1
by: hjaffer2001 | last post by:
I have three array values using nested loop. Now i want to export the array values to csv(excel). The code is for($j=0;$j<count($TimeEntriesList);$j++){ ...
3
by: maheswaran | last post by:
Hi, i have no problem in export the data from php to csv. But i have struggled to put the <br> in of csv coloumn. Here the details PostId PostTitle Reply Ip 1 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.