Dynamic sql real examples

From: Gabriel Filipiak <gabriel(dot)filipiak(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Dynamic sql real examples
Date: 2011-10-13 04:55:48
Message-ID: CALy5J6UXNve-nZGXCgWAfYKdPjHvN_MZNitU_L0m=J0mzX+nNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have lately learned what is dynamic sql and one of the most interesting
features of it to me is that we can use dynamic columns names and tables.
But I cannot think about useful real life examples. The only one that came
into my mind is statistical table.

Let`s say that we have table with name, type and created_data. Then we want
to have a table that in columns are years from created_data column and in
row type and number of names created in years. (sorry for my English)

What can be other useful real life examples of using dynamic sql with column
and table as parameters? How do you use it?

I am particulary interested in examples that do not contain administrative
things or database convertion or something like that, I am looking for
examples where the code in example java is more complicated than using a
dynamic sql in for example stored procedure.

Thanks for any suggestions and help :) regards Gabe

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gavin Flower 2011-10-13 05:31:22 Re: Dynamic sql real examples
Previous Message Jayadevan M 2011-10-13 03:40:47 Re: Conceptual Architecture