[Gambas-user] SQLRequest (Q1 of 2)

bb adamnt42 at gmail.com
Fri Jul 2 21:42:31 CEST 2021


I am trying to create an SQLRequest with a literal instead of a column
name as in the following examples

SELECT 1 FROM "mytable";
SELECT 'ME' FROM "mytable";
SELECT 13579 AS seed;
SELECT 'Gambas' AS lang;

Constructs along the lines of
	Print hSQLRequest.Select(1).From("mytable").Get() & ";"
	Print hSQLRequest.Select("ME").From("notable").Get() & ";"
	Print hSQLRequest.Select(13579).Get() & ";"
	Print hSQLRequest.Select("Gambas").Get() & ";"
are just not getting there. (N.B. the above code are examples, not
algorithm.)

The outputs from those samples are 
SELECT "1" FROM "mytable";
SELECT "ME" FROM "notable";
----------------------------------------
ERR: No table specified (-1)
SQLRequest._call.125
SQLRequest.Get.112
----------------------------------------
ERR: No table specified (-1)
SQLRequest._call.125
SQLRequest.Get.112
FMain.Form_Open.29
----------------------------------------

All those SELECTs are valid SQL and commonly used for setting function
(or stored procedure) parameters.

Can SQLRequest do this type of stuff?

regards
bruce



More information about the User mailing list