Skip to main content

Query-and-Return-All

Command Description

Execute Query SQL Statement, return to Query All Results SQL Statement placeholders: mysql, sqlserver, postgreSQL Using% S, SQLITE3 is used?, Oracle use: 1

Command Prototype

iRet = Database.QueryAll(objDatabase ,sql ,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objDatabaseTrueexpressionobjDatabaseDatabase object, a database object created using the Create Database Object command (Database.CreateDB)
sqlTruestring""Query SQL statement
rdictNonebooleanNoneWhether to return a dictionary
argsNoneexpression[]SQL statement parameter, SQL statement placeholder. MySQL and SQLServer is %s, Sqlite3 is ?, and Oracle is :1

return

iRet,The variable used to save the output of the command.

Demo

sql = "select * from test" 
iRet = Database.QueryAll(objDatabase ,sql)
TracePrint(iRet)

// [[1,2,3], [4,5,6]]