IMPORT with METHOD N

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gregor =?UTF-8?B?S292YcSN?=

    #1

    IMPORT with METHOD N

    Hi!

    Let's say I have a table TABLE 1:
    CREATE TABLE TABLE1
    (
    TAB1_ID BIGINT,
    TAB1_NAME VARCHAR(100)
    )

    which has 10 columns in and from which I do an EXPORT like:
    EXPORT TO TABLE1.IXF OF IXF SELECT * FROM TABLE1

    Then I have a table TABLE2:
    CREATE TABLE TABLE2
    (
    TAB2_NAME VARCHAR(100)
    )

    into which I'd like to import TABLE1.IXF, but only TAB1_NAME:
    IMPORT FROM TABLE1.IXF OF IXF METHOD N(TAB1_ID, TAB1_NAME) INSERT INTO
    TABLE2(TAB2_NAM E)

    This commands does import all 10 rows, but the values are NULL and there are
    no warnings or errors.
    Is this supposed to work like this ?

    Best regards,
    Kovi


    --
    _______________ _____________
    |http://kovica.blogspot .com|
    -----------------------------~-~-~-~-~-~-~-~-~-~-
    | In A World Without Fences Who Needs Gates? |
    | Experience Linux. |
    -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
  • Dave Hughes

    #2
    Re: IMPORT with METHOD N

    On Tue, 04 Sep 2007 13:10:12 +0200, Gregor Kovač scribbled:
    Let's say I have a table TABLE 1:
    CREATE TABLE TABLE1
    (
    TAB1_ID BIGINT,
    TAB1_NAME VARCHAR(100)
    )
    >
    which has 10 columns in and from which I do an EXPORT like: EXPORT TO
    TABLE1.IXF OF IXF SELECT * FROM TABLE1
    >
    Then I have a table TABLE2:
    CREATE TABLE TABLE2
    (
    TAB2_NAME VARCHAR(100)
    )
    >
    into which I'd like to import TABLE1.IXF, but only TAB1_NAME: IMPORT
    FROM TABLE1.IXF OF IXF METHOD N(TAB1_ID, TAB1_NAME) INSERT INTO
    TABLE2(TAB2_NAM E)
    I'm a bit surprised that works at all given that you've specified two
    columns in the source and one in the destination. I'd expect something
    like this instead:

    IMPORT FROM TABLE1.IXF OF IXF
    METHOD N (TAB1_NAME)
    INSERT INTO TABLE2 (TAB2_NAME)

    In other words, the columns you specify as the argument to METHOD N map
    to the columns you specify after the action parameter (INSERT /
    INSERT_UPDATE / REPLACE / CREATE), hence the command above is simply
    ignoring the TAB1_ID column in the source file.


    Cheers,

    Dave.

    Comment

    Working...