8000 Error while executing a SQL query with parameters · Issue #5 · LinqDan/oracleclientcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Error while executing a SQL query with parameters #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issu 8000 e and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haroldjose30 opened this issue Sep 15, 2017 · 0 comments
Open

Error while executing a SQL query with parameters #5

haroldjose30 opened this issue Sep 15, 2017 · 0 comments

Comments

@haroldjose30
Copy link
haroldjose30 commented Sep 15, 2017

Hi, I do not know if I'm doing something wrong. The following is the error message when I use a parameter in an SQL query, Can you help me?

MY ENVIROMENT: Macintosh; Intel Mac OS X 10_12_6; Visual Studio For Mac; Asp.net Core 2.0


MY CODE:
...
OracleConnection con = null;
con = new OracleConnection(connectionString);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;

		cmd.CommandText = "SELECT * FROM PRODUTO  WHERE ID = :ID";

		OracleParameter myParameter1 = new OracleParameter("ID", OracleType.Number);
		myParameter1.Value = 1;
		myParameter1.Direction = ParameterDirection.Input;

                    cmd.Parameters.Add(myParameter1);

		OracleDataReader reader = cmd.ExecuteReader();

...


ERROR:
MarshalDirectiveException: Cannot marshal 'parameter #8': Unknown error.
System.Data.OracleClient.Oci.OciCalls+OciNativeCalls.OCIBindByNameBytes(IntPtr stmtp, out IntPtr bindpp, IntPtr errhp, string placeholder, int placeh_len, Byte[] valuep, int value_sz, OciDataType dty, IntPtr indp, IntPtr alenp, IntPtr rcodep, uint maxarr_len, IntPtr curelp, uint mode)
System.Data.OracleClient.Oci.OciCalls.OCIBindByNameBytes(IntPtr stmtp, out IntPtr bindpp, IntPtr errhp, string placeholder, int placeh_len, Byte[] valuep, int value_sz, OciDataType dty, IntPtr indp, IntPtr alenp, IntPtr rcodep, uint maxarr_len, IntPtr curelp, uint mode) in OciCalls.cs
+
return OciNativeCalls.OCIBindByNameBytes (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
System.Data.OracleClient.OracleParameter.Bind(OciStatementHandle statement, OracleConnection con, uint pos) in OracleParameter.cs
+
status = OciCalls.OCIBindByNameBytes (statement,
System.Data.OracleClient.OracleCommand.BindParameters(OciStatementHandle statement) in OracleCommand.cs
+
Parameters[p].Bind (statement, Connection, (uint) p);
System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior) in OracleCommand.cs
+
BindParameters (statement);
System.Data.OracleClient.OracleCommand.ExecuteReader() in OracleCommand.cs
+
return ExecuteReader (CommandBehavior.Default);
EstudoAspCore.Repositories.ProdutoRepository.GetByID(int pID) in ProdutoRepository.cs
+
OracleDataReader reader = cmd.ExecuteReader();
EstudoAspCore.Controllers.ProdutoController.Get(int id) in ProdutoController.cs
+
return produtoRepository.GetByID(id);
lambda_method(Closure , object , Object[] )
Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(object target, Object[] parameters)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__12.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__10.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__14.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__17.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__15.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Builder.RouterMiddleware+d__4.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+d__7.MoveNext()

JeanRessouche pushed a commit to JeanRessouche/oracleclientcore that referenced this issue Oct 3, 2017
- Add GitIgnore files, not required files should be removed from source repo.
ericmend added a commit to ericmend/oracleclientcore that referenced this issue Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0