If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > ADMIN_CMD error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-17-06, 16:34
dbMemo dbMemo is offline
Registered User
 
Join Date: Aug 2006
Posts: 8
ADMIN_CMD error

Hi everyone, Im new a this forum and I hope you can help me.

Im trying to run the export command from a DB2 sp but Im receiving an error, here is my code:

SET cadenaExport = 'export to /export/home/concar/text.csv of del modified by coldel, NOCHARDEL select * from tc_campo;
CALL SYSPROC.ADMIN_CMD(cadenaExport);

This is the error:

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0440N No authorized routine named "SYSPROC.ADMIN_CMD" of type "PROCEDURE having compatible arguments was found. LINE NUMBER=22. SQLSTATE=42884

I hope you can help me. thanks a lot for your help
Reply With Quote
  #2 (permalink)  
Old 08-17-06, 16:39
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
what version of DB2 are you on? As far as I know, admin_cmd is only available since 8.2.2 (fixpack 9).
Reply With Quote
  #3 (permalink)  
Old 08-17-06, 16:44
dbMemo dbMemo is offline
Registered User
 
Join Date: Aug 2006
Posts: 8
Quote:
Originally Posted by n_i
what version of DB2 are you on? As far as I know, admin_cmd is only available since 8.2.2 (fixpack 9).
Thanks, this is my DB2 info:

DB21085I Instance "db2crm" uses "32" bits and DB2 code release "SQL08020" with
level identifier "03010106".
Informational tokens are "DB2 v8.1.0.72", "s040914", "U498351", and FixPak "7".
Product is installed at "/opt/IBM/db2/V8.FP7".

does the ADMIN_CMD works? if its not, what can I do to call the export utility from a stored procedure?

Thanks
Reply With Quote
  #4 (permalink)  
Old 08-18-06, 01:45
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
your version is 8.1 fixpack 7 which is equal to 8.2.0. I am not sure if ADMIM_CMD is available in your version of DB2.

Try the SQL:
SELECT * FROM SYSIBM.SYSPROCEDURES WHERE PROCSCHEMA='SYSPROC' AND PROCNAME='ADMIN_CMD'

If returs a record then it should work.

Hope this helps,
Grofaty
Reply With Quote
  #5 (permalink)  
Old 08-18-06, 09:14
dbMemo dbMemo is offline
Registered User
 
Join Date: Aug 2006
Posts: 8
Quote:
Originally Posted by grofaty
Hi,
your version is 8.1 fixpack 7 which is equal to 8.2.0. I am not sure if ADMIM_CMD is available in your version of DB2.

Try the SQL:
SELECT * FROM SYSIBM.SYSPROCEDURES WHERE PROCSCHEMA='SYSPROC' AND PROCNAME='ADMIN_CMD'

If returs a record then it should work.

Hope this helps,
Grofaty
Hi, I run the SQL and the result was 0 row selected!!! so I have a big problem, do you know another way to call the export utility from a stored procedure.

Thanks a lot for your help
Reply With Quote
  #6 (permalink)  
Old 08-21-06, 01:45
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
it means no procedure of name sysproc.admin_cmd exist on database system.

Can you please explain why do you need to run export with store procedure? Maybe there is any other way to solve the problem. Please explain little more what you are doing?

Hope this helps,
Grofaty
Reply With Quote
  #7 (permalink)  
Old 08-21-06, 03:45
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
chk out this post for export using java prg.
using export or import from java

Rahul Singh
Reply With Quote
  #8 (permalink)  
Old 08-21-06, 16:31
dbMemo dbMemo is offline
Registered User
 
Join Date: Aug 2006
Posts: 8
Quote:
Originally Posted by grofaty
Hi,
it means no procedure of name sysproc.admin_cmd exist on database system.

Can you please explain why do you need to run export with store procedure? Maybe there is any other way to solve the problem. Please explain little more what you are doing?

Hope this helps,
Grofaty
I need to export a table to a text file, this problems a solved with a shell on unix, but I still have the problem of how to call this shell from a stored, can u help me with that?

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On