Я хочу добавить таблицу ответов, но вижу ошибку вроде «Oracle.DataAccess.Client.OracleException (0x80004005): ORA-01722: недопустимый номер»
DateTime localDate = DateTime.Now;
var culture = new CultureInfo("ru-RU");
var datenow = localDate.ToString(culture);
string[] splitdatenow = datenow.Split(' ');
cnn.Open();
OracleCommand cmdu = cnn.CreateCommand();
cmdu.CommandText = "INSERT INTO ANSWER (EXPLAIN,STATUS,USERID,QUESTIONID,CREATEDATE,MEDIA) VALUES (:comment_forms,'T',(SELECT ID FROM USERS WHERE MAIL=:mailSession) ,:send,:datef,:uploadf)";
cmdu.CommandType = CommandType.Text;
cmdu.Parameters.Add(new OracleParameter(":send",OracleDbType.Int32));
cmdu.Parameters.Add(new OracleParameter(":comment_forms", comment_form));
cmdu.Parameters.Add(new OracleParameter(":datef", splitdatenow[0]));
cmdu.Parameters.Add(new OracleParameter(":uploadf", upload_form));
cmdu.Parameters[":gelenid"].Value = gel;
cmdu.Parameters.Add(new OracleParameter(":mailSession",mailSession));
try
{
cmdu.ExecuteNonQuery();
}
catch(Exception ex)
{
Response.Write(ex);
}
cnn.Close();
Триггер для автоинкремента
create or replace
trigger ANSWERIDTRIGGER
BEFORE INSERT ON ANSWER
FOR EACH ROW
BEGIN
select ANSWERIDSEQ.nextval
into :new.ID
from dual;
END;