Archive: Returning a Variable throught SQL script


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.


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


Thx, this forum is the best!