ODBC Calling Stored Procedure With DEFAULT Parameter Fails With "SQLExecDirect with return code -1 (SQL_ERROR)" (Doc ID 1363054.1)

Last updated on JULY 05, 2017

Applies to:

Oracle ODBC Driver - Version: 10.2.0.4 to 11.2.0.2 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Symptoms

A SQL_ERROR on SQLExecDirect occurs
when calling a procedure from Oracle ODBC driver  which contains DEFAULT parameters
e.g.

create or replace package foo as
procedure fooproc (v1 IN VARCHAR2 DEFAULT 'foo');
end;
/

create or replace package body foo as
procedure fooproc (v1 IN VARCHAR2 DEFAULT 'foo') is
begin null; end;
end;
/

fails and shows this in the ODBC trace

Odbc c6c-1b08 EXIT SQLExecDirect with return code -1 (SQL_ERROR)


When tested in vbscript this can appear as error

Provider: Unspecified error

An example using vbscript shown below. This procedure also contains a DEFAULT parameter.

set con = createobject("adodb.connection")
con.open "dsn=orcl;uid=scott;pwd=tiger"
con.execute "{call ordsys.ORD_DICOM.setDataModel()}"
wscript.echo "done"

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms