ORA-00439: feature not enabled: RETURNING clause from this client type

I'm trying to do an insert statement and return a value and I get this error. Any ideas. Below is code:

  

OleDbCommand cmd = new OleDbCommand(
	"INSERT INTO FMS_TRACKING_REMARKS(K002, ENTRY_DT, CASE, COUNTRY_CD, REMARKS, LAST_UPD_UID, LAST_UPD_DT, RMK_FLAG) VALUES(?, ?, ?, ?, ?, ?, ?, ?) RETURNING SEQ INTO ?", cn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@RETURN_VAL", OleDbType.Integer).Direction = ParameterDirection.Output;
cmd.Parameters.Add("@K002", OleDbType.VarChar).Value = obj.K002;
cmd.Parameters.Add("@ENTRY_DT", OleDbType.Date).Value = obj.ENTRY_DT;
cmd.Parameters.Add("@CASE", OleDbType.VarChar).Value = obj.CASEX;
cmd.Parameters.Add("@COUNTRY_CD", OleDbType.VarChar).Value = obj.COUNTRY_CD;
cmd.Parameters.Add("@REMARKS", OleDbType.VarChar).Value = obj.REMARKS;
cmd.Parameters.Add("@LAST_UPD_UID", OleDbType.VarChar).Value = obj.LAST_UPD_UID;
cmd.Parameters.Add("@LAST_UPD_DT", OleDbType.Date).Value = obj.LAST_UPD_DT.Value;
cmd.Parameters.Add("@RMK_FLAG", OleDbType.Decimal).Value = obj.RMK_FLAG.Value;
cn.Open();
cmd.ExecuteNonQuery();
return (decimal)cmd.Parameters["RETURN_VAL"].Value;
 
0
fattymc03
5/1/2009 11:57:27 AM
asp.net.oracle 2269 articles. 0 followers. Follow

5 Replies
702 Views

Similar Articles

[PageSpeed] 18

you should not give the query here,

you ahould create stored procedure

OleDbCommand cmd = new OleDbCommand("storedprocedure",cn);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add("@RETURN_VAL", OleDbType.Integer).Direction = ParameterDirection.Output;

cmd.Parameters.Add("@K002", OleDbType.VarChar).Value = obj.K002;

cmd.Parameters.Add("@ENTRY_DT", OleDbType.Date).Value = obj.ENTRY_DT;

cmd.Parameters.Add("@CASE", OleDbType.VarChar).Value = obj.CASEX;

cmd.Parameters.Add("@COUNTRY_CD", OleDbType.VarChar).Value = obj.COUNTRY_CD;

cmd.Parameters.Add("@REMARKS", OleDbType.VarChar).Value = obj.REMARKS;

cmd.Parameters.Add("@LAST_UPD_UID", OleDbType.VarChar).Value = obj.LAST_UPD_UID;

cmd.Parameters.Add("@LAST_UPD_DT", OleDbType.Date).Value = obj.LAST_UPD_DT.Value;

cmd.Parameters.Add("@RMK_FLAG", OleDbType.Decimal).Value = obj.RMK_FLAG.Value;

cn.Open();

cmd.ExecuteNonQuery();

return (decimal)cmd.Parameters["RETURN_VAL"].Value;

0
kapilbharat
5/1/2009 12:20:19 PM
I am unable to create stored procedures on the system I am on now and must use dynamic created sql. Do you have any solutions?
0
fattymc03
5/1/2009 12:28:55 PM

You should not return a value like that. For 'Insert', it's enough by running 'ExecuteNonQuery()'.


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
0
wmec
5/4/2009 3:28:45 AM
The insert statement returns a autogenerated primary key from a sequence. I need to get the value of the record that was returned. It's a standard way to get the object you created with an autonumber primary key. I've done it fine in SQL Server, but having trouble figuring out how to do it in oracle.
0
fattymc03
5/4/2009 11:20:10 AM

If you want to have that value, you can call a reader like this 

                conn.Open();

                OracleCommand cmd = new OracleCommand("SELECT max(id) FROM tab_a", conn);
                OracleDataReader sdr = cmd.ExecuteReader();
                ret_val = Convert.ToInt32(cmd.ExecuteScalar());

 


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
0
wmec
5/5/2009 2:41:31 AM
Reply:

Similar Artilces:

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

Do I need to install both oracle 7.3 and oracle 8 clients to work my PB applications some with ora 7.3 and some ora 8?
Hi, My PB5 application uses Oracle 7.3 and PB8 applications uses oracle 8i. Do I need to install both Oracle 7.3 and Oracle 8 clients to deploy my PB 5 and PB 8 application. Please comment Thanks Mulinti I've answered this elsewhere. -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. SDN: http://www.sybase.com/developer/ http://www.pb9books.com <Mulinti> wrote in message news:D3D0347141F544BB0059FE7585256CBD.0059FE8585256CBD@webforums... > Hi, > > My PB5 application uses Oracle 7.3 and PB8 applications uses oracle 8i....

Oracle ODP.net mulitple Oracle Client
To connect to the oracle database using ODP.net, the applicate must add the dll file called Oracle.DataAccess. There are a lot of version of Oracle.DataAccess. As I know, if the client use Oracle Client 10g Release 2. If the client use Oracle Client 10g Release 2, the application also have to use the Oracle.DataAccess the come from Oracle Client 10g Release 2.  My question is that there are any method to add more than one Oracle.DataAccess version in my product to support multiple OracleClient.   That should automatically happen for the most part.  Oracle's ODP.NET i...

Choosing Oracle Client Version with Microsoft Managed Oracle Provider For .net
We need to change the Oracle Client that the System.Data.OracleClient uses to connect to our database on a server that has multiple versions of the Oracle Client. A different application on the server that we do not have control over is requiring the default ORACLE_HOME directory to remain an older Oracle 9i version of the client. Because of this, our applications using the Managed Oracle Provider for .net are using the 9i client to connect. We have a planned Oracle upgrade for our Database that will require us to use the new 10g version of the client that is also installed on the server, bu...

How call a Oracle Function using Microsoft .Net Oracle Client (System.Data.OracleClient)?
I try to call Oracle Function in .net C# by using System.Data.OracleClient. But i am not successful. Here is my code FUNCTION TTHAO_MONTT_EXISTS ( vten varchar2) RETURN boolean IS ret boolean; montt_id integer; BEGIN ret:=false; montt_id:= -1; select monthethao_id into montt_id from TTHAO_MONTHETHAO where ten = vten; if montt_id!=-1 then ret:=true; end if; return ret; Exception when others then return false; END; I do not know, when I call function TTHAO_MONTT_E...

Oracle.DataAccess.Client.OracleException: ORA-03113:end-of-file on communication channel in Oracle 10g
ORA-03113: end-of-file on communication channel Exception details: Oracle.DataAccess.Client.OracleException: ORA-03113:end-of-file on communication channel  My database is Oracle 10g, I am using .NET Framework 3.5 with Visual Studio 2008.  It happened only once when first time in the morning I open my URL in my test server then this error popup at very first page of my site. Next time onwars it work perfectly fine.  Any Idea friends, Have you face the similar error, please tell me in details. Thanks, Vivek   vivek_cs:ORA-03113 This is a generic error. This a...

Oracle Error: Unable to cast object of type Oracle.DataAccess.Types.OracleDate to type System.IConvertible
I'm getting the following error when I try to convert an OracleParameter Date field to a .net Datetime field.{"Unable to cast object of type 'Oracle.DataAccess.Types.OracleDate' to type 'System.IConvertible'."} System.InvalidCastException.I've included snipets of the code.  The stored procedure it calls is working OK. I can bind it to a gridview without a problem.  What I can't do it take the return value and convert it into a .net DateTime field. I tried to convert it to a string but that only returns the date portion of th...

PB10 Oracle client 8 and Oracle client 9
I recently migrate our apps from PB9 to PB10. Most of our users have oracle client 8 installed, some have oracle client 9. PCs with oracle 9 client can access our oracle db fine. PCs with oracle 8 client cannot. Datawindows cannot do a simple retrieve! Any help is appriciated! Thanks! HD First thing you want to do is post over in the powerbuilder.connectivity or powerbuilder.database section. This is the PBNI section, which doesn't have anything to do with connectivity to a particular database. "HD" <hdoan@umn.edu> wrote in message news:434e9ad...

PB10 Oracle client 8 and oracle client 9
I recently migrate our apps from PB9 to PB10. Most of our users have oracle client 8 installed, some have oracle client 9. PCs with oracle 9 client can access our oracle db fine. PCs with oracle 8 client cannot. Datawindows cannot do a simple retrieve! Any help is appriciated! Thanks! HD I use O84 driver to access Oracle 8i/9i without problem. What are you using? Any error messages. Have you run a pbtrace (SQLCA.DBMS="trace O84") ? -- Terry Dykstra (TeamSybase) http://powerbuilder.codeXchange.sybase.com/ http://www.pb9books.com product enhancement reque...

Where can I get native PB drivers for ( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3
( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3 with SQL *Net version 2.x , 32 bit implementation. All versions of PB Enterprise (5,6,7) have the native O73 driver. If you have PB Professional, you can only use ODBC to connect to Oracle. -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. Check out Sybase Developer's Network: http://www.sybase.com/sdn Veena Madhavi <bveenamadhavi@hotmail.com> wrote in message news:38A8FD91.6218D227@hotmail.com... > ( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3 with SQL > *Net version 2...

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

superreview requested: [Bug 248638] HTMLInputElement.type doesn't return the "type of control created" : [Attachment 151711] Always return the actual type
Johnny Stenback <jst@mozilla.jstenback.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 248638: HTMLInputElement.type doesn't return the "type of control created" http://bugzilla.mozilla.org/show_bug.cgi?id=248638 Attachment 151711: Always return the actual type http://bugzilla.mozilla.org/attachment.cgi?id=151711&action=edit ...

superreview granted: [Bug 248638] HTMLInputElement.type doesn't return the "type of control created" : [Attachment 151711] Always return the actual type
Peter Van der Beken <peterv@propagandism.org> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 248638: HTMLInputElement.type doesn't return the "type of control created" http://bugzilla.mozilla.org/show_bug.cgi?id=248638 Attachment 151711: Always return the actual type http://bugzilla.mozilla.org/attachment.cgi?id=151711&action=edit ...

Version of Oracle ODP.NET client?
Does DW.NET 2.0 require a specific version of the ODP.NET client? I just installed the latest version from the Oracle site (10.2.02) and I am getting a strange exception on AdoTrans.BindConnection: System.InvalidCastException: Unable to cast object of type 'Oracle.DataAccess.Client.OracleConnection' to type 'Oracle.DataAccess.Client.OracleConnection'. at Sybase.PowerBuilder.Db.Block.OraBlock.GetConnect(Object[] input, Dbms& dbms, DBVersion& dbVer, String& user) at Sybase.PowerBuilder.Db.DbRoutine.GetConnect(DbDrivers type, Object[] input, ...

Web resources about - ORA-00439: feature not enabled: RETURNING clause from this client type - asp.net.oracle

Resources last updated: 11/27/2015 9:39:33 AM