Old 16th September 2010, 14:39   #1
Grennvicted
Junior Member
 
Join Date: Sep 2010
Posts: 8
Returning a Variable throught SQL script

I want to check if a variable can returned so NSIS can read it. Like for example, i make an SQL script that looks if a certain DB exists and ouputs a variable for an NSIS script to read.
Grennvicted is offline   Reply With Quote
Old 16th September 2010, 15:36   #2
sgiusto
Member
 
Join Date: Mar 2007
Location: Italy
Posts: 99
Results of a query are read using the SQLGetRow function.
If you want to test the existence of a database you can execute a statement like this:
SQL_Execute "if exists (select name from sysdatabases where name='<name of db>') select 'TRUE' else SELECT 'FALSE'"
then you call SQL_GetRow
and then you pop from the stack the result value (TRUE or FALSE) in a nsis variable (pop $0).
Again this is showed in the example script provided with the plugin.
hope this helps
Stefano
sgiusto is offline   Reply With Quote
Old 18th September 2010, 17:45   #3
Grennvicted
Junior Member
 
Join Date: Sep 2010
Posts: 8
Thx, this forum is the best!
Grennvicted is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump