|
Post by ricardorix on Jul 9, 2021 8:36:31 GMT
I don't think fn_Global() is working properly:
If I do this:
SELECT dbo.fn_Global(8), dbo.fun_GetCfgDbl('global_08'), dbo.fun_GetCfgStr('global_08'), dbo.fn_Fibonacci(11)
I get
<empty_string>, 0.5000, <empty_string>, 144.000
|
|
|
Post by hutchie91 on Jul 9, 2021 9:49:39 GMT
|
|
|
Post by ricardorix on Jul 9, 2021 10:22:38 GMT
Yes the variable is already set to 0.5. I've tried all different variations of fn_Global(8) fn_Global(08) fn_Global('8') fn_Global('08')
they all don't work. The doc suggests an int, so I assume it should be fn_Global(8)
But looking into the sql function, it uses dbo.fun_GetCfgStr('global_08') which is why I think it doesn't work, whereas dbo.fun_GetCfgDbl('global_08') does work.
|
|
|
Post by Ipposnif on Jul 9, 2021 11:32:26 GMT
The easiest way to access a global value set in the Options is using the variable: @global_08so with a leading zero. In alternative you can access the same value with the SQL function: dbo.fn_Global(8)If SQL is new to you, I strongly advise you to read this article, written specifically for Ipposnif. ipposnif.freeforums.net/thread/148/ipposnif-sql-basics
|
|
|
Post by ricardorix on Jul 9, 2021 12:18:53 GMT
Please see the screenshot. imgur.com/a/kglibaeWhen you say access a variable, in which context? I am using VisualStudio. select @global_08 --returns an error.
|
|
|
Post by Ipposnif on Jul 9, 2021 12:44:52 GMT
Yes, you're right: there is a bug in function dbo.fn_global. Thanks for having found it, I will fix it in the next release.
Currently, you can get the value (only inside Ipposnif) using @global_08
or also: dbo.fun_GetCfgDbl('global_08')
you cannot use fun_GetCfgStr because global variables 1-8 can contain only numeric values.
|
|