This discussion is archived
2 Replies Latest reply: Dec 28, 2012 9:50 PM by Muthu RSS

Import a text file to Oracle

Muthu Newbie
Currently Being Moderated
Hello All,

I have a doubt in sql insert query.

I need to insert more than 1000 line in GL Interface from data file, I couldn't move forward, below query is not working. Is there anything am missing.

I herewith attached the sample data file and the update sql query as below...

Data File:-
-------------

"STATUS", "LEDGER_ID", "USER_JE_SOURCE_NAME", "USER_JE_CATEGORY_NAME", "ACCOUNTING_DATE", "CURRENCY_CODE", "DATE_CREATED", "CREATED_BY", "SEGMENT1", "SEGMENT2", "SEGMENT3", "SEGMENT4", "SEGMENT5", "ACTUAL_FLAG", "ENTERED_DR", "ENTERED_CR", "GROUP_ID"

NEW, 1, Payroll, Payroll, to_date(DEC-22-2008,MON-DD-YYYY), USD, to_date(DEC-23-2008,MON-DD-YYYY), 1092, 01, 830, 5300, 0000, 000, A, 1000.00, 0.00, 12345

NEW, 1, Payroll, Payroll, to_date(DEC-22-2008,MON-DD-YYYY), USD, to_date(DEC-23-2008,MON-DD-YYYY), 1092, 01, 000, 1110, 0000, 000, A, 0.00, 1000.00, 12345


Update Sql Query:-
--------------------------

options (skip=1)
load data
infile 'D:\flat.txt'
into GL_INTERFACE
fields terminated by "," optionally enclosed by '"'
( STATUS, LEDGER_ID, USER_JE_SOURCE_NAME, USER_JE_CATEGORY_NAME, ACCOUNTING_DATE, CURRENCY_CODE, DATE_CREATED, CREATED_BY,
SEGMENT1, SEGMENT2, SEGMENT3, SEGMENT4, SEGMENT5, ACTUAL_FLAG, ENTERED_DR, ENTERED_CR, GROUP_ID )

Please guide me to move forward...

Thanks and Regards,
Muthukumar
+919894135165

Edited by: Muthu on Dec 28, 2012 1:29 PM