Обсуждение: call function with different select statement

Поиск
Список
Период
Сортировка

call function with different select statement

От
"Allie.Hopkins@gmail.com"
Дата:
I'm working the Cisco ASC for wireless authentication and I'm having
problems getting the ODBC results in a format the ASC server
understands.  I created a function that returns basic information for a
given user.  The ACS server issues the following command :

select CSNTExtractUserClearTextPw2('cstest')

This results in the following:
(0,0,"CS Test Account","No Error",clearpass123)

It just does not like this format.

I noticed when I issue:
select * from CSNTExtractUserClearTextPw('cstest');

I get:
 csresult | csgroup |   csacctinfo    | cserror  | cspsswd
----------+---------+-----------------+----------+----------
        0 |       0 | CS Test Account | No Error | tiger123


This could be how the ACS server wants it, but I can't get this result
format (multiple columns) from the issuing command coming from the ACS
server.

Does anyone know what format "recordset" really means?

Allie


Re: call function with different select statement

От
John DeSoi
Дата:
What is the return type of your function? To me it looks
CSNTExtractUserClearTextPw2 has something like "RETURNS custom_type"
whereas CSNTExtractUserClearTextPw has "RETURNS SETOF custom_type".
If you need rows (even if just 1 row), use "SETOF".


On May 10, 2006, at 11:49 AM, Allie.Hopkins@gmail.com wrote:

> I'm working the Cisco ASC for wireless authentication and I'm having
> problems getting the ODBC results in a format the ASC server
> understands.  I created a function that returns basic information
> for a
> given user.  The ACS server issues the following command :
>
> select CSNTExtractUserClearTextPw2('cstest')
>
> This results in the following:
> (0,0,"CS Test Account","No Error",clearpass123)
>
> It just does not like this format.
>
> I noticed when I issue:
> select * from CSNTExtractUserClearTextPw('cstest');
>
> I get:
>  csresult | csgroup |   csacctinfo    | cserror  | cspsswd
> ----------+---------+-----------------+----------+----------
>         0 |       0 | CS Test Account | No Error | tiger123
>
>
> This could be how the ACS server wants it, but I can't get this result
> format (multiple columns) from the issuing command coming from the ACS
> server.
>
> Does anyone know what format "recordset" really means?



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL