[SQL] Partitionning + Trigger and Execute not working as expected

2011-11-10 Thread Sylvain Mougenot
Hello, I'm trying to use table partitionning on a table called JOB. Each month a new table is created to contain the rows created on that month. ex : JOB_2011_11 for rows created during november 2011. To do that I followed this advices on that page : http://www.postgresql.org/docs/9.1/static/ddl-p

[SQL] ORACLE PROCEDURE TO POSTGRES FUNCTION -ERROR IN THE OVER PART

2011-11-10 Thread Manu T
select d1.scheme_id,d1.value , d1.dr_cr_flg INTO po_appl_scheme,po_scheme_val, po_dr_cr_flag from ( select d.scheme_id,d.value, d.dr_cr_flg , d.rule_id , dense_rank() over (partition by d.rule_id order by to_number(d.value) desc

[SQL] How to implement Aggregate Awareness?

2011-11-10 Thread Olgierd Michalak
I wonder how to implement Aggregate Awareness or Transparent Aggregate Navigation in PostgreSQL? Simply put, when Transparent (to the reporting tool) Aggregate Navigator recognizes that a query would execute faster using aggregates, it automatically rewrites the query so that the database hits

Re: [SQL] Returning data from multiple functions

2011-11-10 Thread Pavel Stehule
2011/11/10 tlund79 : > I know got this far thanks to Pavle Stehule. The function worked and returned > the data when the variables was predefined after "return query". > > When tried to replace these with variables passed through the function call > I got this message; > ERROR:  syntax error at or

Re: [SQL] Returning data from multiple functions

2011-11-10 Thread tlund79
I know got this far thanks to Pavle Stehule. The function worked and returned the data when the variables was predefined after "return query". When tried to replace these with variables passed through the function call I got this message; ERROR: syntax error at or near "RETURN" LINE 1: ...ll sele

[SQL] Returning data from multiple functions

2011-11-10 Thread tlund79
A short brief about the goal: I have a Excel workbook loaded with static data and need to compare these to "live-data" from DB. There are 20 rows with data in the report that needs to be retrieved from the database, and almost the same amount of queries, since all of these queries relies on variabl