 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
Built-in current |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
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 |
|
 |
|
|
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
|
|
|