SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Built-in current

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Built-in current
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Built-in current Reply with quote
Is there a way to use the "built-in current " variables (or what they are) in snippets like those that are in DB Queries e.g. ":SCHEMA_NAME" in Objects(MySQL) or ":SCHEMA_ID" in Objects(MSSQL).
Wed Jun 16, 2010 8:19 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
No, they cannot be used in context-less code snippets, they are specific to context of executed queries for database catalog tables.

But you can use the same technique to populate the variables within code snippets, for example for T-SQL

$$
DECLARE @curr_schema SYSNAME
SET @curr_schema = SCHEMA_NAME()

SELECT ... FROM some_place WHERE SCHEMA_NAME = @curr_schema
$$
Wed Jun 16, 2010 8:43 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
I already accomplished that. I just have to build some snippets for MySQL I had done for MSSQL in the past. I was browsing the DB queries when I spotted these and I thought if there was a shorter path I'd like to try it. Thanks, anyway.
Wed Jun 16, 2010 9:11 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.