can i do something sql="select * from table1 ; Select * from table2"
in only one ExecQuery?
(like vb60, vb.net, php and other)
Multi - Recordset/ResultSet
B4X:
Dim Cursor As JdbcResultSet
Cursor = SQL1.ExecQuery("SELECT col1, col2 FROM table1")
Do While Cursor.NextRow
Log(Cursor.GetString("col1"))
Log(Cursor.GetInt("col2"))
Loop
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Cursor = SQL1.ExecQuery("SELECT 'table1' AS tbl, col1, col2 FROM table1 UNION SELECT 'table2' AS tbl, col1, col2 FROM table2")
Do While Cursor.NextRow
Log(Cursor.GetString("tbl"))
Log(Cursor.GetString("col1"))
Log(Cursor.GetInt("col2"))
Loop
I already assumed not, but the truth is that it is something that I have discovered that can be done recently (and look, I have been doing this for years) in other languages, even vb60 with recordset!! And just in case, I asked.
Thanks for the response.