SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
null string compared with number and sql account status

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
null string compared with number and sql account status
Author Message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post null string compared with number and sql account status Reply with quote
hi, thanks in advance...

1. if i do this:

Code:
dim snull, string, ""
dim ssource, string, "12342"
dim bequal, boolean

isequal ssource,snull, bequal
ifthen bequal, theend1

theend1:


i will get "type mismatch". i was actually using gettoken to go through a line, and using "" to know that there are no more tokens. however, some of the tokens are numbers("12342") and some of them are strings("onefive"), and i run into this type mismatch problem.
is there a way around this?

2. roughly, how can i use JAL or the SQL statements functions in 24x7 to see if a sql account(mssql express) is locked?
Tue Mar 13, 2012 11:20 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Hi,

Data type declarations are a mostly legacy thing in JAL. When comparing 2 variables, it compares their actual values. To prevent issues with numeric values, before comparison prefix both values by some alpha symbol, for example,

Code:
Concat "x", snull, x_snull
Concat "x", ssource, x_ssource
isEqual x_snull, x_ssource, bequal
...

Wed Mar 14, 2012 12:24 am View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post thanks! Reply with quote
um..the other thing is i'd really like to be able to run, lets say,

SELECT LOGINPROPERTY('loginname', 'IsLocked')

and assign the result of that to a variable in JAL.

is it possible to do that?

Thanks again!
Wed Mar 14, 2012 2:45 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Do you mean a database command? It is sure possible

Code:
// connect to database
DatabaseConnect( ... profile_name_here... )
// run query
DatabaseRetrieve( "SELECT ...", rows )
// get the value of first row, first column
DatabaseGet( 1, 1, my_var )
// disconnect
DatabaseDisconnect( )

Wed Mar 14, 2012 8:09 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite 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.