Jun 12, 2006 #1 angjbsca Programmer May 26, 2006 30 PR Hi How I do this: select * from t1 where f1 like '%joe%' with parameters I try this but does not work; select * from t1 where f1 like '%' || ? || '%'
Hi How I do this: select * from t1 where f1 like '%joe%' with parameters I try this but does not work; select * from t1 where f1 like '%' || ? || '%'
Jun 15, 2006 #2 PruSQLer Technical User Nov 6, 2001 221 US It's not clear to me what you're trying to do. Could you elaborate... Upvote 0 Downvote
Jun 15, 2006 Thread starter #3 angjbsca Programmer May 26, 2006 30 PR Im working with report application and db2 so, if I send a query with parameters I do that: select * from t1 where f1 = ? where ? is the param thats query work fine. but if I use "Like" with wild cards "%" in .net with sql I do that: select * from t1 where f1 like + "'%" + ? + "&'" but in db2 that king of query do not work for me. Upvote 0 Downvote
Im working with report application and db2 so, if I send a query with parameters I do that: select * from t1 where f1 = ? where ? is the param thats query work fine. but if I use "Like" with wild cards "%" in .net with sql I do that: select * from t1 where f1 like + "'%" + ? + "&'" but in db2 that king of query do not work for me.
Jun 15, 2006 #4 MarcLodge Programmer Feb 26, 2002 1,886 GB From within your .net application can you append a % to the value. For example if the value is 'Tek', set it to 'Tek%'. Your sql would then read: select * from t1 where f1 like ? Hope this helps. Marc Upvote 0 Downvote
From within your .net application can you append a % to the value. For example if the value is 'Tek', set it to 'Tek%'. Your sql would then read: select * from t1 where f1 like ? Hope this helps. Marc