Solved

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

Posted on 2008-09-29
6
3,110 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 45

Expert Comment

by:Kdo
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 45

Accepted Solution

by:
Kdo earned 40 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 30 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 25

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 30 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 25

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
InterSystems Caché OPEN QUERY 4 485
DB2 Integer to Decimal 1 131
DB2 - LOG FILES. 4 51
DB2 SQL How to complete the pivoting of this data. 5 56
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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