Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Parameter in Stored Procedure with like xxx% |
Thu, Feb 28 2008 10:40 AM | Permanent Link |
Uli Becker | Hi,
I juse this code for a stored procedure: BEGIN DECLARE Result CURSOR WITH RETURN FOR Stmt; BEGIN PREPARE Stmt FROM 'SELECT * from Patienten where Name = ? and Vorname = ?'; OPEN Result using Name, Vorname; END; END Works fine. How can I use the like-operator together with the parameters in a Stored Procedure, something like this: PREPARE Stmt FROM 'SELECT * from Patienten where Name like ?% and Vorname like ?%'; Regards Uli |
Fri, Feb 29 2008 8:40 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Uli,
<< Works fine. How can I use the like-operator together with the parameters in a Stored Procedure, something like this: >> Use this: BEGIN DECLARE Result CURSOR WITH RETURN FOR Stmt; BEGIN PREPARE Stmt FROM 'SELECT * from Patienten where Name = ? and Vorname = ?'; OPEN Result using Name+'%', Vorname+'%'; END; END -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Feb 29 2008 8:49 AM | Permanent Link |
Uli Becker | <<
OPEN Result using Name+'%', Vorname+'%'; >> This is tricky Thanks a lot. Regards Uli |
Fri, Feb 29 2008 9:41 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Uli,
<< This is tricky Thanks a lot. >> Well, you could have embedded the % characters in the actual SQL text also, but it would have been a lot less readable. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Feb 29 2008 9:52 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Uli
>This is tricky Thanks a lot. Dead right - I've applied for a brain upgrade Roy Lambert |
This web page was last updated on Thursday, September 26, 2024 at 10:04 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |