StrataFrame Forum

Issue Adding A New Record To An Oracle 10g Database

http://forum.strataframe.net/Topic10921.aspx

By Jared Ewald - 8/17/2007

Hello. I'm trying to add a new record to a business object and then save it to an Oracle 10g database. However, when I attempt to save the new record to the database I get the following error: "ORA-00936: missing expression" (which signals a bad SQL statement).



Here is the stack trace:



at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)

at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)

at System.Data.OracleClient.OracleCommand.ExecuteScalarInternal(Boolean needCLStype, Boolean needRowid, OciRowidDescriptor& rowidDescriptor)

at System.Data.OracleClient.OracleCommand.ExecuteScalar()

at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteScalar(DbCommand Command, Boolean IsTransactional, String TransactionKey)

at MicroFour.StrataFrame.Data.OracleDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)

at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)

at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Business.BusinessLayer.Save()

at [Project].[Save button clicked event](Object sender, EventArgs e) in

[Path]

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



Any suggestions?



Thanks,



Jared
By Trent L. Taylor - 8/17/2007

Whenever you have an issue saving anything, the best thing to do is to first turn on debugging on your data source.  This will show you everything about the command including the connection, parms, etc.  To turn on debugging for a data source, open the AppMain.vb or program.cs file, where you more than likely have your data sources defined, and add the following code after your data sources have been created (either the DataBasics.DataSOurces.Add(...) or the SetConnections() method if you are using the Connection String WIzard).

Databasics.DataSources("").SetDebugOn("c:\MyDebugFile.html",True)
By Jared Ewald - 8/17/2007

Thanks for the help! The debug information showed that it was trying to get an autoincrement value from the database (which did not exist). All I had to do was to turn autoincrement off in the business object properties.



Thanks again!
By Trent L. Taylor - 8/17/2007

No problem Smile  Glad you got it going!