I want to use a LIKE statement in the DB2 Cursor query. Again in the Select query i am coding the LIKE statement using a host variable...
Declare c1 CURSOR for
select col1, col2, col3
where col1 = :col1-var
and col2 like :col2-var
..i am concatenating the value in col2-var as
string %, temp-var and % in to col2-var...so my col2-var will look like
When the fetch operation is performed, i am always getting a return code of 100.
Please help me out, if there are any specific thing to be followed while using LIKE function in cursors....also i tried hard coding the like values in the cursor...then it was fetching properly..only if i use the host variable , i am getting a sqlcode of 100..
Thanks in advance.