SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[9.2.349 Pro] - Aliases

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[9.2.349 Pro] - Aliases
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post [9.2.349 Pro] - Aliases Reply with quote
There's an option in SA - Options > SQL Assistance > Aliases called Custom Aliases. It can be set to either Regular names or Regular expressions. I've found nothing in the help regarding those. What do they do?

Also, there's something fishy with auto adding aliases. It's supposed to automatically add a number to the alias in case there's already one with exactly the same name. But it does not always work.
First I added an INNER JOIN to the original table the ertekesites.v_eladas_tetelek view references. I have v_ in Ignore Name Prefixes, so it would have two ets in the statement but auto-numbering kicked in and I got et2.
After that I added a self join to the ertekesites.v_eladas_tetelek view, which would also get et as alias when alone due to Ignore Name Prefixes, and it too, got et2. But when I tried another table in another schema (volan.eladas_tetel) that got the same et alias, it wasn't renamed.

Check this short video here.
Tue Sep 05, 2017 4:36 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Reply with quote
About use of custom aliases, consider having a table named AbraCodabraAccountPayablesFin which you often reference in the code. If you let the application auto-generate an alias for that one, it would come out as acapf. But in your code for accounts payable transactions you may simply refer to it as AP. You can use the custom aliases property to specify fixed aliases like AP.

The property is a two column table in object name field [ TAB] alias field format. The alias field can be a static text like AP in my example above, or a regular expression using regex replace syntax
Wed Sep 06, 2017 11:17 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Reply with quote
The Custom Alias sounds interesting. Can on use regular expression for object name as well? Also, does auto-numbering apply to created alias in case of conflict?
Thu Sep 07, 2017 3:41 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Reply with quote
Quote:
Can on use regular expression for object name as well?

Yes, it's kind of a replace regex expression that you can use to calculate the alias from the name. I don't know if it can automatically add numbers to repeating aliases in this case, and in case of predefined aliases, it's a grey undocumented area.
Fri Sep 08, 2017 10:09 am 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
Page 1 of 1

 
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.