I use a result set to contain the query output instead of a data set. The reason that you are getting the error is because you are trying to pass a data set into the query string that requires a string value. Will the create table statement actually return a dataset? Var sqlstmt2 = “SELECT col1_bool, col1_float FROM \”public\”.\”All_datatypes\” WHERE col1_integer = ” + maxint ĭataset = conn.executeSnapshot(sqlstmt2) Var resultset = conn.executeQuery(sqlstmt1) Ī(“maxint: ” + maxint) Var sqlstmt1 = “SELECT max(col1_integer) FROM \”public\”.\”All_datatypes\”” This way you are just making one database call.Ģ) If you do want to do it in separate database calls, you can do something like: SELECT col1_bool, col1_float FROM “public”.”All_datatypes” WHERE col1_integer = (SELECT max(col1_integer) FROM “public”.”All_datatypes”) There are a couple approaches that you can use for this.ġ) You might be able to just combine the queries into one query like: Report.addDataSet( dataSet, dataSetSettings) Ī( report.renderHtml()) Query = "create table database_name.table_name stored as parquet as select * from database_name.table_name where mth=" + maxmth + "" ĭataSetSettings = () ĭtShowAltRowColor( false) Var maxmth = conn.executeSnapshot( query1) Query1 = 'select max(mth)-1 from database_name.table_name'
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |