Re: External procedures problem

From: Michail V. Samoylov <mihael_at_caravan.ru>
Date: Fri, 24 Nov 2000 17:32:11 +0300
Message-ID: <8vlu3s$2c2j$1_at_news.omsk.su>


I determinate problem - it's DBMS_RANDOM package. I used it as follow:
CREATE OR REPLACE
FUNCTION GEN_SALT
RETURN VARCHAR2
IS
PossibleChars CONSTANT varchar2(65) :=
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./'; Salt varchar2(2);
One Number;
Two Number;
BEGIN

      dbms_random.initialize(to_number(to_char(SYSDATE,'SS')));
        One := (abs(dbms_random.random) mod (length(PossibleChars)) ) + 1;
        Two := (abs(dbms_random.random) mod (length(PossibleChars)) ) + 1;
        Salt := substr(PossibleChars,One,1)     ||
substr(PossibleChars,Two,1);
      dbms_random.terminate;
        return Salt;

END; When I drop calls of DBMS_RANDOM package (made comment calls of dbms_random.*)
all work fine.
I don't know why external procedure call can depends of this pakage, but it's the fact.
---
  Mihael V. Samoylov
      Programmer
CARAVAN Moscow
 mihael_at_caravan.ru


"Michail V. Samoylov" <mihael_at_caravan.ru> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:8vjf7m$pq2$1_at_news.omsk.su...

> Hi all,
>
> I have a problem with external procedures call.
>
> File test.sql contains the following:
>
> CREATE OR REPLACE LIBRARY libcrypt IS '/tmp/libcrypt_i.so.1';
> /
> CREATE OR REPLACE
> FUNCTION crypt(
> Customer_Password IN VARCHAR2
> )
> RETURN VARCHAR2
> IS
> Result VARCHAR2(40);
> BEGIN
> Result := sys_crypt(Customer_Password,Gen_Salt);
> return Result;
> END;
> /
> CREATE OR REPLACE
> FUNCTION sys_crypt
> ( key_arg IN VARCHAR2 ,
> salt_arg IN VARCHAR2 )
> RETURN VARCHAR2
> IS EXTERNAL
> LIBRARY libcrypt
> NAME "crypt"
> PARAMETERS ( key_arg STRING,
> salt_arg STRING);
> /
> SET SERVEROUTPUT ON
> BEGIN
> DBMS_OUTPUT.ENABLE;
> DBMS_OUTPUT.PUT_LINE( crypt('Rfpfxjr') );
> END;
> /
>
> When I try to execute this file under sqlplus with following method - all
> works fine:
> bash-2.03# sqlplus
> SQL*Plus: Release 8.1.5.0.0 - Production on Thu Nov 23 18:37:39 2000
> (c) Copyright 1999 Oracle Corporation. All rights reserved.
> Enter user-name: test
> Enter password:
> Connected to:
> Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
> With the Partitioning and Java options
> PL/SQL Release 8.1.5.0.0 - Production
> SQL> _at_test.sql
> Library created.
> Function created.
> Function created.
> hgni9gpqHNGLs
> PL/SQL procedure successfully completed.
>
> But when I try to execute this file by following method - it's not work:
> bash-2.03# sqlplus test/test_at_test
> SQL*Plus: Release 8.1.5.0.0 - Production on Thu Nov 23 18:38:18 2000
> (c) Copyright 1999 Oracle Corporation. All rights reserved.
> Connected to:
> Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
> With the Partitioning and Java options
> PL/SQL Release 8.1.5.0.0 - Production
>
> SQL> _at_test.sql
> Library created.
> Function created.
> Function created.
> BEGIN
> *
> ERROR at line 1:
> ORA-28575: unable to open RPC connection to external procedure agent
> ORA-00000: normal, successful completion
> ORA-00000: normal, successful completion
> ORA-06512: at "TEST.SYS_CRYPT", line 0
> ORA-06512: at "TEST.CRYPT", line 8
> ORA-06512: at line 3
>
>
> May be anyone know this problem?!
>
> Thanks in advance,
> Mihael Samoylov
> mihael_at_caravan.ru
>
>
>
>
Received on Fri Nov 24 2000 - 15:32:11 CET

Original text of this message