473,413 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

load data with admin_cmd()

Hello,

is it not possible to load data with admin_cmd into a table?

This SP ended with SQL3304N The table does not exist.:

CREATE PROCEDURE ADM_LOAD ( )
DYNAMIC RESULT SETS 1

-- SQL Stored Procedure
P1: BEGIN

DECLARE GLOBAL TEMPORARY TABLE NEW
(TABLE_SCHEMA VARCHAR(128) NOT NULL,
TABLE_NAME VARCHAR(128) NOT NULL)
ON COMMIT PRESERVE ROWS
NOT LOGGED ON ROLLBACK PRESERVE ROWS
WITH REPLACE;

CALL SYSPROC.ADMIN_CMD('LOAD FROM "/db2/db2crm/test" OF DEL METHOD P
(1, 2) INSERT INTO SESSION.NEW (TABLE_SCHEMA, TABLE_NAME)
NONRECOVERABLE');

BEGIN
DECLARE cur CURSOR WITH RETURN TO CALLER
FOR SELECT DISTINCT TABLE_SCHEMA, TABLE_NAME
FROM SESSION.NEW;
OPEN cur;
END;

END P1

Best regards,
Joachim Müller
Jan 11 '08 #1
2 5010
Ian
jo***************@googlemail.com wrote:
Hello,

is it not possible to load data with admin_cmd into a table?

This SP ended with SQL3304N The table does not exist.:

CREATE PROCEDURE ADM_LOAD ( )
DYNAMIC RESULT SETS 1

-- SQL Stored Procedure
P1: BEGIN

DECLARE GLOBAL TEMPORARY TABLE NEW
(TABLE_SCHEMA VARCHAR(128) NOT NULL,
TABLE_NAME VARCHAR(128) NOT NULL)
ON COMMIT PRESERVE ROWS
NOT LOGGED ON ROLLBACK PRESERVE ROWS
WITH REPLACE;

CALL SYSPROC.ADMIN_CMD('LOAD FROM "/db2/db2crm/test" OF DEL METHOD P
(1, 2) INSERT INTO SESSION.NEW (TABLE_SCHEMA, TABLE_NAME)
NONRECOVERABLE');

You don't say what version of DB2 you're running, but I'll assume it's
at least 9.1.

The issue not that you are trying to use LOAD via ADMIN_CMD: It's that
LOAD does not work with declared global temporary tables. FYI, IMPORT
does not support DGTTs, either.

Jan 12 '08 #2
Ian wrote:
The issue not that you are trying to use LOAD via ADMIN_CMD: It's that
LOAD does not work with declared global temporary tables. FYI, IMPORT
does not support DGTTs, either.
LOAD builds up it's own connection. Since temps are connection private...

Joachim, we are in process of improving temp table support. If you can
formalize your requirement in an email it will be helpful.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lm | last post by:
Hi, How can i use JDBC driver to load some datas from DB2 DBMS with the load command and a specific delimiter ? Can u give me a sample ? Best regards
5
by: apattin | last post by:
Hi, Is it possible to run the db2 utility to load or import rows from Java? I cannot find the correct command line structure. Thanks in advance, Alejandrina
1
by: new | last post by:
I have data for each week in a single table. I need to export this data to a separate flat file for each week. Any ideas? DB2 SQL Query export to flat files as a function of data on each record
1
by: Gregor KovaĨ | last post by:
Hi! I'm using procedure ADMIN_CMD to export/import tables into IXF files. Is there a way to tell what codepage EXPORT/IMPORT should use? Best regards, Kovi --...
1
by: satish mullapudi | last post by:
Hi everyone, I am using DB2 v8.2. I am able to use the Data Movement Utilities (IMPORT/EXPORT/LOAD) from the db2 CLP. But now I got a scenario, where I need to call these utilities from within a...
7
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I've tried LOAD .... INSERT INTO TABLE_NAME. The docs say about INSERT option: "One of four modes under which the load utility can execute. Adds the loaded data to the table without...
4
by: Justin | last post by:
Excuted the statement through a SSH connection: db2 import from <filename.ixfof ixf messages /database/stage/ acct_news_asc.txt insert into userid.acct_news_asc And it worked fine. Ran the...
2
by: Shivakumar | last post by:
Friends, Can anyone help me how to use DB2 utilities like IMPORT/LOAD in ASP scripts ?
0
by: David Beardsley | last post by:
I'm trying to write a stored procedure that will terminate a load for a given table using the SYSPROC.ADMIN_CMD procedure. When I take the syntax that works using Quest: LOAD FROM '/dev/null'...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.