Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Posts
    288

    Unanswered: 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 16:13.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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"
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Dec 2007
    Posts
    288
    Not sure what you mean? when I google "db2 ? sql444" i get a bunch of junk. anyone run into this before?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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