oracle stored procédure

classic Classic list List threaded Threaded
2 messages Options

oracle stored procédure

Reply | Threaded |   star
Alexandre Chapellon-3
I'm still trying to setup freeradius authentication with oracle stored
procedure.
I have a procedure that return data as i expected it to be returned in
an sqlplus client:


SQL> SELECT hss_radcheck_func('khoa@mana','bas3_SE') FROM DUAL;

HSS_RADCHECK_FUNC('K
--------------------
CURSOR STATEMENT : 1

CURSOR STATEMENT : 1

        ID USERNAME                         ATTRIBUTES        
VALUE                            OP
---------- -------------------------------- ------------------
-------------------------------- --
         1 khoa@mana                        Cleartest-Password
mudafuka                         ==
         2 khoa@mana                        Simultaneous_Use  
1                                :=


Unfortunatly, when freeradius calls the procedure, it gives me an error
saying:

rlm_sql_oracle: fetch failed in sql_fetch_row: ORA-00932: inconsistent
datatypes: expected CHAR got DTYCWD

What is weird is that we force the procedure to return data as CHAR
(except for ID which is a NUMBER):
here is the nd of the procedure...

OPEN resultSet FOR
            SELECT to_number('1') as ID,
                   to_char(name) as username,
                   to_char('Cleartest-Password') as attributes,
                   to_char(password) as value,
                   to_char('==') as operator
            FROM dual
            union
            SELECT to_number('2') as ID,
                   to_char(name) as username,
                   to_char('Simultaneous_Use') as attributes,
                   to_char(loginlimit) as value,
                   to_char(':=') as operator
            FROM dual

    return resultSet;

I know this is very Oracle related but I am totally stuck now wth this
problem, and so trying to find help, where i can...
Someone who already setup oracle auth may help....

thx
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: oracle stored procédure

Reply | Threaded |   star
tnt-5
Try fixing obvious errors:

>                   to_char('Cleartest-Password') as attributes,

Cleartext-Password

>                   to_char(password) as value,
>                   to_char('==') as operator

should be :=

>            FROM dual
>            union
>            SELECT to_number('2') as ID,
>                   to_char(name) as username,
>                   to_char('Simultaneous_Use') as attributes,

Simultaneous-Use

>                   to_char(loginlimit) as value,
>                   to_char(':=') as operator
>            FROM dual
>
>    return resultSet;

Not sure if it will help, but will make it work properly later.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html