Can we concatenate 2 columns of datafile into one column in sql loader
Hi,
Can we concatenate 2 columns of datafile into one column in sql loader?
like
Suppose there are two field in data file
column1 - lastname value tiger
column2 - firstname value scott
Required result
sould be concatenate of the two field into one database coulmn
like name and value should be scott tiger.
Thanks
Or try this...
My input file
1,KARTHICK,PATTABIRAMAN,SOFTWARE
2,VIJAY,RENGANATHAN,FINANCE
3,VIMAL,KANTH,SALESAnd my control file.
LOAD DATA
INFILE 'EmpDetail.txt'
BADFILE 'EmpDetail.bad'
DISCARDFILE 'EmpDetail.dsc'
INTO TABLE "EMPDETAIL"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(NO,
NAME1 BOUNDFILLER,
NAME ":NAME1||' '||:NAME",
DEPT) My table is.
SQL> create table empdetail(no integer, name varchar2(50), dept varchar2(50))
2 /
Table created.Then i loaded the data.
D:\karthick\Akiva\Look up\Akiva\Address Look Up>sqlldr sysadm/sysadm@akivanew empdetail.ctl
SQL*Loader: Release 9.2.0.1.0 - Production on Mon Sep 15 12:23:42 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Commit point reached - logical record count 2
Commit point reached - logical record count 3And the output is
SQL> select * from empdetail
2 /
NO NAME DEPT
1 KARTHICK PATTABIRAMAN SOFTWARE
2 VIJAY RENGANATHAN FINANCE
3 VIMAL KANTH SALESThanks,
Karthick.
Similar Messages
-
Hi, thanks for taking the time...
I'm running a machine with Windows 7, Office 2010, and Acrobat XI. When I save a specific PDF as an Excel workbook, all of the data in the original PDF is sorted correctly in four columns. When the same task is performed on this file on another user's machine, all of the data is sorted into one column. The user has the same versions of Windows, Office, and Acrobat. I've attempted the "Repair installation" option but the problem persists. Any suggestions? Thanks again for helping,
-EThanks for the quick reply. I figured out how to get the desired results by using tagging. For anyone who may reference this post in the future, I went to "Customize" in the top right corner of Adobe, then selected "Create new tool set...", looked under "accessiblity and found the "tag" option. Hit ok, tag is added to the toolbar. Then I highlighted the dataset in the PDF that was relevant to the output format, then clicked "tag", saved as spreadsheet. Sorry I can't provide more details on how tagging works or if there's a more elegant solution available, but I'm sure one's out there.
-
How to copy one column BLOB value into another column of another database.
How to copy one column BLOB value into another column of another database.
BLOB value contains word document.
I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
Is there any other better way to do this?You're welcome
BLOB fields contains binary data. I don't think you can do this
Also if I view the BLOB as text. Can I copy it and insert into the new database.
I think your options are as I said. Datapump or CTAS
Best Regards -
Can I merge 3 jpeg files into one PDF on one page?
Can I merge 3 jpeg files into one PDF on one page? For example: scanned newspaper article was too big for one scan process, I had to scan article 3 times. Can I merge these 3 jpegs and position them like columns?
Do you have Acrobat? If so, you can use the Add Image tool to place your images on the page where you want them to be. Alternatively, you can combine all 3 to a single PDF and then send that PDF to the PDF Printer, selecting the Multiple option to get them to appear on a single page of the new file.
-
Inserting multiple selection from checkbox into one column of the database
Hi,
How to insert multiple selection values from checkbox into one column of the database.
Anyone can u help me
Thanxhi
try to use request.getParameterValues("fieldname") -
Sql loader - mutiple values into one column
Hi,
Is it possible to load multiple fields into one column. Eg, my table structure has two columns COL1, COL2 and my data file is comma delimted with 3 fields A,B,C.
How could i use sql loader to achieve (without the use of temp tables)
COL1 = A
COL2 = BC
ThanksI don't understand why you can't modify the input fille.
But anyway, i have 2 ways to help you
1. Make new inputfile online using pipe and awk(or something your are familiar with) and use it as new input file.
This is a traditional and powerful method in Unix environment.
For instance:
oracle> $ mknod pipe.dat p
oracle> cat input.dat | awk '{print ...}' > pipe.dat &
oracle> sqlldr ctl=.. data=pipe.dat
Using this method, you don't need to modify original input file physically, but by some magical trick you can modify it on the fly.
2. Use before trigger
For instance:
create table load(a int, b int, c int, d int);
create or replace trigger load_trigger
before insert on load
for each row
begin
:new.d := :new.b + :new.c;
:new.b := null;
:new.c := null;
end;
load data
infile *
append
into table load
fields terminated by "," optionally enclosed by '"'
(a, b, c)
begindata
1, 1, 1
2, 2, 2
3, 3, 3
4, 4, 4
sqlldr userid=... ctl=load.ctl
SQL> select * from load;
A B C D
1 2
2 4
3 6
4 8
You won't like the existence of unnecessary columns(B, C) but don't have choice. ^^;
I think there is another simple way provided by SQL*Loader. But i've never tried it myself. Read following doc and try it yourself:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1008153 -
How can I combine two itunes accounts into one?
How can I combine two itunes accounts into one?
Items purchased from the iTunes Store are permanently associated with the account from which they were originally purchased. Apple provides no way to change this.
However, if you wish to put content from two accounts into a single iTunes library, you can easily do so. Use the command File > Add File (or Folder) to Library. -
When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators. Excel allows you to do this during the import.. Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.
Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
(I don't have an iPad, so I don't know the iOS answer.) -
Data in two different coulmns merge into one column
I am using following script to create external table with data.
CREATE TABLE external_class(
item_no varchar2(255),
max_range varchar2(255)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY DATALOAD
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
(item_no,max_range)
LOCATION ('class_newc.txt')
REJECT LIMIT UNLIMITED;
Problem is that its merge both columns into one column.
I want two seperate columns.
Data is in microsoft excel spread sheet.
I saved as txt(TAB DELIMITED) txt
Data appears in clas.txt file as below:
"400 " 4177.64
"404 " 5574.64
"406 " 5333
"408 "
"409 "
"450 " 10.83
"478 "
"482 " 4820
I ran the above script to create table.
Table Created
SQL> desc external_class;
Name Null? Type
ITEM_NO VARCHAR2(255)
MAX_RANGE VARCHAR2(255)
SQL> select count(*) from external_class;
COUNT(*)
3036
but with
select * from external_class;
ITEM_NO MAX_RANGE
"400"4177.64
"404"5574.64
"406"5333
"408"
"409"
"450"10.83
"478"
"482"4820thanks its work.
Actually I created other file as below
Item_no-----max_range
400 4177.64
404 5574.64
406 5333
408
409
450 10.83
and use creation script as below:
CREATE TABLE external_class(
item_no varchar2(255),
max_range varchar2(255)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY DATALOAD
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
fields terminated by whitespace
MISSING FIELD VALUES ARE NULL
(item_no,max_range)
LOCATION ('class_newa.txt')
REJECT LIMIT UNLIMITED; -
Concatenate multiple pdf files into one single postscript file
Hi,
Could anyone help me with a code to "Concatenate Multiple pdf files into one single postscript file" ?
Thanks for the helpThanks for your reply! Actually the main purpose is to allow user to select multiple pdf documents on a single web page and then he should be able to print all of them at once by hitting the print button on the web page instead of selecting each document seperately to print it. Also he should be able to see all the printing services available to print those documents.
Thanks, -
SQL*Loader - How to combine Flat File 3 columns and put into one single column
Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
e.g.
Flat File
100,239,30,20,30
While inserting into table want to combine last 3 columns and insert into invoice number column.
302030It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
Vijay -
Select multiple column into one column
Hi..!!!
Is it possible to select 4 columns in to 1 columns?
I've major1, major 2, major 3, major 4 and i want to retrieve all the columns into one column called "Majors".
Is it possible? if yes then how?
Help me out.
Thanks,
HimadriIf you had given a proper example this thread would have been over in two posts. What you are looking for is often described as an UNPIVOT.
I tend to use a collection type for this, e.g.
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> CREATE OR REPLACE TYPE varchar2_table AS TABLE OF VARCHAR2 (4000);
2 /
Type created.
SQL> SELECT empno, column_value
2 FROM emp, TABLE (varchar2_table (ename, job));
EMPNO COLUMN_VALUE
7369 SMITH
7369 CLERK
7499 ALLEN
7499 SALESMAN
7521 WARD
7521 SALESMAN
7566 JONES
7566 MANAGER
7654 MARTIN
7654 SALESMAN
7698 BLAKE
(snipped)
28 rows selected.
SQL> -
Currency & Amount Concatenated into One Column after SPS Upgrade
Hi BI Community
We have recently upgraded to SPS17 (BW SP19) for our production system and we have one issue where the currency and amount are concatenated into one column (Annual Salary). Previously the currency and amount are displayed in separate columns. An example below.
Before SPS Upgrade
Annual Salary
100000
723200
20122
After SPS Upgrade
Annual Salary
USD 100000
723200 TWD
20122 CNYHi Karthik,
Its working fine but if duplicate values found in column which we want to concat it should take its occurrence only once
for eg:
ID COMPLETED_BY RISK_EVALUATION
532 [email protected] Low/Low/Medium/High/Medium/Medium/High/Medium/High/High/Medium/Low/Medium
this should be like below
ID COMPLETED_BY RISK_EVALUATION
532 [email protected] Low/Medium/High
Thanks in advance -
Can two Apple accounts be combined into one
I have two Apple accounts with iTunes. Can these two accounts be combined into one?
Thanks. I appreciate it.
-
afternoon Gurus.
I take it by the errror messages produced I'm not able to do this..
select ....
address_line1||', '|| address_line2||', '|| address_line3||', '|| city|| Supplier_Address
from...
..in my XML Publisher xsl Data Template file..
Caused by: org.xml.sax.SAXParseException: <Line 13, Column 20>: XML-20201: (Fatal Error) Expected name instead of |.
So how can I acheive putting several fields into one like you can in SQL?
THanksForLooking..
AlUntested, but try the following:
SELECT DISTINCT
fnd.CREATION_DATE
,fnd.user_name
,fnd.start_date
,per2.last_updated_by
,per2.last_update_date
,per2.employee_number
,per2.EMAIL_ADDRESS
,per2.full_name
,fnd.LAST_LOGON_DATE
FROM fnd_user fnd
where fnd.End_Date is null
left outer join per_people_f per2 on ( fnd.employee_id = per2.person_id
and SUBSTR(per2.LAST_NAME, 2, 6) not like 'some characters'
and per2.EMAIL_ADDRESS LIKE '%priddle%' )
ORDER BY 2 ASC;Investigate multiple outer joins using the LEFT OUTER JOIN syntax
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/queries006.htm#SQLRF52354
Maybe you are looking for
-
Problem with a Form field, need help
I work for a small police agency and I am our IT guy. Most of my IT tasks have many been hardware and system software and networking. I have been trying to learn and teach myself programming. I also create forms for agency use. I have been workin
-
XI web service from 4.6C
Hi, I want to call XI web service from 4.6C. I can not use RFC adapter as web service also returns attachments. I can not use proxies as it is 4.6C. Please help.... Thanks, Beena.
-
hi all i am returning one material with return PO now i did migo with only part one option now when i do J1is system doesn't pick values automatically after clicking on get excise invoice when i do same in development server it is working fine please
-
MDX output query is too large to display
Mdx is truncating our report. What should we do to see the entire report?<BR>We get the following error message at the end of the report: Error 1241172 "MDX output query is too large to display"<BR>Thanks in advance<BR>Sibel
-
How to save a bitmap to a pdf file format?
Hello, We have a scanning application that can write out BMP files or TIFF files. My boss would like to have the files in PDF format. Is there a way to do this? I can write code if given the specs. Call an external routine if there is one availab