ADMIN_CMd

jsaravana
jsaravana used Ask the Experts™
on
HI Experts,

>>-ADMIN_GET_MSGS--(--operation_id--)--------------------------><

operation_id
An input argument of type VARCHAR(139) that specifies the operation ID of the message file(s) produced by a data movement utility that was executed through the ADMIN_CMD procedure. The operation ID is generated by the ADMIN_CMD procedure.

My ADMIN_CMD is :
CALL SYSPROC.ADMIN_CMD('import from C:\testfield.csv of del MESSAGES ON SERVER insert into administrator.test_title');

But I dont have any idea where the messages go and also most importantly i need to know the operation_id to pass to ADMIN_GET_MSGS.

How the operation_id of utility can be determined?
CREATE PROCEDURE data_load()
LANGUAGE SQL
P1:BEGIN
CALL SYSPROC.ADMIN_CMD('import from C:\testfield.csv of del MESSAGES ON SERVER insert into administrator.test_title');
END P1
@

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you get that value back from the admin_cmd invocation

Author

Commented:
Hi Experts,

Could yo please show me how to change the code for call call.
Currently I call using another SQL which has the below code:

call administrator.data_load();
@

The code for  administrator.data_load() is in the first post.
Thanks in advance
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

didn't my link help you?

Author

Commented:
I was not able to effectively use the link.
I am new to Db2.. just 3 months.. :(
ADMIN_CMD accepts only one in parameter and no output parameter. So I was confused how to get the operation id.

Could you please help me solve this issue.
calling the admin_cmd requires a single parameter of the statement you wish to exectute,
the the admin_cmd returns a single result set which you need to retrieve
that result set contains the number of rows effected in col 1, the sql statement that is required to retrieve the messages in col 2 and a statement used to delete those messages in col 3

you can find many examples for stored procedures here
http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.samptop.doc/doc/r0007623.htm

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial