Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLcl question, suggestion and feedback (its got fantastic features already!)

Gaz in OzAug 10 2015 — edited Aug 19 2015

Hi,

I've used sqlplus for a long time and love it. SQLcl is a fantastic tool also. I have a question, some suggestions and a possible enhancement:

Q> when editing within sqlcl, i.e. "ed" I get the following:

   Gaz@mydb SQL~> SELECT

     2

   Gaz@mydb SQL~> ed

   SP2-0223: No lines in SQL Buffer

   Gaz@mydb SQL~> l

     1* SELECT 'x' FROM dual

   Gaz@mydb SQL~>

      Is this cuz I have not set sqlcl up properly ("DEF _editor=vim" is how I setup my editor of choice, on Windows btw) The edited text is copied back into sqlcl, verified

      by {l}isting directly after saving and exiting the vim editor session

      ...but I get that error message

Suggestions>

. I read somewhere that SQLcl behavior would mimic sqlplus, where possible, practical, or I guess if it made sense. To this end, can the behavior be enhanced to

   o Allow for logins to mimic sqlplus, in the mixed order of user, password, connect string:

      i.e.. un/pwd@db and

            un@db/pwd

   o Not change directory to .../sqlcl/bin on startup, but keep the current directory, i.e. the directory i'm in when calling sqlcl - again, same behavior as sqlplus

   o allow access to system variables (for example, %DATE% %TIME% %TNS_ADMIN% etc for windows, $TNS_ADMIN, $ETC, etc for *NIX)

   o allow switching off enhanced command line editing, to mimic the old sqlplus way. This may already be possible but I don't know how

Enhancement>

. This applies to SQLcl, and SQLDeveloper I think as they both display the same results, and  may even use the same .jar...

   o SQLcl's info command shows only a maximum of the first four columns in an index. It would be great to have some sort of continuation notification to show

      when there are more than 4 columns. This is the query I believe does it, (lifted from v$sqlarea after running "info" in sqlcl):

select ind.index_owner||'.'||ind.index_name index_name,ind.uniqueness,

ind.status,ind.funcidx_status,

ind.columns,ie.column_expression

from (select index_owner,table_owner,index_name,uniqueness,

status,index_type,temporary, partitioned,funcidx_status, join_index,

max(decode(position,1 ,column_name))||

max(decode(position,2 ,', '||column_name))||

max(decode(position,3 ,', '||column_name))||

max(decode(position,4 ,', '||column_name)) columns

from(

select di.owner index_owner,dc.table_owner,dc.index_name,di.uniqueness,

di.status,

di.index_type, di.temporary,

di.partitioned,di.funcidx_status, di.join_index,

dc.column_name,dc.column_position position

from all_ind_columns dc,all_indexes di

where di.table_owner = :OBJECT_OWNER

and di.table_name  =  :OBJECT_NAME

and dc.index_name = di.index_name

and dc.index_owner = di.owner

) group by index_owner,table_owner,index_name,uniqueness, status,

index_type, temporary, partitioned,funcidx_status, join_index) ind,

ALL_IND_EXPRESSIONS ie

where ind.index_name = ie.index_name(+)

and ind.index_owner = ie.index_owner(+)


My possible enhancement is to change the blue "max(decode(" section above to this so it displays ,... if there are 5+ cols:

...

MAX(DECODE(position, 1, column_name))||

MAX(DECODE(position, 2, ', ' || column_name))||

MAX(DECODE(position, 3, ', ' || column_name))||

MAX(DECODE(position, 4, ', ' || column_name))||

MAX(DECODE(position, 5, ',... ')) columns

...

Thanks for these great database tools,

Gaz.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2015
Added on Aug 10 2015
0 comments
335 views