Re: RadiusNt with Oracle

Flemming Eriksen ( (no email) )
Wed, 4 Feb 1998 09:21:21 +0100

I create a function in Oracle like:

--------------------------------------------------
Create function GetDate
RETURN VARCHAR2 AS
Cdate varchar2(9);
CURSOR get_date is
select to_char(sysdate,'DD-MON-YY')
from sys.dual;
Begin
Open get_date;
Fetch get_date into Cdate;
Close get_date;
RETURN(Cdate);
End GetDate;
--------------------------------------------------

SQL> select getdate from sys.dual;

Result is:

GETDATE
----------------------------------------------------------------------------
----
04-FEB-98

SQL> insert into calls(NASIDENTIFIER,calldate) values
('192.38.222.2',getdate);

1 row created.

Hope it helps.

Flemming

>I need a function to get the CURRENT date. Somethint like what
>RadiusNT uses in the INSERT statement:
>
>INSERT Into Calls(CallDate, .... ) VALUES (CurrDate, .... )
>
>Any ideas there?
>
>Flemming Eriksen wrote:
>>
>> OK
>>
>> Std. Oracle Date function is
>>
>> to_char(sysdate,'DD-MON-YY') = (02-FEB-98)
>> or
>> to_char(sysdate,'DDMMYY') = (020298)
>>
>> BUT
>>
>> It is easy to create a function that is called with just "CallDate"
>> In Oracle functions can't be called with "()" without something inside,
this
>> call will work CallDate(020298)
>>
>> Hope it helps
>>
>> Flemming
>>
>> ----------------------------------------------------------
>> RadiusNT Mailing List lists@iea-software.com
>
>--
>Dale E. Reed Jr. (daler@iea-software.com)
>_________________________________________________________________
> IEA Software, Inc. | RadiusNT, Emerald, and NT FAQs
> Internet Solutions for Today | http://www.iea-software.com
>
> ----------------------------------------------------------
> RadiusNT Mailing List lists@iea-software.com
>