-
SELECT A.FIRMNBR
FROM TA_ALARM_D A, TA_RATE_D B
WHERE B.PRODUCTID = A.PRODUCTID
AND B.TRANSTYPE = A.TRANSTYPE
AND B.RATE || ( SELECT OPERATOR FROM TA_ALARM_D C
WHERE C.PRODUCTID = A.PRODUCTID
AND C.TRANSTYPE = A.TRANSTYPE ) || A.RATE
Hi,
In the above query, in the last condition of 'where clause', I want to pass some relational operators
(like '=','<','>' etc.) dynamically from a table column and then parse the main query to get the result records
from the outer main query.
How could i achieve this.
-
use 'execute immediate .... using ...' clause;
F.
-
Please be more specific
The query you have given me i am not able to understand
Does that work .There is no relational parameter
In GOD I find everything
-
Jeff Hunter
-
Try this hope this help U
declare
lv_input_str varchar2(100) := '>';
lv_input_sal number := 0;
lv_output_sal number;
begin
execute immediate 'select count(*) from emp where sal ' || lv_input_str || lv_input_sal INTO lv_output_sal;
--dbms_output.put_line('select count(*) from emp where sal ' || lv_input_str || lv_input_sal);
dbms_output.put_line('lv_output_sal >>>' || lv_output_sal);
end;
Cheers!
Cheers!
OraKid.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|