Re: passing schema name and table name as parameter functions in postgresql 9.2
От | anushasrivastava03 |
---|---|
Тема | Re: passing schema name and table name as parameter functions in postgresql 9.2 |
Дата | |
Msg-id | 1370588315101-5758259.post@n5.nabble.com обсуждение исходный текст |
Ответ на | Re: passing schema name and table name as parameter functions in postgresql 9.2 (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: passing schema name and table name as parameter functions in
postgresql 9.2
|
Список | pgsql-general |
hi my requirement is to create a table as a result of sub-query and the table and schema name should be passed as parameters of a function i also tried like this; CREATE OR REPLACE FUNCTION secc_master.chkschema(schemaname text, tableis text) RETURNS void AS $BODY$ DECLARE ione boolean; BEGIN EXECUTE 'create table '||quote_literal($1)||'.'||quote_literal($2)||' as select * from master.master_state where state_code not in ( select distinct(statecode)from master.population_2 )'; end; $BODY$ LANGUAGE plpgsql select * from secc_master.chkschema('secc_master', 'chktbl') ERROR: syntax error at or near "'secc_master'" LINE 1: create table 'secc_master'.'chktbl' as select * from master... -- View this message in context: http://postgresql.1045698.n5.nabble.com/passing-schema-name-and-table-name-as-parameter-functions-in-postgresql-9-2-tp5758130p5758259.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления: