Re: Quick split() and data parse

2005-11-04 Thread Jigal van Hemert

Scott Haneda wrote:

I have a field `fedex`, in it is text date, in tab sep \n delimeted form,
for example:

90FedEx Home Delivery (Residential) 14.06
20FedEx Express Saver   22.63

(...)

Is there some way I can do some string parsing on the text field and get to
the 3rd item where the passed in shippign_method equals?


You can do something with a combination of the functions SUBSTRING(), 
LOCATE() and SUBSTRING_INDEX(), but it would of course be a lot wiser 
extract the information from this field and put it in a table of some 
sort. That way it would be a lot faster to find the data (no need to 
parse every single record) and you wouldn't need to write complex 
expressions to find the data you want...


Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Quick split() and data parse

2005-11-03 Thread Scott Haneda
I have a field `fedex`, in it is text date, in tab sep \n delimeted form,
for example:

90FedEx Home Delivery (Residential) 14.06
20FedEx Express Saver   22.63

There can be x rows of data in the field, only every 3 fields to the data.
So the above could be 5 lines in total, or one, whatever.

Another field, `shipping_method` is what I am updating:
Update orders set shipping_method = 20 where id = xxx

So I know the shipping_method in advance, what I need to do, is get to the
price data, and also update:

Update orders set shipping_method = 20, price = x.xx where id = xxx

Is there some way I can do some string parsing on the text field and get to
the 3rd item where the passed in shippign_method equals?

-- 
-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com Novato, CA U.S.A.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]