Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

SQL Code - still fault ...

$
0
0

Hi,

I am still working on a sql code, but i only get no good answer from the code./sql view.

The view is still simple, have a look.

 

A     B     C     D

Te     DA     TX     DX

Si     dd     AS     BB

 

The goal is to create from this view a multiple array.

 

Error:

When getString("A") : cannot find column with this name

When getString("Te"): Te not found in this colum.

 

var myJDBCConnection = new JDBCConnection() ;

try {

var connect = myJDBCConnection.getConnection(SQLConnection , SQLUser , SQLPW);

System.log("Connecting to database");

var statement = connect.prepareStatement("SELECT * from x");

    if (statement.execute() == true) {

        var Statementresult = statement.executeQuery();

        var x = Statementresult.getMetaData();

        var columncount = x.getColumnCount();

        for(var i=1; i <= columncount;i++)

        {

            columName = x.getColumnName(i);

            var finished = Statementresult.getString(columName);

            System.log(finished);

        }

        //System.log(x.getColumnName(3))

    }

    else{

        System.log("Nothing found by this View.");

    }

}

catch(err) {

    throw err;

}


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>