Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can I load a table using a .csv file in db2?

Posted on 2008-09-29
6
Medium Priority
?
3,342 Views
Last Modified: 2012-05-05
I have tried:  load client from 'C:\currentEmail.csv' of del insert into mytablename
but I recieve this error:

SQL1325N  The remote database environment does not support the command or one
of the command options.

SQL1325N  The remote database environment does not support the command or one of the command options.

Is this a authorization problem or do I have a syntax problem? The data file is comma delimited with " around the data fields.

Thanks for your help.
0
Comment
Question by:Mark_rusci
6 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 22598667
Hi Mark,

I know that that works on DB2/LUW as I've used it several times.  If you're on an LUW system it's probably just a syntax error (please post the exact command).

If you're on DB2 for Z/OS or AS/400, I'll have to defer to one of the guys that knows this better than do I.



Good Luck,
Kent
0
 

Author Comment

by:Mark_rusci
ID: 22598729
Hi Kent,

here is the complete command and response from db2 command center client:

------------------------------ Commands Entered ------------------------------
load from 'C:\currentEmailPrd.csv' of del insert into dbplse.pltrf001_emailaddr;
------------------------------------------------------------------------------
load from 'C:\currentEmailPrd.csv' of del insert into dbplse.pltrf001_emailaddr
SQL1325N  The remote database environment does not support the command or one
of the command options.

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:

o   OPSTAT (Collect Operational Status)

o   DARI (Database Application Remote Interface)

o   GETAA (Get Administrative Authorizations)

o   GETTA (Get Table Authorizations)

o   PREREORG (Prepare to Reorganize Table)

o   REORG (Call Reorganize Function)

o   RQSVPT/ENSVPT/RLBSVPT (Subtransaction Requests)

o   RUNSTATS (Run Statistics).  

o   COMPOUND SQL ATOMIC STATIC (Atomic Compound SQL)

o   ACTIVATE DATABASE

o   DEACTIVATE DATABASE

 

 As well, the following commands generate this error with
incorrect options:

o   IMPORT (Import table) The filetype must be IXF, commitcount  
    must be 0 for offline import or must not be automatic for    
    online import, and the first word in the Action String (for  
    example, "REPLACE into ...") must be INSERT.  

o   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.  

SQLCA Information
 sqlcaid : SQLCA    sqlcabc: 136 sqlcode: -1325 sqlerrml: 70
 sqlerrmc:   37 ITCPIED  DB2T QDB2       850                                    
 sqlerrp : SQLULOAD
 sqlerrd : [1]: 0 [2]: 0 [3]: 0
           [4]: 0 [5]: 0 [6]: 0
 sqlwarn : [1]:   [2]:   [3]:   [4]:   [5]:   [6]:  
           [7]:   [8]:   [9]:   [10]:   [11]:  
 sqlstate:      m€|€€€
€m€      €m€      4|
€ €
0
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 120 total points
ID: 22598878
Hi Mark,

Toward the bottom of the output is the text:

User Response:

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


You need to connect to the DB2 command line interface (or similar environment) directly connect to the database to do the load.

Kent

0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 90 total points
ID: 22598993
Hi Mark
check with your dba if that database is a luw db2 or a host db2 (zos or as400)
it seems that the database you are reffering in your command is a database that resides on a host system and is cataloged on your client so it seems as if it is a udb database even though it is not

db2 for zos / as400 provides other means to load data, just not using the above command
depending on the platform and version, you might be able to wrap the logic of loading data in a stored procedure and just call that procedure from the command center
otherwise, you will have to manually connect to the host system and perform the load operation there
0
 
LVL 26

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 90 total points
ID: 22607364
    Hi Mark!

You can load CSV file into DB2 LUW and z/OS (from version 8 ) and from a client through the DB2 Connect to the DB2 LUW.
However the command differs between LUW and z/OS and the data must reside on the mainframe to
be able to do the load.
And yes you must connect directly to the database and have enough privileges to perform LOAD statements
on the database/tablespace/table.

Regards,
   Tomas Helgi
0
 
LVL 26

Expert Comment

by:Tomas Helgi Johannsson
ID: 22607390
Other thing.

For DB2 LUW if you are connecting to a remote database using your DB2 Connect you
must issue the command
  db2 load client ......
otherwise you would get an error.

Regards,
    Tomas Helgi
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question