aspose file tools*
The moose likes JDBC and the fly likes Parsing a String value in StoredProcedure??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Parsing a String value in StoredProcedure???" Watch "Parsing a String value in StoredProcedure???" New topic
Author

Parsing a String value in StoredProcedure???

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
Hi,

I have a string value separated by the delimiters like:

abc#def#ghi#jkl#$mno#pqr#stu#vwx#$............

I want to parse the above string in a stored procedure so that i can insert each value separated by # in a particular column.

So how can i achieve this??

Thanks ,
Jignesh


Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
That depends on which DB you use, because each has its own stored proc syntax.

I would advise to do this kind of processing outside of the DB, though, as it has nothing to do with storing/retrieving data. You don't want to change stored procs if the data format changes.


Ping & DNS - updated with new look and Ping home screen widget
Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

Hi Jignesh
You could make use of StringTokenizer class,
since the "#" is being used as a delimiter and parse your string accordingly.


hth,
cheers
vinny m


Regards,Vinny M.
proud Fan of European Champion CHELSEA FC
"If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing a String value in StoredProcedure???
 
Similar Threads
how to get int value ?
Struts Errors
What is the best way to search for a string in a string?
Use download link to get data in CSV format in JSP page
How to split String array which has comma seperated values