D
Darth Ferret
This thing is about to drive me crazy. I have about 50 queries in the AS400
that I need to put on a menu. Once I conquer this I have a bunch more rpg
reports that I need to pass a date to. In the AS400 I have a stored
procedure (SPRUNQRY) that runs the RUNQRY command with the name of the query
as a parameter. In the AS400 I would type "RUNQRY SUNTR401A" on a command
line to run this query. My connection is opening, and I can run some reports
that do not have any parameters. My VB.net 2003 is:
'create command object
Dim cmd As New iDB2Command(" ", cn)
'setup the parameters
Dim cmdparm1 As New iDB2Parameter("cmdparm1", iDB2DbType.iDB2VarChar, 9)
cmdparm1.Value = "SUNTR401A"
cmdparm1.Direction = ParameterDirection.Output
cmd.Parameters.Add(cmdparm1)
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "{CALL hteusrj/sprunqry ( ? )}"
Try
cmd.ExecuteNonQuery()
Catch exc As iDB2Exception
MsgBox("execute did not work", MsgBoxStyle.OKOnly, "OK")
Exit Sub
End Try
This catches an error when it tries to execute the command The error says:
{IBM.Data.DB2.iSeries.iDB2SQLErrorException}
and also: message code -104 and message: "SQL0104 Token {was not valid.
Valid tokens : : <IDENTIFIER>."
I can't figure out exactly what it wants. I could sure use some help, I've
spun my wheels for several days on this.
Thanks in advance,
Joe in Florida
that I need to put on a menu. Once I conquer this I have a bunch more rpg
reports that I need to pass a date to. In the AS400 I have a stored
procedure (SPRUNQRY) that runs the RUNQRY command with the name of the query
as a parameter. In the AS400 I would type "RUNQRY SUNTR401A" on a command
line to run this query. My connection is opening, and I can run some reports
that do not have any parameters. My VB.net 2003 is:
'create command object
Dim cmd As New iDB2Command(" ", cn)
'setup the parameters
Dim cmdparm1 As New iDB2Parameter("cmdparm1", iDB2DbType.iDB2VarChar, 9)
cmdparm1.Value = "SUNTR401A"
cmdparm1.Direction = ParameterDirection.Output
cmd.Parameters.Add(cmdparm1)
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "{CALL hteusrj/sprunqry ( ? )}"
Try
cmd.ExecuteNonQuery()
Catch exc As iDB2Exception
MsgBox("execute did not work", MsgBoxStyle.OKOnly, "OK")
Exit Sub
End Try
This catches an error when it tries to execute the command The error says:
{IBM.Data.DB2.iSeries.iDB2SQLErrorException}
and also: message code -104 and message: "SQL0104 Token {was not valid.
Valid tokens : : <IDENTIFIER>."
I can't figure out exactly what it wants. I could sure use some help, I've
spun my wheels for several days on this.
Thanks in advance,
Joe in Florida