Re: Create function problem
От | gustavo halperin |
---|---|
Тема | Re: Create function problem |
Дата | |
Msg-id | 44D2BC19.1020702@gmail.com обсуждение исходный текст |
Ответ на | Create function problem (gustavo halperin <ggh.develop@gmail.com>) |
Ответы |
Re: Create function problem
|
Список | pgsql-general |
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 information_schema.columns c mydb-> WHERE c.table_schema = 'public' AND c.table_name = 'mil_cien_diez'; column_name | data_type -------------+----------- miles | smallint cientos | smallint decenas | smallint (3 rows) mydb=> CREATE OR REPLACE FUNCTION f_describe_tables (v_tbl_scm text, v_tbl_name text, mydb(> OUT text, OUT text) as mydb-> $$ SELECT c.column_name, c.data_type mydb$> FROM information_schema.columns c mydb$> WHERE c.table_schema = 'v_tbl_schm' AND c.table_name = 'v_tbl_name' mydb$> $$ LANGUAGE SQL; CREATE FUNCTION mydb=> SELECT * FROM f_describe_tables('public', 'mil_cien_diez'); column1 | column2 ---------+--------- | (1 row) /
В списке pgsql-general по дате отправления: