SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Auto-complete table and field names uppercase
Goto page 1, 2, 3  Next
 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Auto-complete table and field names uppercase
Author Message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Auto-complete table and field names uppercase Reply with quote
Hi,

It's clear enough, how to automatically set the keywords to upper-case, if needed.

But is there a way to generate tables and fields names to uppercase? So that, if I type in a schema name and a '.', it will pop up and paste UPPERCASE table names, into UltraEdit or PlSql Developer?
Wed Jun 19, 2013 8:18 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 846
Country: United States

Post Reply with quote
I would imagine if you changed the object + typed synonym query under db options->db queries and find the right one (oracle in your case?) and use the UPPER() function to return o.object_name in uppercase might do it.

When I do this on the object+typed synonym query for MSSQL it does what you want (uppercase table names).

Likewise you'd have to modify the queries that return columns. (columns query)
Wed Jun 19, 2013 9:28 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
I see you're becoming advanced user, Mindflux. Nice :)
Wed Jun 19, 2013 9:49 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 846
Country: United States

Post Reply with quote
gemisigo wrote:
I see you're becoming advanced user, Mindflux. Nice :)


I like to think I catch on quick.
Wed Jun 19, 2013 9:56 am View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
Been searching around through the Options, and cannot find out where to type in an Upper function. If I select Db Options/DB Queries/Query "Synonyms", it says

Synonyms (Oracle)

, and doesn't allow me to change this string.

I'm probably not understanding precisely where the UPPER entry should be made.


Mindflux wrote:
I would imagine if you changed the object + typed synonym query under db options->db queries and find the right one (oracle in your case?) and use the UPPER() function to return o.object_name in uppercase might do it.

When I do this on the object+typed synonym query for MSSQL it does what you want (uppercase table names).

Likewise you'd have to modify the queries that return columns. (columns query)

Mon Jun 24, 2013 8:55 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
Mindflux was referring to DB Options > DB Queries > Objects (Oracle) + Typed Synonyms, which is
Code:

select
   o.object_name,
   decode(o.object_type, 'SYNONYM', decode(o.owner,'PUBLIC', '|', '^') || 
      decode(o2.object_type, 'PACKAGE', 'C', 'SEQUENCE', 'I', 'TYPE', 'K', substr(o2.object_type,1,1)),
      substr(o.object_type,1,2)) object_type,
   o.created,
   o.last_ddl_time
from
   all_objects o
left join all_synonyms s ON s.owner = o.owner AND s.synonym_name = o.object_name
left join all_objects o2 ON o2.owner = s.table_owner AND o2.object_name = s.table_name
where
    o.owner in (:SCHEMA_NAME,'PUBLIC')
and o.object_type in (
   'TABLE','VIEW',
   'PROCEDURE','FUNCTION','PACKAGE','TYPE',
   'MATERIALIZED VIEW','MATERIALIZED VIEW LOG',
   'SEQUENCE', 'SYNONYM'
   )
and (o2.object_type is null or o2.object_type in (
   'TABLE','VIEW',
   'PROCEDURE','FUNCTION','PACKAGE','TYPE',
   'MATERIALIZED VIEW','MATERIALIZED VIEW LOG',
   'SEQUENCE', 'SYNONYM'))
and o.object_name not like 'bin$%'
and o.object_name not like 'BIN$%'
and o.object_name not like '%/%'
order by o.object_name

for Oracle on my machine. And you don't want to change the string (which is a plain name for the query) but the Query Text.

You should modify it to convert retrieved object name to uppercase, that is, to:
Code:

select
   upper(o.object_name),
   decode(o.object_type, 'SYNONYM', decode(o.owner,'PUBLIC', '|', '^') || 
      decode(o2.object_type, 'PACKAGE', 'C', 'SEQUENCE', 'I', 'TYPE', 'K', substr(o2.object_type,1,1)),
      substr(o.object_type,1,2)) object_type,
   o.created,
   o.last_ddl_time
from
   all_objects o
left join all_synonyms s ON s.owner = o.owner AND s.synonym_name = o.object_name
left join all_objects o2 ON o2.owner = s.table_owner AND o2.object_name = s.table_name
where
    o.owner in (:SCHEMA_NAME,'PUBLIC')
and o.object_type in (
   'TABLE','VIEW',
   'PROCEDURE','FUNCTION','PACKAGE','TYPE',
   'MATERIALIZED VIEW','MATERIALIZED VIEW LOG',
   'SEQUENCE', 'SYNONYM'
   )
and (o2.object_type is null or o2.object_type in (
   'TABLE','VIEW',
   'PROCEDURE','FUNCTION','PACKAGE','TYPE',
   'MATERIALIZED VIEW','MATERIALIZED VIEW LOG',
   'SEQUENCE', 'SYNONYM'))
and o.object_name not like 'bin$%'
and o.object_name not like 'BIN$%'
and o.object_name not like '%/%'
order by o.object_name

if I recall correctly. You should apply similar modifications to DB Options > Columns (Oracle) and/or Columns (Oracle) + Keys. This one is for Oracle, you'll have to modify the DB Query that you need, of course, but the principle will be the same.
Mon Jun 24, 2013 9:18 am View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
Ok, thanks gem and Mindflux.
Tue Jul 02, 2013 1:33 pm View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
Never did get this to work, by the way.

For example, in Columns (Oracle), this

select
upper(column_name),
data_type....

still produces lower case column names, in UltraEdit/UEStudio.


To test that the changes are being read, this


select
'what the',
upper(column_name),
data_type....


generates the expected 'what the' in the picklist. But the column list is all lower case.


Ultraedit edit has it's own 'convert highlighted string to uppercase', so that can be used in the meantime.


Notepad, by the way, doesn't seem to get supported at all, even though it's checked off in Options. No picklist, no sql assistance support at all, even if a hot key is pressed.

Notepad++ does work. But, same problem as with Ultraedit. No uppercase field names are possible. Similarly, for table names.



I'm using Sql Assistant 6.5.278 pro, Windows 7, Oracle 11g.
Wed Apr 02, 2014 10:28 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
Please change "Columns (Oracle) + Keys" query, "Columns (Oracle)" is a spare query, which is used only if you configure SQL Assistant not to use the Columns+Key query, in case you experience significant performance issues with querying Oracle system catalog tables and want to minimize the number of catalog tables involved.

Hope this helps.
Wed Apr 02, 2014 10:46 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
Sorry, forgot the notepad reference. IMost likely it doesn't work because you start 64-bit version of notepad. SQL Assistant doesn't currently support 64-bit applications. Almost all development tools on the market are 32-bit tools because of the need to support different Windows flavors and versions. 32-bit apps run just fine on 64-bit systems, but not the other way around.
Wed Apr 02, 2014 10:48 am View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
SysOp wrote:
Please change "Columns (Oracle) + Keys" query, "Columns (Oracle)" is a spare query, which is used only if you configure SQL Assistant not to use the Columns+Key query, in case you experience significant performance issues with querying Oracle system catalog tables and want to minimize the number of catalog tables involved.

Hope this helps.


They are both modified, the keys version and the bare version. However, it is clear that the bare version is being used, even though the check box is unchecked.

If I throw 'WHAT THE' into the + keys query, and 'what the' into the spare query, it's 'what the' that is returned.

Where do you select which type of query should be used?
Wed Apr 02, 2014 11:40 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
Quote:
Where do you select which type of query should be used?


"DB Options" tab -> select "Oracle" as the SQL Assistance type -> Expand "DB Queries" section on the right side -> See or change Query "Columns" option.
Wed Apr 02, 2014 1:12 pm View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
SysOp wrote:
Quote:
Where do you select which type of query should be used?


"DB Options" tab -> select "Oracle" as the SQL Assistance type -> Expand "DB Queries" section on the right side -> See or change Query "Columns" option.


I think I'm asking the question wrong.


I've already been in DB/Options/DB Queries, and changed both Columns (Oracle) (I call it the bare version), and Columns (Oracle)+Keys.

Right now, the Query Text in

Columns (Oracle)

is unchecked. It has no extra 'what the' string, just starts with

select
upper(column_name),
data_type
|| decode(data_type,...


The Query Text in

Columns (Oracle) + Keys

is checked. It starts with

select
'WHAT THE',
UPPER(column_name),
data_type
|| decode(data_type,...


- but, when UltraEdit is open, and a SELECT takes place, the columns show up in lowercase, without any 'what the', which seems to indicate that it's using the bare Columns (Oracle), even though it's unchecked.


If I change the Columns Oracle to


select
'WHO DAT?',
upper(column_name),
data_type

, even though it's not checked, a LOWERCASE

'who dat'


is what appears. NOT the uppercase version which is defined in Columns Oracle; and NOT the 'WHAT THE' version that's defined in Columns Oracle + keys.



I don't know how else to describe this, without print screens. Why is SQL Assistant using a choice, which is unchecked? And why does it keep converting field references to lowercase?

Is it possible for someone, who has access to Ultra Edit or UE Studio and Oracle 11g, to actually try and replicate this?
Wed Apr 02, 2014 1:37 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
Instead of check boxes, please the drop down lists tor changing which query to use. The check boxes there are for a different purpose.
Wed Apr 02, 2014 4:00 pm View user's profile Send private message
SqlExplorer



Joined: 18 Sep 2011
Posts: 124
Country: United States

Post Reply with quote
SysOp wrote:
Instead of check boxes, please the drop down lists tor changing which query to use. The check boxes there are for a different purpose.


Sysop,

Yes, that makes sense, that's what I was originally looking for. But I"m completely lost here. What drop down list, are you talking about?

Are you talking about the Query Type drop down

DB Type
Minimum Version

Query Type <----> THIS ONE?

Query Text



Sorry to be so dense, and yes I feel like an idiot, but honestly can't locate any place where you can specifically select the DB Query option that should be used.




[/img]
Wed Apr 02, 2014 4:59 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.