0
votes

It's possible to get a Oracle APEX 5 item value inside SQL Developer ?

I know it'possible to use something like that:

SELECT * 
FROM apex_050100.wwv_flow_data d
inner join apex_050100.wwv_flow_sessions$ s on d.flow_instance = s.id;
where d.flow_instance = <session_id_from_url>;

But i want to use the V function:

select v('ITEM') FROM DUAL;

Or event better to set this item value like this:

APEX_UTIL.SET_SESSION_STATE (
    p_name     IN    VARCHAR2 DEFAULT NULL,
    p_value    IN    VARCHAR2 DEFAULT NULL);
1
Could you explain why you want to do this? - Dan McGhan
I have a function which use v('ITEM') and for debugging in SQL developer i need to hardcode this variable inside function every time. - nipuro
Is it a function or a query? - Dan McGhan
it's a function. - nipuro

1 Answers

1
votes

You should use bind variables instead of the v function. Rather than this:

select *
from table 
where column = v('PX_ITEM_NAME');

Do this instead:

select *
from table 
where column = :PX_ITEM_NAME;

This is safer (not vulnerable to SQL injection), more performant (avoids hard parses and uses shared cursors), and more convenient in that you can copy this over to SQL Developer.

When you run this in SQL Developer, you will be prompted for the values before the query is executed.