I’ve got this Oracle query that links to another db but it doesn’t seem to accept my parameters that i pass to the query
Here’s my code
cmd.CommandText = "SELECT * FROM table1@dev tb1 join table2 tb2 on tb1.id = tb2.id WHERE tb1.id = :id"
cmd.CommandType = CommandType.Text
cmd.BindByName = True
cmd.Parameters.Add(New OracleParameter("id", id))
I get this error when do this
ORA-03113: end-of-file on communication channel
But if i simply change the query to not be using parameters then it works
Any ideas on how I could get this working with parameters?
EDIT
On further investigation if I try the following
cmd.CommandText = "SELECT * FROM table1@dev tb1 WHERE tb1.id = :id"
cmd.CommandType = CommandType.Text
cmd.BindByName = True
cmd.Parameters.Add(New OracleParameter("id", id))
I get a different error
ORA-28511: lost RPC connection to heterogeneous remote agent
I would really like a solution which allows parameters to be passed to the linked db but I can’t seem to find anything about using parameters with linked db’s
Thanks
ORA-03113is a generic exception, hurled when something catastrophic causes the connection to drop. There may be some additional information in the alert log or a trace file. Check the background dump or diagnostics directory.ORA-28511is rather more specific. The error message points to a particular area for investigation; the advice is “Check for network problems and remote host crashes. The problem is probably in the agent software. “So, it’s not really a syntax problem. It’s an environment (configuration/hardware) issue. I’m afraid you’re going to have to do a some more digging.
Good luck.