Solved

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

Posted on 2008-09-29
6
3,060 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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 24

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 24

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now