467,883 Members | 1,223 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,883 developers. It's quick & easy.

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_NAME)

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. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Sep 4 '07 #1
  • viewed: 5689
Share:
1 Reply
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_NAME)
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.
Sep 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Petri Savolainen | last post: by
7 posts views Thread by Matthew Wilson | last post: by
5 posts views Thread by Dfenestr8 | last post: by
7 posts views Thread by steven | last post: by
9 posts views Thread by Arancaytar | last post: by
1 post views Thread by madbat87 | last post: by
2 posts views Thread by WP | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.