Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3576
  • Last Modified:

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

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
Mark_rusci
Asked:
Mark_rusci
3 Solutions
 
Kent OlsenData Warehouse Architect / DBACommented:
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
 
Mark_rusciAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
momi_sabagCommented:
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
 
Tomas Helgi JohannssonCommented:
    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
 
Tomas Helgi JohannssonCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now