Home » SQL & PL/SQL » SQL & PL/SQL » Inserting the Comma Separated Strings into Table (Oralce 9i,Windows 2000 Prof)
Inserting the Comma Separated Strings into Table [message #362990] Thu, 04 December 2008 14:05 Go to next message
seenujanu
Messages: 53
Registered: August 2006
Location: chennai
Member
Hi Seniors,


i had two string and i want to insert the records in the Table COMMENT . In this way.

would u please give some programe


  The Data and the Table


  ( 901,902,903,904 )


 ( 'hai','nice','good & mail is asd@sdf.com ','excellent and the phone 011-235323' )


 
 comm_id  loc_id  company_name      comments
  1  	   10        901 	     Hai
  2  	   10        902 	     nice
  3        10  	     903 	     good & mail is asd@sdf.com 
  4  	   10        904 	     excellent and the phone 011-235323





Thanks
Seenu
Re: Inserting the Comma Separated Strings into Table [message #362998 is a reply to message #362990] Thu, 04 December 2008 14:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post a test case: create table and insert statements along with the result you want with these data.

Also search BEFORE posting, comma separated string input is asked EACH AND EVERY week when it is not several times per week.

Regards
Michel
Re: Inserting the Comma Separated Strings into Table [message #363032 is a reply to message #362990] Thu, 04 December 2008 19:03 Go to previous messageGo to next message
wmgonzalbo
Messages: 98
Registered: November 2008
Member
For the strings, you can use INSTR and SUBSTR..

Regards,
Wilbert
Re: Inserting the Comma Separated Strings into Table [message #363048 is a reply to message #363032] Thu, 04 December 2008 23:20 Go to previous messageGo to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

You can use 'dbms_utility.comma_to_table' procedure. it will fill one plsql table later you need to loop.
Re: Inserting the Comma Separated Strings into Table [message #363162 is a reply to message #363048] Fri, 05 December 2008 04:48 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Comma_to_Table is not a good solution for this sort of problems. It requires the comma separated values to all be valid as object names in Oracle - 30 characters long, start with leading letter, only $,_,A-Z and 0-9 in them.

That's not what you want for a general string convertor.
Previous Topic: External Tables
Next Topic: UTL_FILE.FOPEN got ORA-29283 [merged and dupe removed]
Goto Forum:
  


Current Time: Wed Dec 07 12:45:20 CST 2016

Total time taken to generate the page: 0.12516 seconds