Thread: execute dynamic strings

execute dynamic strings

From
Stefan.Ardeleanu@siveco.ro
Date:

I have a function with 3 parameters (select clause, where clause and order by clause (last two are optionally clauses). This clauses apply to a given table. For example, the table table1

and the function table1_rwc (read by where clause).
Given, let's say, the followings values select_clause = '*', where clause 'id = 1' and the order_by clause = 'id', it will be generate the result set of the following query:

select * from Table1 where id = 1 order by id

I know I must use execute and prepare syntax, but I don't know how to create the function.
Can you help me, please.

Re: execute dynamic strings

From
brew@theMode.com
Date:
Stefan......

> I have a function with 3 parameters (select clause, where clause and
> order by clause (last two are optionally clauses). This clauses apply to
> a given

> I know I must use execute and prepare syntax, but I don't know how to
> create the function.

Is this a postgreSQL function you've written or are you planning on using
an external language like perl or php?

It would be helpful if you posted a code snippet that you've tried.

brew

 ==========================================================================
                  Strange Brew   (brew@theMode.com)
  Check out my Stock Option Covered Call website  http://www.callpix.com
     and my Musician's Online Database Exchange http://www.TheMode.com
 ==========================================================================