Results 1 to 8 of 8

Thread: ADMIN_CMD error

  1. #1
    Join Date
    Aug 2006
    Posts
    8

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    what version of DB2 are you on? As far as I know, admin_cmd is only available since 8.2.2 (fixpack 9).

  3. #3
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    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

  5. #5
    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

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    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

  7. #7
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    chk out this post for export using java prg.
    http://www.dbforums.com/showthread.php?t=1606140

    Rahul Singh

  8. #8
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •