sql-loader

Mapping fields in Oracle SQL Loader

南笙酒味 提交于 2020-06-09 04:20:08
问题 When loading an external csv with Oracle SQL Loader is there a way to map the fields directly to each other in the control file? At the moment I'm doing a simple loading, so the position of the source fields is important. Is there a way to do it otherwise? So instead of: load data into table1 fields terminated by "," optionally enclosed by '"' (destination_field1, destination_field2, destination_field3) do something like: load data into table1 fields terminated by "," optionally enclosed by '

ORA delete / truncate

微笑、不失礼 提交于 2020-05-27 04:10:52
问题 I'm using SQL loader to load my data into database. Before I insert the data I need to remove existing data in the table: options(skip=1,load=250000,errors=0,ROWS=30000,BINDSIZE=10485760) load data infile 'G:1.csv' "str '^_^'" replace into table IMPORT_ABC fields terminated by "," OPTIONALLY ENCLOSED BY '"' trailing nullcols( . . . .) But I got error like: SQL*LOADER-926: OCI error while executing delete/truncate for table IMPORT_ABC ORA-30036: unable to extend segment by 8 in undo tablespace

ORA delete / truncate

六眼飞鱼酱① 提交于 2020-05-27 04:10:09
问题 I'm using SQL loader to load my data into database. Before I insert the data I need to remove existing data in the table: options(skip=1,load=250000,errors=0,ROWS=30000,BINDSIZE=10485760) load data infile 'G:1.csv' "str '^_^'" replace into table IMPORT_ABC fields terminated by "," OPTIONALLY ENCLOSED BY '"' trailing nullcols( . . . .) But I got error like: SQL*LOADER-926: OCI error while executing delete/truncate for table IMPORT_ABC ORA-30036: unable to extend segment by 8 in undo tablespace

How to remove headers in database while importing the excel file through sql loader

南楼画角 提交于 2020-04-07 06:26:18
问题 I have a excel sheet which has a format like: Name Address Phone# Age ----- ------- ------ ---- aaa xxx 123... 11 bbb yyy 345... 21 when i import this excel i have got headers(Name,Address,phone#,Age) as first row of the table. i want only data without headers. Can anyone please help. TA, Nishant 回答1: I've never used it, but the skip option should do what you need. You can define the number of rows to skip in your control file like this: OPTIONS (SKIP=1) LOAD DATA INFILE ... Or you can do it

How to remove headers in database while importing the excel file through sql loader

时光怂恿深爱的人放手 提交于 2020-04-07 06:25:30
问题 I have a excel sheet which has a format like: Name Address Phone# Age ----- ------- ------ ---- aaa xxx 123... 11 bbb yyy 345... 21 when i import this excel i have got headers(Name,Address,phone#,Age) as first row of the table. i want only data without headers. Can anyone please help. TA, Nishant 回答1: I've never used it, but the skip option should do what you need. You can define the number of rows to skip in your control file like this: OPTIONS (SKIP=1) LOAD DATA INFILE ... Or you can do it

Field in data file exceeds maximum length - error

笑着哭i 提交于 2020-03-03 07:19:05
问题 when i am trying to insert data in to a column of size varchar2(4000) in table i am getting error as "Field in data file exceeds maximum length" . the data = 1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,33,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,111,112,121,654,666,667,1001,1100,1102,1103,1104,1105,1106,1107,1108,1109

using sqlldr from java

℡╲_俬逩灬. 提交于 2020-01-07 05:08:14
问题 I have a Java utility for database imports. I'd like to be able to use sqlldr for performance on oracle. I could create the control and data files, but that doesn't seem like The Right Thing™ to do. I should be able to stream the data by providing INFILE "-" in the control file ( q1 - how? from command line, I can pipe " echo <data...> " to the sqlldr, but there must be a way to just stream the string into the input stream for the process? never used Java for this before). I can't see how to

Put select result in a ksh variable

折月煮酒 提交于 2019-12-25 07:58:08
问题 using sql loader, I know I can reference a ksh variable in my ctl file. For example I can write LOAD DATA INFILE '$PATH_IN_KSH/my_file.dat' ... I would like to add a WHEN clause like this WHEN (125:125) = '$P_NUMBER' P_NUMBER would have the value of a column in a table that I would retrieve with a select query. Is it possible to do that ? retrieve a value from a column with a select and somehow put it in the ksh variable so the ctl file can see it. (something with sql plus?) Thank you 回答1: As

Put select result in a ksh variable

允我心安 提交于 2019-12-25 07:57:12
问题 using sql loader, I know I can reference a ksh variable in my ctl file. For example I can write LOAD DATA INFILE '$PATH_IN_KSH/my_file.dat' ... I would like to add a WHEN clause like this WHEN (125:125) = '$P_NUMBER' P_NUMBER would have the value of a column in a table that I would retrieve with a select query. Is it possible to do that ? retrieve a value from a column with a select and somehow put it in the ksh variable so the ctl file can see it. (something with sql plus?) Thank you 回答1: As

Run as Other user Option in Linux

谁说我不能喝 提交于 2019-12-25 04:04:30
问题 Case : My case is pretty straight forward. I have a Linux server machine. On that server, there are 2 users. One is root and the other is oracle . Now here is the thing, the root user does not know the sqlldr command, this command is recognized by oracle user only. I have a batch.sh file and in that file i have an sqlldr command that will insert record in the database. When i open terminal using oracle user, that batch.sh file runs according to the expectations. But when I run that batch file