Here is what you need to code //--------------------------------- Dim(my_sql, string) ConcatEx("INSERT INTO JobLog VALUES(@V"job_id", '", ERR_MSG, "')", my_sql) DataseExecute(my_sql, sql_rows) //--------------------------------- : I am trying to insert a string Error message into : SQL Server but it doesn't seem to work. : blah, blah.... code : NOTIFY_ERR: DIM sql_rows, number : DIM ERR_MSG, string : GetLastError ERR_MSG : **good here i get the error i expect** : DatabaseConnect("MyDB") : ** still good ** : DataseExecute(INSERT INTO JobLog VALUES(@V"job_id", ERR_MSG)", : sql_rows) : ** no dice, i get the following error on ERR_MSG : when trying to insert ** : SQLSTATE = 37000 : [Microsoft][ODBC SQL Server Driver][SQL Server]The name 'ERR_MSG' is not : permitted : in this context. Only constants, expressions, or variables allowed here. : Column names are not permitted. : Question: How do I get this to recognize it as the string : error i expect, which is the error that brought me to this label : which was incorrect password (did this for testing).
|