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 > CALL SYSPROC.ADMIN_CMD problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-08, 15:08
itsonlyme44 itsonlyme44 is offline
Registered User
 
Join Date: Dec 2007
Posts: 261
CALL SYSPROC.ADMIN_CMD problem

DB2 on Windows V9.1

the stored procedure (below) was created specifically to
CALL SYSPROC.ADMIN_CMD ('IMPORT FROM NUL OF DEL REPLACE INTO MYTABLE')

but we are getting this error:
DB2 Database Error: ERROR [] [IBM][DB2/NT] SQL3015N An SQL error "-444" occurred during processing.
I cannot find SQL3015N (code 444) - does anyone know how we can pass 'IMPORT FROM NUL OF DEL REPLACE INTO MYTABLE in a stored procedure?

Code:
CREATE PROCEDURE KCDWHUAT.truncate_table(IN sch_name VARCHAR(130),IN tab_name VARCHAR(130)) 
  LANGUAGE SQL
  BEGIN

    DECLARE stmt VARCHAR(1000);
    DECLARE param VARCHAR(1000);
    DECLARE full_name VARCHAR(1000);
    DECLARE a VARCHAR(130);

    IF sch_name IS NULL 
      THEN
        SET full_name = tab_name;

        SELECT tabname INTO a FROM SYSCAT.TABLES WHERE tabname = UCASE(tab_name);

    ELSE
      SET full_name = sch_name||'.'||tab_name;

      SELECT tabname INTO a FROM SYSCAT.TABLES WHERE tabname = UCASE(tab_name) AND tabschema = UCASE(sch_name);

    END IF;

    IF UCASE(a) = UCASE(tab_name) 
      THEN
   
        SET param = 'IMPORT FROM NUL OF DEL REPLACE INTO '||full_name;
  
        SET stmt = 'CALL SYSPROC.ADMIN_CMD (?)';
 
        PREPARE s1 FROM stmt;
        EXECUTE s1 USING param;

    ELSE

   END IF;

  END

Last edited by itsonlyme44; 09-08-08 at 15:13.
Reply With Quote
  #2 (permalink)  
Old 09-08-08, 15:26
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by itsonlyme44
but we are getting this error:
DB2 Database Error: ERROR [] [IBM][DB2/NT] SQL3015N An SQL error "-444" occurred during processing.
I cannot find SQL3015N (code 444)
Try "db2 ? sql444"
Reply With Quote
  #3 (permalink)  
Old 09-08-08, 16:01
itsonlyme44 itsonlyme44 is offline
Registered User
 
Join Date: Dec 2007
Posts: 261
Not sure what you mean? when I google "db2 ? sql444" i get a bunch of junk. anyone run into this before?
Reply With Quote
  #4 (permalink)  
Old 09-08-08, 16:09
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You don't need to google that; just type it in on the shell prompt and press the Enter key. You will see something like this:
Code:
SQL0444N Routine "<routine-name>" (specific name
          "<specific-name>") is implemented with code in library
          or path "<library-or-path>", function
          "<function-code-id>" which cannot be accessed.  Reason
          code: "<code>".

Explanation:

The DBMS is trying to access the body of the code that implements
routine "<routine-name>" (specific name "<specific-name>"),
and cannot access it for the reason given by reason code
"<code>" (the codes are listed below).  The file implementing the
routine is identified by "<library-or-path>", and the function by
"<function-code-id>".

 (Note that these last two tokens may be truncated, due to
limitations in the total token length which can be provided.  If
this happens, then the definition of the routine in the catalogs
may need to be accessed in order to determine the full library or
path and function code id that were defined for the routine.)
etc.
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