Re: [GENERAL] Create function problem

2006-08-04 Thread Michael Fuhr
[Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Fri, Aug 04, 2006 at 11:20:55AM +0300, gustavo halperin wrote: Michael Fuhr wrote: You've hardcoded the strings 'v_tbl_schm' and 'v_tbl_name' instead of using the function's arguments. I

Re: [GENERAL] Create function problem

2006-08-04 Thread gustavo halperin
Michael Fuhr wrote: [Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Fri, Aug 04, 2006 at 11:20:55AM +0300, gustavo halperin wrote: Michael Fuhr wrote: You've hardcoded the strings 'v_tbl_schm' and 'v_tbl_name' instead of using

Re: [GENERAL] Create function problem

2006-08-04 Thread Michael Fuhr
On Fri, Aug 04, 2006 at 06:44:16PM +0300, gustavo halperin wrote: Michael Fuhr wrote: Since the function has OUT parameters you can use RETURNS SETOF record like this: CREATE FUNCTION funcname(params) RETURNS SETOF record AS $$ body $$ LANGUAGE SQL What do you mean with the word record,

Re: [GENERAL] Create function problem

2006-08-04 Thread gustavo halperin
Michael Fuhr wrote: On Fri, Aug 04, 2006 at 06:44:16PM +0300, gustavo halperin wrote: Michael Fuhr wrote: Since the function has OUT parameters you can use RETURNS SETOF record like this: CREATE FUNCTION funcname(params) RETURNS SETOF record AS $$ body $$ LANGUAGE SQL What do

[GENERAL] Create function problem

2006-08-03 Thread gustavo halperin
*Hello I have a little question In order to know the names and data types of the table mil_cien_diez from the schema public I run the next 'SELECT' but when I try to create a SQL function and after it I run it, I receive an empty row. Can you see the problem ??* /mydb= SELECT c.column_name,

Re: [GENERAL] Create function problem

2006-08-03 Thread Michael Fuhr
On Fri, Aug 04, 2006 at 01:51:19AM +0300, gustavo halperin wrote: In order to know the names and data types of the table mil_cien_diez from the schema public I run the next 'SELECT' but when I try to create a SQL function and after it I run it, I receive an empty row. Can you see the

Re: [GENERAL] Create function problem

2006-08-03 Thread gustavo halperin
Ron St-Pierre wrote: Check your spelling of public: SELECT * FROM f_describe_tables('pubilc', 'mil_cien_diez'); Ron *OK thank you, you right, but after write public I receive again an empty row, Why??. By the way I wrote a short function:* /mydb= SELECT c.column_name, c.data_type mydb- FROM

Re: [GENERAL] Create function problem

2006-08-03 Thread Michael Fuhr
On Fri, Aug 04, 2006 at 06:16:41AM +0300, gustavo halperin wrote: *OK thank you, you right, but after write public I receive again an empty row, Why??. [...] mydb= CREATE OR REPLACE FUNCTION f_describe_tables (v_tbl_scm text, v_tbl_name text, mydb( OUT text, OUT text) as mydb- $$ SELECT

[GENERAL] CREATE FUNCTION problem

2000-11-02 Thread Cesar A. K. Grossmann
Hi! I'm trying to use pgaccess to create a function that returns the same tuples the query bellow: select codigo, nome, 'T' as selected from cad_exportacao where codigo in ( select codigo from user_codigo where username = 'cesar' and tipo

Re: [GENERAL] CREATE FUNCTION problem

2000-11-02 Thread Tom Lane
"Cesar A. K. Grossmann" [EMAIL PROTECTED] writes: create function vinculoExportacao (varchar) returns setof as 'select codigo, nome, ''T'' as selected from cad_exportacao ... psql:tmp/teste2.sql:15: ERROR: parser: parse error at or near "as" setof *what* ? The parser is expecting SETOF