IF Condition in cursor definition
-
HI all, I am new to cursor and i have a doubt... I have one vb code in which few sql statements are written. I need to convert these sql codes into pl/sql sotred procedures. But, in vb, the sql query is dynamic on the basis of values passed like..
If Trim(txtEqpId) <> "" Then
Sql = Sql & vbCrLf & " AND c.eqpid LIKE '" & Trim(txtEqpId) & "%'"
End IfThis sql query is first generated and then it is being called from vb code. Now the problem is while creating pl/sql procedures, I need to make a cursor where the cursor definition has to be created dynamically {not in BEGIN block and it is not fixed}... So, can we add if condition in cursor definition statement or any other way to achieve it...
csetopper_bhanu
-
HI all, I am new to cursor and i have a doubt... I have one vb code in which few sql statements are written. I need to convert these sql codes into pl/sql sotred procedures. But, in vb, the sql query is dynamic on the basis of values passed like..
If Trim(txtEqpId) <> "" Then
Sql = Sql & vbCrLf & " AND c.eqpid LIKE '" & Trim(txtEqpId) & "%'"
End IfThis sql query is first generated and then it is being called from vb code. Now the problem is while creating pl/sql procedures, I need to make a cursor where the cursor definition has to be created dynamically {not in BEGIN block and it is not fixed}... So, can we add if condition in cursor definition statement or any other way to achieve it...
csetopper_bhanu