MySQL Forums
Forum List  »  Stored Procedures

Need Help : Pattern Matching in Stored Procedure
Posted by: Vinay KD
Date: February 15, 2010 01:41AM

Hi

I am a new user of MySql. And i m puzzled since last three days with a proble.

I have a table with following structure

<UserMaster>

Userid integer
Uname varchar(250)


I want to select some records from this table where Uname starts with Mar, and a ProfileURL that is a string of query expression. like this

UserID UName ProfileURL
1001 Mark "<A HREF='ProfilePage.ASPX?ID=1001' class="linkcss">Visit Profile</A>
1002 Martin "<A HREF='ProfilePage.ASPX?ID=1002' class="linkcss">Visit Profile</A>

Please guide me how I should write this query with the help of stored procedure, and how I can pass the Uname as a parameter for stored procedure.
One more thing I would like here, that is The Returning ProfileURL must be in TEXT format instead of Bytes.

I think that query should be like

SELECT
CONCAT(" '<A HREF=ProfilePage.ASPX?ID=" , UserMaster.Userid, "'>Visit Profile</A>") AS LinkField,
UserMaster.Userid,
UserMaster.Uname
FROM
UserMaster
WHERE
UserMaster.Uname LIKE 'Mar%'




But this is not working in stored procedure

Please help me.

TIA

Vinay KD

Options: ReplyQuote


Subject
Views
Written By
Posted
Need Help : Pattern Matching in Stored Procedure
3226
February 15, 2010 01:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.