|
Hi, Im using Oracle database and I cant find the solution for SELECT,UPDATE,DELETE,INSERT query to access the ORACLE tables using VARIABLE in C# . .
Im using this Code and it dosnt work? what should I need to do? I think there is something wrong in (cmd.Parameters.Add) when I do assign VARIABLES.
con.Open();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "INSERT INTO OUT_TEXT_NORM (KEY,LANG_ID,TEXT, PRIO) VALUES (:key,:lang_id,:text,:prio)";
cmd.Parameters.Add(":key", OracleDbType.Varchar2, 60).Value = key;
cmd.Parameters.Add(":lang_id", OracleDbType.Int32).Value = lang_id;
cmd.Parameters.Add(":text", OracleDbType.Varchar2, 4000).Value = text;
cmd.Parameters.Add(":prio", OracleDbType.Int32).Value = prio;
cmd.ExecuteNonQuery();
|
|
|
|
|
Are you getting an error of some type?
Can you explain what does not work.
|
|
|
|
|
It say's Invalid command for CMD
|
|
|
|
|
Try renaming the text-column; it's probably a reserved word.
|
|
|
|
|
Is there any other way in assinging variables?
|
|
|
|
|
Nope.
Still, I don't think the code is faulty; it's more likely to be the Sql command. A column named "TEXT" might be confusing to the parser.
|
|
|
|