Sql loader  Need to load data with "," only in one filed

Hi,
I need to load data my in one column my data is in CSV format like this
Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan
i want to upload this data on my table which contain only one column which is name ?
What will be the query for upload data through sql loader
Thanks
Shahzaib ismail
Oracle database Express Edition Developer 6I

Since you mention you're using database version XE, I'll assume you're database version is at least 10.2
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productand so you have the power of:
- external tables
http://www.oracle-base.com/articles/9i/ExternalTables9i.php
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6611962171229
- regular expressions
http://nuijten.blogspot.com/2009/07/splitting-comma-delimited-string-regexp.html
and you don't want to be using SQL*Loader anymore, never ever.
I simply put your string 'Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan' in a file called test.csv and told Oracle that file is in my Oracle directory DATA_DIR (that actually points to: c:\data on my 'filesystem' ) and then:
SQL> create table t(name varchar2(155));
Table created.
SQL> -- instead of SQL*Loader use an External Table:
SQL> create table ext_t
  2    ( textstring varchar2(4000)
  3    )
  4    organization external ( type oracle_loader
  5                            default directory DATA_DIR
  6                            access parameters (fields terminated by '' )
  7                            location ('test.csv')
  8                          );
Table created.
SQL> -- Now you can query your file as if it were a table!                       
SQL> select * from ext_t;    
TEXTSTRING
Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan
1 row selected.
SQL> -- and use the powers of SQL to do whatever you want (instead of cludging with those dreaded ctl files):
SQL> select regexp_substr (textstring, '[^,]+', 1, rownum) names
  2  from   ext_t
  3  connect by level <= length(regexp_replace(textstring, '[^,]+'))+1;
NAMES
Shahzaib ismail
Imran aziz
Shahmir mehmood
Shahzad khan
4 rows selected.
SQL> -- Voilà, the data is loaded into the table in one single SQL statement:
SQL> insert into t
  2  select trim(names)
  3  from ( select regexp_substr (textstring, '[^,]+', 1, rownum) names
  4         from   ext_t
  5         connect by level <= length(regexp_replace(textstring, '[^,]+'))+1
  6       );
4 rows created.
SQL> --
SQL> select * from t;
NAME
Shahzaib ismail
Imran aziz
Shahmir mehmood
Shahzad khan
4 rows selected.Don't use SQL*Loader, use an External Table.

Similar Messages

  • In base component when user change the serial number we need to set date time in Extra attribute filed

    HI Team,
    In ibase component when user change the serial number we need to set date time in Extra attribute filed..if we click edit ,User change serial number after save we need to set date time in  Extra Attribute 4 field .
    Component - PRDGENSET
    In this component there is no attributes,so where we need to implement and how to implement please help.
    Thanks
    kalpana

    Hi Abi,
    Thanks for your reply..see i debugged..i have put break point in method SET_S_STRUCT method if press enter in serial number ,debuggeris triggered..in SET_S_STRUCT method value getting serial number..so how to write the logic here...
    In GET_S_STRUCT method iam getting all attributes  but serial number is not filled..So could you please help here what to do..
    in set_S_STRCUT method value iam gettin serial number...in collection wrapper iam geting zrealtions if i open attributes_ref -if i pass Attribute value in run time its getting displayed.so how to write the logic based on serial  number please help some coding.
    Thanks
    kalpana

  • SQL Loader needs to load default value instead of null

    I am loading data from the flat file into the table. The table primary key consists of 5 fields. One of these fields might be empty in the text file, so on the load I need to substitute it with some default value like "***", for instance. Is there any way to make some conditions in the control file?

    You can either make use of the suggession given by Warren Tollentino or alter table by adding default constraint for the column.

  • Is it possible to make a delta load for a Master data with Standard DS

    I have a full load bringing huge data for master data with standard datasource.
    I want to run a delta due to huge no. of records but when I create a new Infopackage it dont give a option for delta update.
    Are delta loads specific to only standard or customized DS's or any other reason behind that ?

    I kind of understand what you are asking about, but I am unclear as to how it pertains to our BO SDK.
    You are wanting to find the differences between a large dataset and another large dataset.
    I am not sure what an Infopackage is.
    Are you using the BO Enterprise SDK or some other product?
    Jason

  • Error while running bulk load utility for account data with CSV file

    Hi All,
    I'm trying to run the bulk load utility for account data using CSV but i'm getting following error...
    ERROR ==> The number of CSV files provided as input does not match with the number of account tables.
    Thanks in advance........

    Please check your child table.
    http://docs.oracle.com/cd/E28389_01/doc.1111/e14309/bulkload.htm#CHDCGGDA
    -kuldeep

  • Sql sript for Insert of data with repeating values

    It has been a long long time since I had to do write and use any SQL scripts, please forgive the question. I used to use a script to insert values into a table as part of my job. I have forgotten what the script I used was and since lost all my Oracle note books and other DBA material.
    I did a search and went through 30 pages of results, I didn't see what I'm looking for.
    The data is from one large file that is appended at the end and sometimes updated somewhere in the middle of the set which is considered new data. I am not concern with getting the data out of the file, I got that handled but the insert into the table - transactions - is where I'm lost.
    I used to use a script to load the data, about 6 years ago, and it would load the file, exclude the data that was already in the table and insert the new data and the data with the changes.
    The data columns are date, time, reference, transaction code, location, debit amount, fee amount, balance.
    The date repeats but the time and reference values are unique.
    Any help with this script is appreciated.

    Hi,
    welcome to the forum..!
    You can use Oracle's merge statement to (update + insert) data into a table ... if the data exists update it with the new values and if it does not, then insert it.
    Here's a link to get you started...
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm
    Since, the data is from a file, you could create an external table on the file and directly do a select from the file.
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*0.1)
         WHERE (S.salary <= 8000);in the above example, the
    SELECT employee_id, salary, department_id FROM employeesis the source data. instead of loading the file into a temporary table and then merge into the target table , you could read from <<<external_table_on_your_file>> and then do a merge into the target table.
    http://www.oracle.com/technology/products/oracle9i/daily/sept19.html
    If you encounter any problems, please post the full description of your error.
    Thanks,
    Rajesh.
    Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
    Always try to provide create table and insert statements to help the forum members help you better.

  • SQL Developer 3.2 - Exporting data with TIMESTAMP datatype

    Hi,
    We have users that are attempting to export data with the Timestamp format to Excel (xls format) using SQL Developer 3.2.  When attempting to sort the Timestamp in either asc or desc order, Excel is having issues sorting correctly.  I suggested that the user just do all the sorting within their SQL Developer session but they require the ability to slice and dice in Excel.
    This is definitely not an issue with Excel as the users have previously exported Timestamp data from Toad and been able to sort without issue.  Any thoughts as to what might resolve this issue? 
    Thanks.

    We're not formatting timestamps in Oracle as numbers/dates in Excel. They'll need to properly format the Excel column/cells to get it to sort the way they want vs being treated as simple strings.

  • Multiple events per date with only one photo each - Unwanted

    I have the eyefi wireless sd card in my camera and it is setup to transmit my photos into iphoto automatically, which it does. However, the problem arises in that iphoto creates multiple events for the same date each containing only one photo. I would prefer that iphoto create individual events per date and have the multiples of that date's photos within. I thought I had the settings configured to do so as I have preferences set for autosplit events one per day but I still see events such as - July 3, 2008 - July 3, 2008 - July 3, 2008 - each with only one photo inside.
    I am wondering if it is something in iphoto's settings or the way in which eyefi transmits the photos into iphoto.
    Any thoughts?

    I do not have a WiFi connection to my camera so can not test but am just guessing
    I can think of two possibilities
    - 1 - if you are taking the photos with the WiFi connected then each time you snap a photo it may be being sent which would be looked at as a new import and therefore create a new event - to stop this I believe you would have to not have a full time WiFi connection to your camera or somehow set the camera to send batched - not each one - iPhoto will take each batch into and follow the rules for making events for that batch even if you camera is sending many batches of One photo
    - 2 - You have the preference for making batches set to one every two hours and there is a long time between photos - I'm guessing that #1 is more likely
    LN

  • SWF loader need to load 100% width and height

    Hi,
        I have using dashboard in my application.In which the flex pages are loaded using SWF loader. the swf is not loading 100% when i minimize the browser. actually its loading 100% when the browser is full screen mode. suppose the browser is opened in 75% the swf also gets loaded based on the browser size. but after maxmizing the browser the SWF its not expaned to the actuall size of the browser. could you anybody help me plz..?
    Thanks & Regards
    Muthu

    Hi,
         I have used this code to load the swf in the main application:
    <mx:Canvas id="dashCanvas"  creationPolicy="all" cachePolicy="on" width="100%"  backgroundColor="#FFFFFF" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                   <mx:SWFLoader id="dashBoard" trustContent="true"  width="100%" height="100%" scaleContent="true" autoLoad="true"
    source="@Embed(source='../../../../assets/appl/dashboard/dashboard.swf')"  /> 
    </mx:Canvas>
    And i have set width and height as 100% in <mx:Appilcation> .
    Thanks and egards
    Muthu

  • Get the data with more than one of the desired value

    Hi,
    I need to pull the records with more than one value of 'Other' on the delivery days fields.
    The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
    Here is the Sample data:
    cust_id: 123
    item: newspaper
    mon: Home
    tue:Work
    wed: Other
    thu: Home
    fri: Other
    sat: Other
    And here is my query so far.
    select
    cust_id,
    item,
    mon,
    tue,
    wed,
    thu,
    fri,
    sat,
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
    else 0 end) as day_ctr
    from customer
    Could you please help me with the right formula I need to get this?
    Thank you in advance..

    First
    DESC customer
    Second
    Can you explain what you are trying with
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
    Third
    Usually it's helpful a example of the result you want...
    Perhaps you want this
    select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
            DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
            DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
            DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
            DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
            DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
    select
    COUNT(DISTINCT mon) mon,
    COUNT(DISTINCT tue) tue,
    COUNT(DISTINCT wed) wed,
    COUNT(DISTINCT thu) thu,
    COUNT(DISTINCT fri) fri,
    COUNT(DISTINCT sat ) sat
    from customer
    )

  • Since loading the new update, my downloads only display one page after the Quicktime Player symbol is shown.

    I often access published papers from our university library. Since I updated Firefox, the QuickTime Player icon displays on my Mac, the papers load properly, but only the first page is displayed. If I copy the full URL from the Mozilla address line into another browser, the full article is loaded with that browser. Can you help, please. Firefox is my FAVORITE browser, but lately is causing me problems. Thank you.

    Totally agree with this post. I like my swr30 a lot less now. Some ideas of the updates are good, but the execution is poorly and unusable. How do you do a roll back as you mentioned?

  • Sales Order : Calcul delivery date with only working days

    HI,
    When I create sale order, the delivery date is calculed with the number of days mentionned in type of sale document. SAP add this number of days into the day's date.
    Is it possible to calculate this delivery date only with working days in the corporate calendar ???
    Thank's

    HI
    Delivery date in the Sales order will be calculated the calender only basedon the Transportation lead time and Pick/Pack time and excluding the holidays
    Please cross the same in your instance
    Regards,
    Ram.

  • How to compare sales of 2 dates with only one date is given?

    I am having a requirement such that the user wants to see the particular company Y2D sales of this year and previous year, and only one variable selection is given (today's date). How can i design the report to see this year sales and last year sales in separate columns?

    Hi ,
    You have to create two RKFs.
    In the first RKF , you have to create a customer exit variable on your date and that too it should be interval . Using the CMOD code , populate this interval from the 1st day of this year till the date user is entering .
    In the second RKF , you have to create a customer exit variable on your date and that too it should be interval . Using the CMOD code, you have to populate the interval from the 1st day of the previous year till the same date as entered by user but it should be of last year .
    You have to write the above 2 codes in I_STEP = 2 mode .
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh

  • Web service client needs to share data with a SOAP Message Handler

    I have a web service client that is built using WebLogic 10 clientgen. I also have a Soap Message Handler configured that will create the required Soap Headers for the web service call.
    Creating these Soap Headers works great as long as the header data is static but the problem comes up when I need to place some dynamic data in these headers. The web service client has this data and somehow needs to pass it to the Soap Message Handler. It looks like I need to somehow have the client place this data in the MessageContext before the call so the data can be accessed by the Soap Message Handler.
    How do I get access to the MessageContext from the client or is there a better way to do this?
    Thanks in advance for any help you can give.

    You may want to check the response to this previous post to see if it yields any ideas for you:
    Not able to Pass header info to Microsoft MapPoint WebService using WLS10

  • How can I remove all my bookmarks from iCloud and start a fresh with only the ones on my iMac

    I accidentally deleted bookmark gilders on my iPad 4 and iCloud removed them from my iMac, iPhone 5, iPhone 4, iPad 2 and MacBook Pro. I turned off Safari on all devices for syncing with iCloud and used Time Machine to restore my Bookmarks.plist on my iMac, but iCloud keeps removing it and replacing the plist with the latest version. I want to remove all the Safari a bookmarks from iCloud, but don't know how to do this, can anyone help.

    Just a note about the difference between these two things:
    * "export" and "import" use an ancient HTML document format that all browsers can understand. When you import bookmarks, Firefox may place them into an Imported Bookmarks folder, or into Unsorted Bookmarks. This does not displace existing bookmarks, and Firefox does not automatically remove duplicates.
    * "backup" and "restore" use a more comprehensive JSON data file, which contains extra information about your bookmarks (such as tags) not contained in the traditional export file. HOWEVER, a restore completely replaces all existing bookmarks, so the restore feature cannot be used to merge in a set of additional bookmarks.
    Related support articles:
    * [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]]
    * [[Import Bookmarks from a HTML file]]
    * [[Restore bookmarks from backup or move them to another computer]]
    Some users find the disk-based Windows Favorites folder a convenient way to organize bookmarks. If you do, too, and you do not need to preserve tags on your bookmarks, you could export each profile's bookmarks to HTML and import them all into IE11. Organize them in the Windows Favorites folder, then export from IE11 to HTML and import that file into each Firefox profile. See: [http://windows.microsoft.com/en-us/internet-explorer/add-view-organize-favorites].

Maybe you are looking for

  • Custom reports in Oracle Designer - HELP!

    I have a need to write some custom reports in Oracle Designer. I know all the information is in the repository but don't know how to get it out. Would anyone happen to know where I can get my hands on an ER diagram depicting the relationships across

  • Port Mapping Problem

    I'm using Filemaker Web Publishing and need to map port 591 to a local computer. I have a static IP address from my ISP but when I enter the info into Airport it doesn't seem to do anything. I've also tried, as a test, to set up personal web sharing

  • Wsrp producer in weblogic app server not portal server

    I am following the instructions given in [url http://edocs.bea.com/wlp/docs92/federation/Chap-Working_With_Producers.html] to create wsrp producers on weblogic server without the portal server. However in Figure 8-7 (Select Project Facets) of the art

  • Lines on images upon printing

    When I print images with my pixma 7120, there are lines of missing color on the image. Mostly on the blue and green colors. I have already done a nozzel head cleaning AND deep cleaning. Now what?

  • Automated storage type and bin

    hi thanks for givining reply i extened the mmo1 and  while doing the lt06 this storage type is coming in the destination place but the bin not coming error is coming there is no bins in the storage type can u tell me is there any setting required in