Results 1 to 4 of 4

Thread: Import in SP

  1. #1
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276

    Unanswered: Import in SP

    hi,
    I want create a SP for import a txt file in a table, but, not sure how?.

    The db2level is 8.1.5 in win2000.

    this is a "example" but no work!!:

    CREATE PROCEDURE DB2INST1.CREDITOS_IMPORT ( IN ARCHIVO VARCHAR(256))
    ------------------------------------------------------------------------
    -- SQL Stored Procedure
    -- Descripcion: cargar archivos de texto a una tabla temporal.
    ------------------------------------------------------------------------
    P1: BEGIN

    IMPORT FROM ARCHIVO OF ASC METHOD L (1 4000) NULL INDICATORS (0) MESSAGES C:\MSG.MSG;

    END P1



    any idea.
    TIA
    Abel.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    IMPORT is a DB2 command and not SQL. Only SQL can be used in SQL Stored Procedures.

    Andy

  3. #3
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276
    thanks.

    any other idea?

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    All I can think of, if you want to have a SP import data to a table from a flat file is to do the work yourself. You could do this by writing the SP in another language (e.g. java), or come up with another way. This article maight help with an alternative (I have not had a chance to actually go through it):

    http://www-128.ibm.com/developerwork...0302izuha.html

    HTH

    Andy

Posting Permissions

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