Re: [SQL] executing dynamic commands

2006-02-07 Thread codeWarrior
In your function why not create a temporary table then use that for your processing ? CREATE TEMPRORARY TABLE tabledest AS (SELECT * FROM tblsrc WHERE condition); <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I user PostgreSQl 8.0.4 on Win2003 Server and write a functio

Re: [SQL] executing dynamic commands

2006-02-02 Thread christian . michels
Thanx a lot guys - it works ! Cheers Chris On Wed, 1 Feb 2006 christian ( dot ) michels ( at ) eifelgeist ( dot ) com wrote: > Hi, > > I user PostgreSQl 8.0.4 on Win2003 Server and write a function to copy rows > from one table into another table with the same column definition. > My first

Re: [SQL] executing dynamic commands

2006-02-01 Thread Stephan Szabo
On Wed, 1 Feb 2006 [EMAIL PROTECTED] wrote: > Hi, > > I user PostgreSQl 8.0.4 on Win2003 Server and write a function to copy rows > from one table into another table with the same column definition. > My first approach was to use something like: > > query_value := 'INSERT INTO ' || tabledest ||

Re: [SQL] executing dynamic commands

2006-02-01 Thread christian . michels
Thanx for the quick response ! Sorry for asking a bit confusing question ... Using the View is a good idea but does not fully solve my problem. To make it a bit more clear: I want to copy all records from table1 to table2 assuming that the two tables have exactly the same column definition and c

Re: [SQL] executing dynamic commands

2006-02-01 Thread codeWarrior
Talk about obfuscated Are you trying to retrieve the table structure / schema from the PG System Catalogs ? If so -- you are better off using a VIEW instead of a manual procedure because it will automatically kepp up with the current schema definition... Try this: -- DROP VIEW sys_table_sc

[SQL] executing dynamic commands

2006-02-01 Thread christian . michels
Hi, I user PostgreSQl 8.0.4 on Win2003 Server and write a function to copy rows from one table into another table with the same column definition. My first approach was to use something like: query_value := 'INSERT INTO ' || tabledest || ' SELECT * FROM ' || tablesrc; EXECUTE query_value; Thi