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
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objDatabase | True | expression | objDatabase | Database object, a database object created using the Create Database Object command (Database.CreateDB) |
sql | True | string | "" | Query SQL statement |
rdict | None | boolean | None | Whether to return a dictionary |
args | None | expression | [] | 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]]