Solved

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

Posted on 2008-09-29
6
3,185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 45

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 45

Accepted Solution

by:
Kent Olsen 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

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 (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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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