| From: | gustavo halperin <ggh(dot)develop(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Create function problem |
| Date: | 2006-08-04 03:16:41 |
| Message-ID: | 44D2BC19.1020702@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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)
/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | andrew | 2006-08-04 07:20:17 | disjunctive queries |
| Previous Message | Chris Browne | 2006-08-04 01:21:26 | Re: Well, Pervasive is now out.... |