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: to - Release: 10.2 to 11.2
Information in this document applies to any platform.


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

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

create or replace package body foo as
procedure fooproc (v1 IN VARCHAR2 DEFAULT 'foo') is
begin null; 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"


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