I have an mysql procedure (listed below)
when I do calls to it:
CALL test_parse('Live & Let Die');    -> this one does not work:
CALL test_parse('George W. Bush');    -> this one does not work:
CALL test_parse('Bush, George W.');   -> this one works.
 
basically the in "Live & Let Die" the charactors after then "&" get a funky 
charactor
 which looks like a small double "L" or a lower right hand corner of a box. but 
when 
 I paste it into my text editor it looks like a plus sign.
 
 This is being run on a windoz box.
 
 Is there something with the substring command in mysql that doesn't like 
certain charactors?
 

 
+----------------+
| INPUT          |
+----------------+
| Live & Let Die |
+----------------+
1 row in set (0.00 sec)
 
+----------------+--------------------+
| v_lead_element | remaining_elements |
+----------------+--------------------+
| Live           | & Let Die          |
+----------------+--------------------+
1 row in set (0.00 sec)
 
+----------------+--------------------+
| v_lead_element | remaining_elements |
+----------------+--------------------+
| &              | «                   |
+----------------+--------------------+
1 row in set (0.00 sec)
 
 
 
here is the procedure:
 
DROP PROCEDURE IF EXISTS test_parse;
DELIMITER //
CREATE PROCEDURE test_parse
     ( IN v_string   VARCHAR(255)
     )
   BEGIN
   --                                                                         
-- DECLAREATION SECTION
      DECLARE v_string_r    VARCHAR(255);
      DECLARE v_lead_element    VARCHAR(255);
   --                                                                         
-- BEGIN ACTION
SELECT v_string INPUT;
      --
      SET v_string_r = v_string;
      --                                                                      
-- loop through string
      WHILE v_string_r IS NOT NULL
      DO
         IF INSTR(v_string_r,' ') <> 0
         THEN
            SET v_lead_element = SUBSTR(v_string_r, 1, INSTR(v_string_r,' 
')-1);  -- parce out lead element
            SET v_string_r = SUBSTR(v_string_r, LENGTH(SUBSTR(v_string_r, 1, 
INSTR(v_string_r,' ')+1)));
         ELSE
            SET v_lead_element = v_string_r;                                  
-- load last element
            SET v_string_r = NULL;
         END IF;
SELECT v_lead_element, v_string_r remaining_elements;
      END WHILE;
   END;
//
DELIMITER ;
 

 


[Non-text portions of this message have been removed]



The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to