[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: OpenLDAP+Oracle10g
> Hello
>
> I'm testing with OpenLDAP+Oracle10g.
>
> When I wrote the sql like below:
>
> CREATE OR REPLACE FUNCTION create_person RETURN number AS
> keyval number;
> BEGIN
> INSERT INTO persons (id,name) VALUES (person_ids.nextval,' ');
> select max(id) into keyval from persons;
> RETURN keyval;
> END;
> /
>
> insert into ldap_oc_mappings
> (id,name,keytbl,keycol,create_proc,delete_proc,expect_return)
> values
> (1,'inetOrgPerson','persons','id','create_person()','delete_person(?)',0);
>
> Or
> insert into ldap_oc_mappings
> (id,name,keytbl,keycol,create_proc,delete_proc,expect_return)
> values (1,'inetOrgPerson','persons','id','exec
> :keyval:=create_person()','delete_person(?)',0);
>
> Or
> insert other values which can be run without problem by sql*plus to
> ldap_oc_mappings.create_proc.
>
> If I run ldapadd, ORACLE server returns a same error for every value.
> --------
> backsql_add("cn=test,o=sql,c=ru"): create_proc execution failed
> Return code: -1
> Native error code: 900
> SQL engine state: 51
> Message: [unixODBC][DataDirect][ODBC 20101
> driver][20101]ORA-00900: invalid SQL statement
>
>
> Does anyone know this? Help me please.
the invocation of the create procedure is very trivial, since it takes no
arguments. I assume you implemented a valid procedure, i.e. the
invocation of create_person() e.g. from some command line tool of you
RDBMS does succeed without errors. In this case I suggest you investigate
what is actually performed by back-sql, e.g. look at what string is
actually passed to SQLExecDirect() inside the backsql_add() function. I
note that in current OpenLDAP 2.2 code the exact string that's passed to
SQLExecDirect() is logged right before the error message, so I assume
you're not using the latest release. You can add a printf, or step in
with a debugger; however I suggest you work with the latest release,
because eventual bugs may have already been fixed.
p.
--
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it
SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497