1 Reply Latest reply on Nov 26, 2012 3:55 PM by Mike Jones

    How to use the Sql executeSqlCommand blcli command

      Hi All,

       

      I'm using Blade Logic version 8.2.02.321.

       

      I need to write an NSH script that will run an SQL query against a database and use the return value.

       

      I found the command "executeSqlCommand" in the unreleased BLCLI commands under the Sql namespace.

       

      Can this command return a value?

       

      Thanks,

      Eyal

        • 1. Re: How to use the Sql executeSqlCommand blcli command
          Mike Jones

          Eyal,

           

          The SQL namespace is for the BladeLogic database only

           

          So you can use this to execute SQL statements on the BladeLogic database for example (It returns the output in xml format)

           

          blcli_execute Sql executeSqlCommand "select value from system_property where name = 'DatabaseVersion'"

           

          I think what you want to do is use NSH to nexec the SQL command line utilities for the paticular database you want to query. e.g. sqlcmd