I am testing a simple query to get data from an AS400 database. I am not sure if the way I am using the SQL query is correct.
I get an error: "The parameter is incorrect."
Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = @Field1
I don't get an error when I run the following query:
Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = 'myvalue'
I am using ADODB, VBScript to test.
Set Param1 = cmd.CreateParameter("@Field1", 129, 1, 9, "myvalue") ' 129 String
cmd.Parameters.Append Param1
I am coming from MS Sql environment, so writing for AS400 is totally new for me.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…