Storing in SQL, Procedure call
Marko Dinic
marko at yu.net
Wed Jun 7 14:01:34 CEST 2006
I never actually worked with MS SQL, so I'm suggesting methods that
do work with other SQL servers. Try the PostgreSQL style :
- If the function returns only a return code:
"SELECT sp_name(....)"
- If the function returns rows:
"SELECT * FROM sp_name(...)"
--
Best regards,
Marko Dinic, System Engineer
-----
YUnet International http://www.eunet.yu
Dubrovacka 35/III, 11000 Belgrade
Tel: +381 11 311 9901; Fax: + 381 11 311 9901
-----
This e-mail is confidential and intended only for the recipient.
Unauthorized distribution, modification or disclosure of its
contents is prohibited. If you have received this e-mail in error,
please notify the sender by telephone +381 11 311 9901.
-----
> I tried both suggestions and still no luck. Any other suggestion on how
> to get a Stored Procedure to work with FreeRadius, unixODBC/FreeTDS and
> Microsoft SQL Server 2000? For some reason when trying to call a Stored
> Procedure rlm_sql module is trying to perform a query rather then the
> procedure call. Thanks!
>
> -----Original Message-----
> From: Marko Dinic [mailto:marko at yu.net]
> Sent: Tuesday, June 06, 2006 4:16 AM
> To: freeradius-users at lists.freeradius.org
> Cc: Jackie Lau
> Subject: Re: Storing in SQL, Procedure call
>
>
> Im using the same setup for access to some ancient Sybase and it works
> fine. However, the query doesn't use EXEC ... it's plain :
>
> accounting_stop_query = "sp_my_stored_procedure_name
> '%{SQL-User-Name}','%{Realm}', ...."
>
> I did have problems with freetds 0.62.3, tho, so I installed 0.63 and
> had no problems with Sybase access since then.
>
> On the other hand, Oracle setup (using rlm_sql_oracle) with "EXEC
> SP_NAME(...)"
> didn't work either, so I had to change it to "BEGIN SP_NAME(...); END;"
> Maybe that would work for your unixODBC/freetds setup too.
>
> --
> Best regards,
>
> Marko Dinic, System Engineer
> -----
> YUnet International http://www.eunet.yu
> Dubrovacka 35/III, 11000 Belgrade
> Tel: +381 11 311 9901; Fax: + 381 11 311 9901
> -----
> This e-mail is confidential and intended only for the recipient.
> Unauthorized distribution, modification or disclosure of its
> contents is prohibited. If you have received this e-mail in error,
> please notify the sender by telephone +381 11 311 9901.
> -----
>
> > Hi,
> >
> > I'm using freeradius with freetds and unixodbc. I am having an issue
> > using a procedure call to insert to a Microsoft SQL Server. When I
> > try to use the procedure call 'exec', I see the following errors:
> >
> > radius_xlat: 'exec ***
> > rlm_sql (sql): Reserving sql socket id: 8
> > query: exec ***
> > rlm_sql_unixodbc: '00000 '
> > rlm_sql (sql): Couldn't update SQL accounting ALIVE record - 00000
> >
> > But if I don't use a procedure call and use an insert command in its
> > place, it works just find.
> >
> > radius_xlat: 'INSERT ****
> > rlm_sql (sql): Reserving sql socket id: 3 rlm_sql (sql): Released sql
> > socket id: 3
> > modcall[accounting]: module "sql" returns ok for request 6
> >
> > My question is why can't I use a procedure call 'exec'?
> >
> > Thanks!
> >
> >
> >
> >
> >
>
>
More information about the Freeradius-Users
mailing list