By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,611 Members | 2,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,611 IT Pros & Developers. It's quick & easy.

IMPORT with METHOD N

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.