How can I load data into table with SQL*LOADER
how can I load data into table with SQL*LOADER
when column data length more than 255 bytes?
when column exceed 255 ,data can not be insert into table by SQL*LOADER
CREATE TABLE A (
A VARCHAR2 ( 10 ) ,
B VARCHAR2 ( 10 ) ,
C VARCHAR2 ( 10 ) ,
E VARCHAR2 ( 2000 ) );
control file:
load data
append into table A
fields terminated by X'09'
(A , B , C , E )
SQL*LOADER command:
sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
datafile:
column E is more than 255bytes
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
Check this out.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961
Similar Messages
-
Loading Data into Table with Complex Transformations
Hello Guys
I am trying to load data into one of the Dimension table and it has quite a few Transformations and i created 6 temp tables
1. It has 7 Columns , Gets 935 rows based on where condition
2. It has 10 Columns , Gets 935 rows with but it has nulls in it i.e for column 1 there are 500 fields and columns 2 there are 300 etc ...
3 , 4 , 5 , 6 all the same as the 2 table
and at the end when i am trying to join all the temp tables with the Product_id into the target , which is in each temp table ...
I am Getting Error Saying Not Obeying Primary key Constraints i.e unique values are not been inserting into the Product_id Column of Target Table and the Job is running for Hours
and the main Problem comes at , some of the Columns have the same Product_id
Please help me
I have been Trying for 1 week and i am in Full pressure
Thanks
Sriks
Edited by: Sriks on Oct 16, 2008 6:43 PMHi,
If you are creating a warehouse and product_key is ur PK then it should come only once and so u might have to think ur logic in getting the data. To get over the isue u can disable the constraint and load with out the cosntraint, but i would have u look at the logic and make sure u have only 1 product_key in the table.
Regards
Bharath -
Loading a big table with SQL*LOADER
I'm loading thru sql*loader a big quantity of data, The number of rows that I need to load to oracle table is 339'582.194. The inconvenient is that I want to load this data more quickly.
Somebody knows how I can accelerate this process. Or somebody knows other way for to do this more efficiently.
Thanks.Dirct Path?
-
Loading data into table with filename
Hi All,
I am new to ODI. I have a requirement to load of a flat file into oracle, along with the name of file in one column of the table. That means, if there are 10 rows of data from that file then the additional column 'FileName" of the table will have current file name written 10 times. Please suggest how this can be achieved. I am able to do half of it but file name is not populated.
Thanks.Hi ,
Probably what you can do is
1. create a variable to read the file name . Refer http://odiexperts.com/?tag=file-variable-odi for creating such a variable.
2. Now in your interface , target table column which holds the filename , use '#<variable created in step 1>'
and specify it to be executed on target .
It should do the trick .
Thanks,
Sutirtha -
Sql*loader - load data in table with multiple condition
Hi,
I have oracle 9i on Sun sloaris and i need to load data in one of oracle table using sql*loader with conditional column data.
My table is like:
Load_table
col1 varchar2(10),
col2 varchar2(10),
col3 varchar2(10),
Now i have to load data like:
If col2 = US1 then col3 = 'AA'
If col2 = US2 then col3 = 'BB'
If col2 = US3 then col3 = 'CC'
How can i load this data in table using sql*loader?
Thanks,
PoraHi
it is a half-solution.
You have to:
1. open file
2. take a line
3. split the line into values (using substring to)
4. check condition (01 or 02)
5. do a proper insertion
Good Luck,
Przemek
DECLARE
v_dir VARCHAR2(50) := 'd:/tmp/'; --directory where file is placed
v_file VARCHAR2(50) := 'test.txt'; -- file name
v_fhandle UTL_FILE.FILE_TYPE; ---file handler
v_fline VARCHAR2(906); --file line
v_check VARCHAR2(50);
BEGIN
v_fhandle := UTL_FILE.FOPEN(v_dir, v_file, 'R'); --open file for read only
LOOP -- in the loop
UTL_FILE.GET_LINE( v_fhandle , v_fline); -- get line by line from file
if (substr(v_fline,17,2) = '01') then --check the value
INSERT INTO ... -- Time_in
else
INSERT INTO ... -- Time_out
end if;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND
THEN UTL_FILE.FCLOSE( v_fhandle );
END; -
Insert data file name into table from sql loader
Hi All,
I have a requirement to insert the data file name dynamically into table using sql loader.
Example:
sqlldr userid=username/passwword@host_string control=test_ctl.ctl data=test_data.dat
test_ctl.ctl
LOAD DATA
FILED TERMINATED BY ','
INTO TABLE test
(empid number,
ename varchar2(20),
file_name varchar2(20) ---------- This should be the data file name which can be dynamic (coming from parameter)
test_data.dat
1,test
2,hello
3,world
4,end
Please help..
Thanks in advance.
Regards
Anujyou'll probably have to write your control file on the fly, using a .bat or .sh file
rem ===== file : test.bat ========
rem
rem ============== in pseudo speak =============
rem
rem
echo LOAD DATA > test.ctl
echo FILED TERMINATED BY ',' >> test.ctl
echo INTO TABLE test >> test.ctl
echo (empid number, >> test.ctl
echo ename varchar2(20), >> test.ctl
echo file_name constant %1% >> test.ctl
echo ) >> test.ctl
rem
rem
rem
sqlldr userid=username/passwword@host_string control=test.ctl data=test_data.dat
rem =============== end of file test.bat =======================
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1008664 -
Hi,
We are having trouble while importing one ledger 'GERMANY EUR GGAAP'. It works for Dec 2014 but while trying to import data for 2015 it gives an error.
Import error shows " RuntimeError: No periods were identified for loading data into table 'AIF_EBS_GL_BALANCES_STG'."
I tried all Knowledge docs from Oracle support but no luck. Please help us resolving this issue as its occurring in our Production system.
I also checked all period settings under Data Management> Setup> Integration Setup > Global Mapping and Source Mapping and they all look correct.
Also its only happening to one ledger rest all ledgers are working fine without any issues.
ThanksHi,
there are some Support documents related to this issue.
I would suggest you have a look to them.
Regards -
How can I connect NetBeans 6.1 with SQL Server 2005?
Hello guys...
how can i connect NetBeans 6.1 with SQL Server 2005?
there is no SQL Server in Server list when we create a new Web Project and choose Server.
I'm new to NetBeans and this is my first time of posting.
If has some errors and unwanted disturbing,pls understand me. Thanks.
(If you have references or some snippets, i'll be glad if u can share.)
scsfdevThe JDBC-ODBC bridge wasn't recognizing any of the primary keys I had set up in SQL Server. After lots of head banging, here's the solution I came up with:
1. Download the appropriate driver. SQL Server 2000 requires the SQL Server 2000 JDBC driver (http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en).
SQL Server 2005 download: (http://www.microsoft.com/downloads/details.aspx?familyid=C47053EB-3B64-4794-950D-81E1EC91C1BA&displaylang=en)
3. After installing, right-click on "Libraries" in your project, and choose "Add Library...". Next, give it a name (i.e. SQLServer2000), and select "Class Libraries".
4. On the next screen, find the JAR files (should be in C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\), and add them under the "Classpath" tab. It will now be available under "Libraries" for future projects.
5. You can now create a connection to a specific database under the "Services" tab (next to "Projects" and "Files" in the top left of the screen). Select "Microsoft Sql Server 2000 (Microsoft Driver)" and format the "Database URL" like this:
jdbc:microsoft:sqlserver//YOURSERVER:1433;DatabaseName=YOURDATABASE
1433 is the default port, though your DBA may have changed it.
I posted a simpler version of this on the NetBeans.org FAQ page - they had the following title with no content on the answer page:
"Cannot Select Tables From MsSql 2000 Because It Says No Primary Key Next To Each Table But The Tables DO Have A Primary Key. What Do I Do?" -
How can I Insert data into my msaccess Database table
Hello all,
I am new to Java programming and I have problem that how can i insert name into my database table.
The code which i have written is following:
String filename = "d:/test.mdb";
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}";
Connection con = DriverManager.getConnection(database,"","");
String s = String.valueOf(text.getText());
int k =10;
Statement st = con.createStatement();
st.execute("create table Test123(name text)");
st.execute("INSERT INTO Test123 values" +s);
on the INSERT program throws exception???
can any one help me how to insert data into tabel.
Thankshe INSERT program throws exception???
can any one help me how to insert data into tabel.I have never used the jdbc driver to access, but what do you think that the flag READONLY=true means? An insert is not a read.
Kaj -
How can i retrieved data into the infocube from archived files
hi,
i have archived cube data and i have to load data into the cube from archived files.
so now i want to find archived files and how to load data into the cube.
thanksHi.....
Reloading archived data should be an exception rather than the general case, since data should be
archived only if it is not needed in the database anymore. When the archived data target is serving also as a
datamart to populate other data targets, Its recommend that you load the data to a copy of the original
(archived) data target, and combine the two resulting data targets with a MultiProvider.
In order to reload the data to a data target, you have to use the export DataSource of the archived data
target. Therefore, you create an update rule based on the respective InfoSource (technical name 8<data
target name>). You then trigger the upload either by using Update ODS data in data target or by
replicating the DataSources of the MYSELF source system and subsequently scheduling an InfoPackage
for the respective InfoSource
If you want to read the data for reporting or
control purposes, you have to write a report, which reads data from the archive files sequentially.
Alternatively, you can also use the Archiving Information System (AS). This tool enables you to define an
InfoStructure, and create reports based on these InfoStructures. The InfoStructures define an index for
the archive file data. At the moment, the archiving process in the BW system does not fill the
InfoStructures during the archiving session automatically. This has to be performed manually when
needed.
Another way of displaying data from the archive file is by using the Extractor checker (TCODE RSA3).
Enter the name of the export DataSource of the respective data target (name of the data target preceded
by 8), and choose the archive files that are to be read. The extractor checker reads the selected archive
files sequentially. Selection conditions can be entered for filtering but have to be entered in in internal
format
It will remain same in the change log table.
Check this link :
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b32837f2-0c01-0010-68a3-c45f8443f01d
Hope this helps you...........
Regards,
Debjani............ -
Shell Script Programming -- Loading data into table
Hello Gurus
I am using Oracle's sql*loader utility to load data into a table. Lately, I got an unlikely scenario where in I need to process the data file first before loading it into the table and where I need help from you guys.
Consider the following data line
"Emp", DOB, Gender, Subject
"1",01/01/1980,"M","Physics:01/05/2010"
"2",01/01/1981,"M","Chemistry:02/05/2010|Maths:02/06/2011"
"3",01/01/1982,"M","Maths:03/05/2010|Physics:06/07/2010|Chemistry:08/09/2011"
"4",01/01/1983,"M","Biology:09/09/2010|English:10/10/2010"Employee - 1 will get loaded as a single record in the table. But I need to put Subject value into two separate fields into table. i.e. Physics into one column and date - 01/05/2010 into separate column.
Here big problem starts
Employee - 2 Should get loaded as 2 records into the table. The first record should have Chemistry as subject and date as 02/05/2010 and the next record should have all other fields same except the subject should be Maths and date as 02/06/2011. The subjects are separated by a pipe "|" in the data file.
Similarly, Employee 3 should get loaded as 3 records. One as Maths, second as Physics and third as Chemistry along with their respective dates.
I hope I have made my problem clear to everyone.
I am looking to do something in shell scripting such that before finally running the sql*loader script, the above 4 employees have their records repeated as many times as their subject changes.
In summary 2 problems are described above.
1. To load subject and date into 2 separate fields in Oracle table at the time of load.
2. If their exists multiple subjects then a record is to be loaded that many times as there exists any changes in employee's subject.
Any help would be much appreciated.
Thanks.Here are some comments. Perl can be a little cryptic but once you get used to it, it can be pretty powerful.
#!/usr/bin/perl -w
my $line_count = 0;
open FILE, "test_file" or die $!;
# Read each line from the file.
while (my $line = <FILE>) {
# Print the header if it is the first line.
if ($line_count == 0) {
chomp($line);
print $line . ", Date\n";
++$line_count;
next;
# Get all the columns (as separated by ',' into an array)
my @columns = split(',', $line);
# Remove the newline from the fourth column.
chomp($columns[3]);
# Read the fields (separated by pipe) from the fourth column into an array.
my @subject_and_date = split('\|', $columns[3]);
# Loop for each subject and date.
foreach my $sub_and_date (@subject_and_date) {
# Print value of Emp, DOB, and Gender first.
print $columns[0] . "," . $columns[1] . "," . $columns[2] . ",";
# Remove all double quotes from the subject and date string.
$sub_and_date =~ s/"//g;
# Replace ':' with '","'
$sub_and_date =~ s/:/","/;
print '"' . $sub_and_date . '"' . "\n";
++$line_count;
close FILE; -
How can i insert data into DB from my page programatically in Oracle ADF..?
Hai, this is praveen.
I have created an EO and VO, when i have inserted data by dragging and dropping from DataControl -->Operations-->Create. I have successfully inserting data. But how can i do it programatically. What are the pre-defined steps that i can use over there to insert data into table programatically. Could u plz help me?Hi,
You have to create an action Listener in the bean for any button.
Then call an AM method.
In that you have to do the following
ViewObject yourVO = getYourVO();
Row r = yourVo.createRow();
r.setAttribute("Column1", value1); //the name of column should be as it is in your vo attribute.
yourVO.insertRow(r);
this.getDbTransaction().commit();
Thanks -
Can not extract data into BW from SQL SERVER
Dear All,
I meet a problem to extract data from database(MS SQL Server 2000(sp3)) into BW now and can not extract data into BW ODS, even PSA, In the monitor, display yellow light(0 from 0 record), detail message just display message "data request arranged" "confirmed with: confirmation" in requests(message) step; "missing message: request received" in extract (message) step; "no data" in processing(data packet) step and so on. but in fact, there are two records in my database test table and DB connection is OK. Even I can extract data from another test oracle database into BW ODS successfully.
Our BW system has two BW applicaton server and use oracle database. the one application server locates on IBM AIX host. the another one locates on one NT server. the application server on NT server is used for data extration from MS SQL SERVER database into BW oracle database. and MS SQL SERVER and NT platform application server locate on same one host. DBSL was installed on the NT application server already. and DB connector also was created successfully for MS SQL SERVER and datasource also was generated. DBSL type is Kernel640-WIN-IA32bit-unicode. my BW system is ECC5.0/UNICODE/ORACLE. all table/view/field name of MS SQL server is upcase and have not any specific character. for example: ZDEMO etc.
wait your help.
Thanks in advance.
BillyHi Ravi,
Could you help me to get knowledge about the followings:
approximately how many records extracting and transfering from SAP R/3 to BIW in an organisation. for that how much time will take .
How to extract data from two are three source system to BIW. Kindly help me with step by step explanation .If any screen shots with documents pls fwd to my ID. "[email protected]"
Your help highly appreciated.
Thanks.
Hema -
How can i get data from another database SQL Server use database link from
I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?
hi,
u should see following documentation:
Oracle9i Heterogeneous Connectivity Administrator's Guide
Release 1 (9.0.1)
Part Number A88789_01
in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
regards
umar -
How to load data into table Using Script Task
We have a directory/folder where we have a file. We need to insert the File Created Date , File Name , Extension into the database table of Sql server by using Script Task.
So could you please suggest , how to frame the connection string , fetch the file details and insert the data into the database table using Script Task of SSIS 2008You can achieve it as follows using standard script task
1. Add a ForEachLoop container to point to your directory to iterate though the files. Add a variable of type string inside loop to get file name of each file it iterates. Choose option Filename and extension. Add a variable to just store extension part
(FileExtension), set EValuateAsExpression true for it and give expression as below
SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],".",1)+1,LEN(@[User::FileName]))
2. Add a script task inside loop and pass filename variable as a read only variable to it. Crete a new variable to get creationdate and pass it as ReadWrite. Inside write code as below
Public Sub Main()
' Add your code here
Dim f As New System.IO.FileInfo(Dts.Variables("FileName").Value.ToString())
Dts.Variables("FileCreatedDate").Value = f.CreationTime
Dts.TaskResult = ScriptResults.Success
End Sub
3. Add a Exec SQL Task after Script task inside loop and give a query like below
INSERT INTO TableName (FileName,CreatedDate,Extension)
VALUES(?,?,?)
and in parameter tab map the parameter placeholders 0,1 and 2 to @[User::FileName],@[User::FileCreatedDate] & @[User::FileExtension] variables
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
HI SAP Gurus we are going to apply SAP notes , today do i need any furthur configuration required for that or SPS will already configured, plese help me out thank you in advance
-
My Digital personal is not working with 12, will there be a fix?
I just upgraded to 12 and it is not completable with DigitalPersona Personal. Will there be a fix or can i go back to an old version? I just went back as far as 7 but still not working.
-
Add Infotype 0045(Loans) to Personal Profile
Hi All, I am currently on EHP6 and i am trying to add Infotype 0045 to personal profile application but i am facing issues. I have followed the steps with few exceptions from the below link: Adding any Info Type IN ESS in EHP5/6 through WebDynpro Con
-
Setting a Theme on my XpressMusic 5300
I created a theme for my Nokia XpressMusic 5300 with Nokia Theme Studio, and was using it all this time. I had to format my memory card, so then I copied the theme onto it again, and tried applying it. Now I get the message "Out of Memory". The theme
-
I have been unable to download the iphone software v5.1. I keep getting the timing out message. Is there someway to set my network connections to allow the download? Can I get the update some other way?