Hi,
I would like to create a template or macro where the outcome of the procedure that I will write is the value of the column of a table in my DB.
Is it possible?
Like $OSUSER, $DATE,... that write a value and not the string "$DATE"
If you use my template plugin (download fromhttp://bar-solutions.com) you can create templates with substitution variables:
'$OSUSER' => The name of the Operating System user.
'$DBUSER' => The name of the database user that is currently logged on.
'$DATE' => The current date.
'$TIME' => The current time.
'$CLIPBOARD' => Clipboard text.
These variables already exist in pl / sql developer, except $CLIPBOARD.
It is not useful to retrieve the contents of the tables.
I need something like "Query variables":
[$QUERY seq_query =
select lower(object_name) from user_objects
where object_type = 'SEQUENCE'
order by object_name]
select [Sequence=$seq_query,...].nextval into [Variable name] from dual;
The Sequence variable is a suggestion list, because the query is followed by ",...", implying that other values can be entered manually by the user. Query results can simply be viewed as comma separated lists of values. How???
I'm not quite sure what you mean, but in version 11.0 this might be possible. Templates have switched to the substitution variable syntax (old syntax still supported), so you can do things like this:
Code:
-- Created on &<name="Created"
hidden="yes"
default="select systimestamp from dual">
declare
-- Local variables here
i integer;
begin
-- Test statements here
[#]
end;
This example will insert the systimestamp value into the text resulting from this template:
Code:
-- Created on 04-DEC-14 12.52.18.772000 PM +01:00
declare
-- Local variables here
i integer;
begin
-- Test statements here
|
end;
&<name="Table"
type="string">
&<name="Index"
list = "Select c.column_name, c.index_name
from dba_indexes t, dba_ind_columns c
where t.table_name = upper(:Table)
and t.index_name = c.index_name
and t.uniqueness = 'UNIQUE'"
multiselect = "yes">
1) default doesn't accept bind variable yet:
& => not all variables are bound :tst1
2) Text depending on non empty variable only possible with old method, f.i.:
function delete_ok
( p_[pk_colnam] [datatyp][+pk_colnam2="
, p_"][pk_colnam2] [datatyp2][+pk_colnam3="
, p_"][pk_colnam3] [datatyp3]
) return boolean;
Weak alternative (using suffix): &
(not possible in multiple locations...)
3) $CLIPBOARD would be nice to have