on 2012 Jun 26 4:51 PM
Is there a way of finding out what connection level variables are available in a connection - or am I missing something obvious? (In the circumstances I am working with variables may have been created by events or login procedures that I am not aware of - of course I can test for the existance of a particular variable with if varexists(), but I was after a list).
AFAIK Currently there is no easy method to get a list of currently defined connection variables.
Of course the hard method would be to enumerate all possible names of variables and use varexists to see if each exists but that may take a very long time 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...the good part would be that during the check of the full namespace, at least one need not have to worry about connection-level variables being created or deleted in the interim - so the result would be deterministic and would not be affected by other connections:)
In case CREATE VARIABLE is logged in the transaction log (which I have not checked for), you might also be able to access that to analyse whether the current connection has executed such a statement. - That's a very cautious might: It seems like a real big hammer, would require according authority, and might not work (if at all) when logic is hidden within code...so I fear it might not be a solution:(
So this would sound like a reasonable enhancement request, Mark?
With around 1.15 x10^205 possibilities it's the "end of time arrives first" scenario that might outweigh the advantages 🙂 But then again it would get me out of cutting the grass / washing up etc for eternity, so .....
Still you wouldn't have to sigh "Oh, I have to start from scratch again"🙂
CREATE VARIABLE is no logged in the transaction log.... since there is no permanent database change caused by the statement.
Thanks for the clarification - I had thought that a variable could influence query results that might influence DML statements (in case it is used to filter rows, say, for an INSERT SELECT). But obviously, the TL would not log the query itself but the resulting operations, and so the variable is not needed for a "replay"/restore.
Yes, I'm still learning basic stuff:)
Later update
I have discovered that you can see them if use use the debugger in Sybase Central, in the bottom left-hand window - if you switch to the Global view
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Luckily I was able to sub-contract the job to some mice who operate in a parallel space-time continuum (dis-continuum??) who only wanted to be paid in cheese.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.