Oracle ORA-00911 Problem Solving

Source: Internet
Author: User

Writing SQL statements

 using(OracleConnection conn =NewOracleConnection (oraclestring)) {Conn.                Open (); vartrans =Conn.                BeginTransaction (); stringstrSQL ="INSERT INTO Myjyyzj_print (Storecode,cls,num,line,fildate,content,stat,lstupdtime) VALUES (: Storecode,:cls,:num ,: line,:fildate,:content,:stat,:lstupdtime);"; Try                {                     for(inti =0; I < contents. Count; i++) {oraclecommand com=NewOracleCommand (); List<OracleParameter> Pars =NewList<oracleparameter>()                            {                                                                NewOracleParameter ("Storecode", Storecode),NewOracleParameter ("CLS", title),//1                                NewOracleParameter ("NUM", Printnum),//2                                NewOracleParameter (" Line", i +1),//3                                NewOracleParameter ("fildate", DateTime.Now),//4                                NewOracleParameter ("CONTENT", Contents[i]),//5                                NewOracleParameter ("STAT",Ten),//6                                NewOracleParameter ("Lstupdtime", DateTime.Now)//7                            }; PrepareCommand (COM, conn, trans, CommandType.Text, strSQL, pars.                        ToArray ()); if(COM. ExecuteNonQuery () <=0)                            Throw NewTangjiubusinessexception ("Insert Error"); Com.                    Parameters.clear ();                    } trans.commit (); return true;

Always reported the exception error message is ORA-00911 invalid character and then searched for a lot of results and said the end of the SQL statement more than a semicolon (";") The reason for holding a try to remove all normal after the mentality

The strange plsql also does not have the error.

Tossing the whole morning, without words!!

Oracle ORA-00911 Problem Solving

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.