I am trying to insert a single record into a MariaDB table using the INSERT command. Each record has 25 columns, the first being auto-increment. I follow the general format of:
dim cn as SQL::Connection
dim args as SQL::Arguments
dim qry as c
dim cl as l
dim flag as l
dim a_1 as C = "2020-10-27"
dim a_2 as C = "2020-10-27"
dim a_3 as C = "V3"
.
.
dim a_23 as C = "V23"
dim a_24 as C = "V24"
cl = args.Clear()
args.add("a_1", a_1)
args.add("a_2", a_2)
args.add("a_3", a_3)
.
.
args.add("a_23", a_23)
args.add("a_24", a_24)
qry=<<%sql%
INSERT into table_data
VALUES(:arg_1,:arg_2,:arg_3,:arg_4,:arg_5,:arg_6,:arg_7,:arg_8,:arg_9,
:arg_10,:arg_11,:arg_12,:arg_13,:arg_14,:arg_15,:arg_16,:arg_17,:arg_18,
:arg_19,:arg_20,:arg_22,:arg_23,:arg_24)%sql%
'open connection
cn.open("{A5API=MariaDB,Server='',Port='3306',UserName='xxxx',Password='xxxx',database='main'}")
'
'Execute insert
flag = cn.Execute(qry,args)
"flag" returns false and I get the following error message: = "One or more argument values were referenced in the SQL query, but were not found in the argument list"
I have verified all arguments are being correctly assigned. The "qry" value is correct. The number of columns matches the query. The original query used the field names but for brevity I didn't show them here. Not specifying them is an option in MariaDB but the error is the same in both.
I'm using Alpha V12 Build 7086 - the most recent.
Any thoughts ?
dim cn as SQL::Connection
dim args as SQL::Arguments
dim qry as c
dim cl as l
dim flag as l
dim a_1 as C = "2020-10-27"
dim a_2 as C = "2020-10-27"
dim a_3 as C = "V3"
.
.
dim a_23 as C = "V23"
dim a_24 as C = "V24"
cl = args.Clear()
args.add("a_1", a_1)
args.add("a_2", a_2)
args.add("a_3", a_3)
.
.
args.add("a_23", a_23)
args.add("a_24", a_24)
qry=<<%sql%
INSERT into table_data
VALUES(:arg_1,:arg_2,:arg_3,:arg_4,:arg_5,:arg_6,:arg_7,:arg_8,:arg_9,
:arg_10,:arg_11,:arg_12,:arg_13,:arg_14,:arg_15,:arg_16,:arg_17,:arg_18,
:arg_19,:arg_20,:arg_22,:arg_23,:arg_24)%sql%
'open connection
cn.open("{A5API=MariaDB,Server='',Port='3306',UserName='xxxx',Password='xxxx',database='main'}")
'
'Execute insert
flag = cn.Execute(qry,args)
"flag" returns false and I get the following error message: = "One or more argument values were referenced in the SQL query, but were not found in the argument list"
I have verified all arguments are being correctly assigned. The "qry" value is correct. The number of columns matches the query. The original query used the field names but for brevity I didn't show them here. Not specifying them is an option in MariaDB but the error is the same in both.
I'm using Alpha V12 Build 7086 - the most recent.
Any thoughts ?
Comment