Sqlload
hi all,
this is urgent! i need to load data from flat file (ASCII) to the oracle database where the data is extracted from Image database. the problem is there's no delimiter between 2 fields so i don't know how to use the sqlload. can anybody tell me how to use the sqlload to load the data into database from the flat file? wat's the syntax? or is there other application that i can use in oracle server for that purpose? thank u very much!!!
i have an table whith
table name : tmp_indice_inicial
NOMBRE_SPC VARCHAR2(30)
INDICE NUMBER(3)
INDICE_INICIAL NUMBER(3)
CORRIO CHAR(1)
ERROR VARCHAR2(150)
CODIGO_01 NUMBER(6)
you have been create file load.ctl whith:
LOAD DATA
INFILE * APPEND INTO TABLE tmp_indice_inicial
(NOMBRE_SPC POSITION(001:023) CHAR(23),
INDICE POSITION(025:026) INTEGER EXTERNAL,
INDICE_INICIAL POSITION(031:032) INTEGER EXTERNAL,
CORRIO POSITION(037:037) CHAR(1))
and to run
sqlload user/password@ORACLE_SID
control = load.ctl data = data.dat;
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by candy_lim:
hi all,
this is urgent! i need to load data from flat file (ASCII) to the oracle database where the data is extracted from Image database. the problem is there's no delimiter between 2 fields so i don't know how to use the sqlload. can anybody tell me how to use the sqlload to load the data into database from the flat file? wat's the syntax? or is there other application that i can use in oracle server for that purpose? thank u very much!!! <HR></BLOCKQUOTE>
null
Similar Messages
-
How to load date and time from text file to oracle table through sqlloader
hi friends
i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
this is my data in this path (c:\external\my_data.txt)
7369,SMITH,17-NOV-81,09:14:04,CLERK,20
7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
7566,JONES,02-APR-81,09:24:10,MANAGER,20
7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
create table emp2 (empno number,
ename varchar2(20),
hiredate date,
etime date,
ejob varchar2(20),
deptno number);the control file code in this path (c:\external\ctrl.ctl)
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>any help i greatly appreciated
thanks
Edited by: user10947262 on May 31, 2010 9:47 AMload data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)Try
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>
That's not an error, you can see errors within log and bad files. -
Error in scheduling a mapping with sqlloader ctl file
Hi everyone,
I have been trying to schedule a single mapping which generates sqlloader ctl file. but i get the error
ORA-20001: Begin. initialize complete. workspace set. l_job_audit_execution_id= 20545. ORA-20001: Please check execution object is deployed correctly. ORA-01403: no data found ORA-06512: at "USER7.PMAP_TLOG_JOB", line 180 ORA-20001: Please check execution object is deployed correctly. ORA-01403: no data found
but when i attach this mapping with a process flow it works fine. There is no error.
so my question is in OWB is it a must that we should attach the mapping which generates sqlloader ctl file to a process flow and then schedule it or can we schedule a single mapping which generates sqlloader ctl file and what should be the process to schedule a single mapping which generates sqlloader ctl file?
can anyone please help?
Thanks & Regards
SubhasreeHi Nawneet,
Any suggestions?
can anybody else also help me in this error???
Regards
Subhasree -
Need help in writing the control file for SQLLOADER
Is it possible to error out the Sqlloader in case the data fields in the data file for a row are more than the fields stated in the control file?
i.e. My data file is something like
aaa,bbb,cc
dd,eee
And my ctl file has just 2 columns in it. Is it possible to write a control file which will cause the Sqlloader to error out?
Thanks...Nisha,
Again I posted test example in your other post but here is how can do that
CREATE TABLE mytest111 (
col1 NUMBER,
col2 NUMBER,
col3 NUMBER
LOAD DATA
TRUNCATE INTO TABLE MYTEST111
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
col1 integer external,
col2 integer external
#mytest.dat
1,2,3
1,2
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Apr 10 11:40:39 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: mytest.ctl
Data File: mytest.dat
Bad File: mytest.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table USIUSER.MYTEST111, loaded from every logical record.
Insert option in effect for this table: TRUNCATE
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
COL1 FIRST * , O(") CHARACTER
COL2 NEXT * , O(") CHARACTER
Table MYTEST111:
2 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 33024 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 2
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Fri Apr 10 11:40:39 2009
Run ended on Fri Apr 10 11:40:40 2009
Elapsed time was: 00:00:00.99
CPU time was: 00:00:00.06
{code}
Regards -
Multibyte character error in SqlLoader when utf8 file with chars like €Ää
hello,
posting from Germany, special charactes like german umlaute and euro sign in UTF8 Textfile, SqlLoader rejecting row with Multibyte character error
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
Database Characterset: WE8MSWIN1252
OS: SLES 11 x86_64
Testcase SqlDeveloper:
CREATE TABLE utf8file_to_we8mswin1252 (
ID NUMBER,
text VARCHAR2(40 CHAR)
can't enter euro symbol in this posting, end's in '€' (?)
SELECT ascii(euro symbol) FROM dual;
128
SELECT chr(128) from dual;
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (1, '0987654321098765432109876543210987654321');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (2, 'äüöäüöäüöäÄÖÜÄÖÜÄÖÜÄßßßßßßßßß߀€€€€€€€€€');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (3, 'äüöäüöäüöäÄÖÜÄÖÜÄÖÜÄäüöäüöäüöäÄÖÜÄÖÜÄÖÜÄ');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (4, 'ۧۧۧۧۧۧۧۧۧۧ1');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (5, 'äüöäüöäüöäÄÖÜÄÖÜÄÖÜÄäüöäüöäüöä');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (6, 'ßßßßßßßßß߀€€€€€€€€€1');
INSERT INTO utf8file_to_we8mswin1252 (ID, text) VALUES (7, 'ßßßßßßßßß߀€€€€€€€€€äüöäüöäüöäÄÖÜÄÖÜÄÖÜÄ');
commit;
Select shows correct result, no character is wrong or missing!!!!
put this in a UTF8 file without delimiter and enclosure like
10987654321098765432109876543210987654321
the SqlLoader controlfile:
LOAD DATA characterset UTF8
TRUNCATE
INTO TABLE utf8file_to_we8mswin1252
ID CHAR(1)
, TEXT CHAR(40)
on a linux client machine, NOT the Oracle-Server
export NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
sqlldr user/pwd@connectstring CONTROL=TEST01.ctl DATA=TEST01.dat LOG=TEST01.log
Record 6: Rejected - Error on table UTF8FILE_TO_WE8MSWIN1252, column TEXT.
Multibyte character error.
Record 7: Rejected - Error on table UTF8FILE_TO_WE8MSWIN1252, column TEXT.
Multibyte character error.
Select shows missing characters in row 4 and 5, SqlLoader loads only the first 20 characters (maybe at random)
and as shown above, row 6 and 7 never loaded
Problem:
can't load UTF8 Flatfiles with SqlLoader when german umlaute and special characters like euro symbol included.
Any hint or help would be appreciated
Regards
Michael## put this in a UTF8 file without delimiter and enclosure like
The basic question is how you put the characters into the file. Most probably, you produced a WE8MSWIN1252 file and not an UTF8 file. To confirm, a look at the binary codes in the file would be necessary. Use a hex-mode-capable editor. If the file is WE8MSWIN1252, and not UTF8, then the SQL*Loader control file should be:
LOAD DATA characterset WE8MSWIN1252
TRUNCATE
INTO TABLE utf8file_to_we8mswin1252
ID CHAR(1)
, TEXT CHAR(40)
)-- Sergiusz -
Help needed for creating a SQLLoad control file
I have 2 fields in my flat file
If field1 = field2 load only field1 into tn and aux = NULL
else if field1 != field2 load field1 into tn and field2 = aux
Here is what I have so far - I need help with the "Where"
-- ActiveNumbers.dat
-- Steve J
load data
INFILE 'active.date'
INTO TABLE tmp_ac_active
APPEND
FIELDS TERMINATED BY '|'
(tn CHAR(10), aux CHAR(10))
Thanks in advance
SteveThanks Joel
Using the document you provided here is what I came up with. I notice this is 9i documents - I'm on 8. Does the SQLLoader work the same in both versions?
This is the first time I've used this tool - No one here has even heard of it. (Well except for the DBA)
load data
INFILE 'active.date'
-- Loads tn and aux if they do not match
INTO TABLE tmp_ac_active
WHEN tn != aux
(tn CHARTERMINATED BY WHITESPACE,
aux CHAR TERMINATED BY WHITESPACE)
-- Loads only TN if both are the same
INTO TABLE tmp_ac_active
WHEN tn = aux
(tn POSITION (1:10) CHAR) -
How to ensure File Read Adapter handles like SQLLOADER's TRAILING NULLCOLS
I have to read a CSV file which has a specific format but sometimes the trailing columns values can be missing and i would like to handle it in such way that they values are treated as null. This is similar to the SQLLoader's TRAILING NULLCOLS clause.
Currently if my data is as shown below:
As-Of Date,As-Of-Time,Bank ID,Bank Name,State,Acct No,Acct Type,Acct Name,Currency,BAI Type Code,Tran Desc,Debit Amt,Credit Amt,0 Day Flt Amt,1 Day Flt Amt,2+ Day Flt Amt,Customer Ref No,Value Date,Location,Bank Reference,Tran Status,Descriptive Text,Descriptive Text1,Descriptive Text2,Descriptive Text3,Descriptive Text4,Descriptive Text5,Descriptive Text6
20061031,23:59:00,121000248,"WELLS FARGO BANK, N.A.",CA,4121235097,COMMERCIAL DDA,Silicon Image - A/P,USD,475,CHECK PAID,55.86,0,0,0,0,51689,10/31/2006,,IA000313659233,POSTED,,,,,,,
20061031,23:59:00,121000248,"WELLS FARGO BANK, N.A.",CA,4121235097,COMMERCIAL DDA,Silicon Image - A/P,USD,475,CHECK PAID,1377.57,0,0,0,0,51685,10/31/2006,,IA000210166161,POSTED
20061031,23:59:00,121000248,"WELLS FARGO BANK, N.A.",CA,4121235097,COMMERCIAL DDA,Silicon Image - A/P,USD,475,CHECK PAID,1435,0,0,0,0,51621,10/31/2006,,IA000627084628,POSTED
It reads the first row properly , but when in encounters the second row POSTED column , it tries to find the terminated column and since it is not present it reads data from the next line until it finds a comma.
This is not the way i would like to handle it.
We get around 1000-2000 records in that CSV from the Bank and they cant change the way they are sending the file. So , please help in resolving this issue.
Thanks
SridharHi thanks for the reply
well i've been having a play around but haven't got it to work yet,
Here's what i have so far
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
BufferedReader sb = new BufferedReader();
sb.append(""+jTextField1.setText()+",");
sb.append(""+jFormattedTextField1.setText()+"\n");
sb.append(""+jTextField2.setText()+",");
sb.append(""+jFormattedTextField2.setText()+"\n");
sb.append(""+jTextField3.setText()+",");
sb.append(""+jFormattedTextField3.setText()+"\n");
sb.append(""+jTextField4.setText()+",");
sb.append(""+jFormattedTextField4.setText()+"\n");
sb.append(""+jTextField5.setText()+",");
sb.append(""+jFormattedTextField5.setText()+"\n");
ReadFromFile(sb.toString());
private void ReadFromFile(String s) {
try {
BufferedReader in = new BufferedReader(new FileReader("/users/data.txt"));
String str;
while ((str = in.readLine()) != null) {
Process(str);
in.close();
} catch (IOException e) {
}// TODO add your handling code here:
}im thinking the problem is the parts that say sb.append but i don't know what to in it's place? -
Upload excel sheet data through sqlloader into oracle tables
hi everyone,
i am working with excel sheet with following records
8501 Jacob Marshall 15000 21/10/2009 Finance
8502 Chris Campell 50000 13/06/2008 R&D
8503 Simon Dough 50000 3/07/2008 Engineering
8504 Mark Haggai 75000 9/3/2006 Product Management
8505 Verica Beverley 45000 7/2/2008 HR
and i saved it in emp_details.csv
after that when i write following code to make control file
load data
infile 'C:\Documents and Settings\prashant_dabral\Desktop\a.txt'
into table tmp
field terminated by','optionally enclosed by" "
(emp_no,emp_name,salary,doj,dept_name)
after this pl\sqldev returning me error message that ORA-00900:invalid sql statement
can anybody tell me how to resolve issue
or
another method to Upload excel sheet data through sqlloader into oracle tablesA control file is a file located on the operating system, not some SQL or PL/SQL code you try and execute.
Create the control file as a file and then use that to load your data with SQL*Loader from the command line.
http://www.morganslibrary.org/reference/sqlloader.html
Or better still, create it as an external table and then you don't need a seperate control file or need to use sql loader from the command line...
http://www.morganslibrary.org/reference/externaltab.html -
How to run command SQLLoader Oracle in c#
Hello,
How to run command SQLLoader Oracle in c#. I try my sourcode for run this SQLLoader, but nothing happen and error "No process is associated with this object.". Please tell me how i fix it. Thanks.
This is my code:
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
process1.EnableRaisingEvents = false;
string strCmdLine;
strCmdLine = @"/C SQLLDR XL/secreat@O11G CONTROL=E:\APT\LoadXL.ctl";
System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
process1.WaitForExit();
process1.Close();jesperdj ,thanks:)
actually,i am using eclipse to run my ant tasks programmatically,but I got trouble with the AntRunner class.it seems that i should config a proper classloader for it,but i just don't know how.please lend a hand:)thanks
robin -
Hello,
I've created a Mapping from a Flatfile to a table.
Since SQL-Loader is used I have to set several properties (TRALING_NULLCOLS, FILELOCATION, etc)
However, every property I try to set fails by the same error:
OMBALTER MAPPING 'MAP_DIM_UNIT_TEST' \
SET PROPERTIES (TRAILING_NULLCOLS) VALUES ('true')
--> OMB02902: Error setting property TRAILING_NULLCOLS of MAP_DIM_UNIT_TEST: MMM1034: Property TRAILING_NULLCOLS does not exist.Reading and setting these properties on Mappings created by the Design Center was no problem.
What am I missing?
When configuring a Mapping in the Design Center I have to create the "SQL Loader Data Files".
Maybe that's got something to do with it. I have no idea how to do that with OMBPlus.
Any clue?
Regards
uhuebnerHi
You should set the GENERATION LANGUAGE property to SQLLOADER for the map. The property set is different depending on the type of the map, the UI does some tricks I think and sets up, but the API does not (it does at certain points like generation/validation).
Here are some other snippets you will find useful.....
1. To add a source data file to a mapping:
OMBALTER MAPPING 'LOAD_LOCATIONS' ADD SOURCE_DATA_FILE 'LOCATIONS_APAC'
2. To define the discard file info
OMBALTER MAPPING 'LOAD_LOCATIONS' MODIFY SOURCE_DATA_FILE 'LOCATIONS_APAC' SET PROPERTIES (DISCARD_FILE_LOCATION,DISCARD_FILE_NAME) VALUES ('APAC_FILE_STG_LOC', 'apac_discard.txt')
3. To define the data file info
OMBALTER MAPPING 'LOAD_LOCATIONS' MODIFY SOURCE_DATA_FILE 'LOCATIONS_APAC' SET PROPERTIES (DATA_FILE_LOCATION, DATA_FILE_NAME) VALUES ('APAC_FILE_STG_LOC', 'apac_data.txt')
4. To define the bad file info
OMBALTER MAPPING 'LOAD_LOCATIONS' MODIFY SOURCE_DATA_FILE 'LOCATIONS_APAC' SET PROPERTIES (BAD_FILE_LOCATION,BAD_FILE_NAME) VALUES ('APAC_FILE_STG_LOC', 'apac_bad.txt')
5 To query the files it is not obvious (or consistent with other commands)...
OMBRETRIEVE MAPPING 'SR_AGS_LDR' GET SOURCE_DATA_FILE
Notice the 'GET SOURCE_DATA_FILE' is singular even though it possibly return a list (in most other commands some form of the plural is used ie. GET TABLE OPERATORS).
Cheers
David -
Convert EBCDIC to ASCII using sqlloader
hi..
i have .dat file which extract from mainframe in EBCDIC format n i have to load in table using sqlloader.
here, my .ctl sample:
AMTV2_RESERVE08 POSITION(857:861) DECIMAL(9,2),
AMTV2_RESERVE09 POSITION(862:866) DECIMAL(9,2)
here, my record layout
10 IN4331A-AMTV2-RESERVE08
PICTURE IS S9(7)V99
USAGE IS COMP-3
ELEMENT LENGTH IS 5
POSITION IS 857
10 IN4331A-AMTV2-RESERVE09
PICTURE IS S9(7)V99
USAGE IS COMP-3
ELEMENT LENGTH IS 5
POSITION IS 862
when i run the sqlloader, i got this error:
Invalid packed decimal nibble.
what must i do?
thanksi'm using this
load data
characterset we8ebcdic500
infile '/xxxxx/abc.dat
"fix 866"
replace
into table A
TRAILING NULLCOLS
AMTV2_RESERVE08 POSITION(857:861) DECIMAL(9,2),
AMTV2_RESERVE09 POSITION(862:866) DECIMAL(9,2)
i'm using windows OS and using PUTTY to run this sqlloader.
but, i still have "Invalid packed decimal nibble" errors.. whats the prob with my .ctl file actually? -
SQLLoader - using more than 1 function in a single field
Hi.
I have problem with sqlloader. i'm trying to call 2 function (DECODE and NPCS_FINBOUND_CTRL) for field type like below
LOAD DATA
INFILE "TEST.txt"
APPEND
INTO TABLE NPCS_INBOUND_NIZ
TYPE POSITION(1:1) "DECODE(:TYPE,1,2,:TYPE)" "NPCS_FINBOUND_CTRL(:TYPE,NPCS_FSEQCTRL('P_GFA','0',:TYPE),NPCS_FSEQC
TRL('P_GFA','1',:TYPE),NPCS_TRANS_ID_SEQ.nextval,null,null,null)"
,FILE_ID "NPCS_FSEQCTRL('P_GFA','0',DECODE(:TYPE,1,2,:TYPE))"
,BATCH_ID "NPCS_FSEQGET('P_GFA','1',:TYPE)"
,TRANS_ID "TRANS_ID_SEQ.nextval"
,DATA POSITION(1:160)
is sqlloader allow us to call more than 1 function because when i run the loader i got error like this
SQL*Loader-350: Syntax error at line 6.
Expecting valid column specification, "," or ")", found "DECODE(:TYPE,1,2,:TYPE)".
DECODE(:TYPE,1,2,:TYPE)" "DECODE(:TYPE,1,2,:TYPE)"
,FILE_ID "NP
ok
tq.create the control file as given below
load data
infile *
into table emp1 truncate
(empno char terminated by '\n',
ename expression "substr(function1(:empno),1,3)",
ename1 expression "substr(function2(:empno),1,3)")
begindata
111
222
333
Regards,
Abu -
SQLLOADER in 10.2.0.3
Hi,
I've following format or data.
432 ~080219~7473259~5898~FH22A07705~C1~5543 ~KISLING ST ~17~Y~KENNEDY ~050~222NE07~P5648G05~060~000~02~INSP/LUB & MINOR MAINT ~001~OK 0000F
432 ~080219~7473259~5898~FH22A07706~C1~5542 ~LANGLEY WAY ~28~Y~KENNEDY ~035~222NE07~P5648G06~060~000~02~INSP/LUB & MINOR MAINT ~001~OK 0000F
432 ~080219~7473259~5898~FH22A07707~C1~5514
ctl file:
LOAD DATA
INFILE '/home/oracle/ins.dat'
BADFILE '/home/oracle/TEST_bad.bad'
DISCARDFILE '/home/oracle/TEST_disc.dsc'
REPLACE
INTO TABLE INSPECT1
FIELDS TERMINATED BY "~"
ROUTE_BOOK POSITION(1:4) CHAR,
SQLLOADER is working fine but looks like FIELDS TERMINATED BY "~" is not working.
data looks after load.
432 ~08021 9~74732 59~5 898~FH22A0 77 05~C1~5543 ~KISLING ST
~17~Y~KENNEDY ~0 50~222NE 07~ P56 48
G05~060~000~02~INSP/LUB & MINO R M AINT ~001~OK
Please advice what is wrong in above ctl file.
thanksIf your fields are terminated by '~' and fixed in length, why are you using position in your control file.
Try without position
LOAD DATA
INFILE '/home/oracle/ins.dat'
BADFILE '/home/oracle/TEST_bad.bad'
DISCARDFILE '/home/oracle/TEST_disc.dsc'
REPLACE
INTO TABLE INSPECT1
FIELDS TERMINATED BY "~"
ROUTE_BOOK char(4),
...........) -
Substr function in CTL file of sqlloader
Hi gurus,
I am using sql loader to load the data from text file to oracle table.
I have 2 columns in the input data, which are of more size than their corresponding destination table column sizes.
I am using substr() function in the control file, but it is failing for some records in 2 scenarios, details given below.
First scenario:
destination table column size is 250 characters.
substr() function works fine when the source data is less than 255 characters, but when it is more than 255 characters, the record is getting rejected as bad record.
eg: if the source data is of 254 characters, only 250 chars are inserted in the table, but if the size is 256, record is not inserted in the table.
Here is the syntax i am using
ENQUIRY "SUBSTR(:ENQUIRY, 0, 250)",
Second scenario:
destination table column size is 2000 characters.
substr() function works fine when the source data is upto 2000 characters, but when it is more than 2000 characters, the record is getting rejected as bad record.
Here is the syntax i am using
ANSWER CHAR(2000) "SUBSTR(:ANSWER, 0, 2000)",
Please suggest.
Thanks,odie_63 wrote:
Hi,
Try with specifying a larger size limit for both columns :
ENQUIRY CHAR(4000) "SUBSTR(:ENQUIRY, 0, 250)",
ANSWER CHAR(4000) "SUBSTR(:ANSWER, 0, 2000)"
Will the substr work with a starting offset of 0 ? Doesn't substr uses 1 as the first character position? or it is different with sqlloader?
Okay I checked, It works just like if the offset is given as one. Perfect.
SQL> select substr('ABCDEF',0,3) from dual;
SUB
ABCThanks odie_63. :)
Edited by: zahid79 on Jul 23, 2010 5:20 PM
Edited by: zahid79 on Jul 23, 2010 5:22 PM -
Conditional Insert into staging table by using sqlloader
Hi,
In Oracle apps I'm submitting a concurrent program programmatically which will call sqlloader and insert into a staging a table.
This table consists of 30 columns.Program has one input parameter.If parameter value = REQUIRED Then it should insert into first three columns of staging table.If it's APPROVED then it should insert into first 10 columns of the same table.
Data file is pipe delimited file which may or may not have all possible values :For Required,I many not have all three column values>
I think you understood the thinks wrongly. OP marked UTL_FILE as the correct answer, which is again a server side solution.
>
Perhaps you failed to notice that the answer now marked correct was posted AFTER mine. I'm not clairvoyant and OP did not state whether a server side or client side solution was appropriate.
I stand by my comments. Using an external table is an alternative to sql loader but, as I said, simply using an external table instead of sql loader doesn't address OPs problem.
>
And IMO, external table will be faster than UTL_FILE
>
I'd be more concerned with why OP wants to write a procedure to parse flat files, deal with data conversion errors and perform table inserts when Oracle already provides that functionality using either external tables or sql loader.
I would suggest loading the file into a new staging table that can hold all of the columns that might be contained in the flat file. Then the appropriate data can be moved to OPs staging table according to the required business rules.
Sounds like we each think OP should reconsider the architecture. -
Updating a table from two nodes simultaneously using sqlloader- Issues..
Hi,
I have a two node RAC. I have a table called PARTS1, has an PK+Index on PART column, Again this has a sequence. Now I am loading data on PARTS1 table using sqlloader from both nodes at the same time. What issues will come?
Since one column of this table has a PK+Sequence+Index, there will be a contention issue with the block while updating records.. am I right? What other isues might appear here?
Thanks in advance,
Lily.user7993571 wrote:
Consider two databases
db10gA and db10gB which is having a db link from A to B
There is a user A in db10gA
and another user B in db10gB
the user require to insert,update,delete records of user B tables
so how is the DML privileges are granted to user A to perform these tasks at db10gB database
whether it is the type of db link decides to do these tasks
whether any synonym created at db10gA side might help to do the jobUser A will act on behalf of the user who has created the DBLINK; for example if you have created the DBLINK with a user having a DBA role; and grant the DBLINK access to A, A can act on behalf of the DBA who has created the DBLINK.
Maybe you are looking for
-
Macbook Pro Black Screen (Yosemite 15" 2014)
Hey guys, I was just sitting down and opened up Skype and my macbook pro suddenly went black, just previously I had been watching stuff for a few hours on my macbook hooked up to my TV via HDMI cable. I thought to simply restart, I heard the sound ch
-
2 TB MyCloud filesystems "/tmp" and "/var/log" both at 100%
Now, this is just plain weird... here's the output from "df -k": Filesystem 1K-blocks Used Available Use% Mounted on rootfs 1968336 685956 1182392 37% / /dev/root 1968336 685956 1182392 37% / tmpfs 40960 20992 19968 52% /run tmpfs 40960 64 40896 1%
-
Mapping Property Names in EF6 Database First
Hi I am just starting out with EF6 and am hoping I will be able to do what i am wishing: using DB first: say I have the following: database name "a1234" with table named "a" with column names "a1", "a2", with table named "b" with column names "b1", "
-
What do I do
-
In elements organize 12 how can I add tags to files already in catalogue and have the tags show up in organizer? And how can I add tags in organizer and have then show up in the files properties details? Can this be done? All help appreciated. Thanks