Re: [SQL] Some help with functions-syntax

2007-01-17 Thread Jan Meyland Andersen
> There are two forms to iterate over the query: > > 1. FOR target IN query LOOP > 2. FOR target IN EXECUTE text_expression LOOP Thanks for your answer. > My suggestion is to eliminate the string you created (_WHERECLAUSE) and > add the proper conditions to the query expression you already have.

Re: [SQL] Some help with functions-syntax

2007-01-17 Thread John DeSoi
Take a look at the documentation and examples again: http://www.postgresql.org/docs/8.2/interactive/plpgsql-control- structures.html#PLPGSQL-RECORDS-ITERATING There are two forms to iterate over the query: 1. FOR target IN query LOOP 2. FOR target IN EXECUTE text_expression LOOP In your code

[SQL] Some help with functions-syntax

2007-01-17 Thread Jan Meyland Andersen
I have some problem with writing a function. I have made this function which I can't get it to work. This is probaly a triviel question but i'm new to plsql, so this is a showstopper for me. DECLARE _relkind char; _RES "EMS"."KeySet"; _WHERECLAUSE text; BEGIN SELE

Re: [SQL] Update query by joining multiple tables.

2007-01-17 Thread Shoaib Mir
Might be a view and then a rule attached with that can help you out with doing updates using joins -- Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 1/17/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Wed, Jan 17, 2007 at 04:50:18PM +0530, Moiz Kothari wrote: > http://www.pos

Re: [SQL] Postgresql & Oracle Heteregenous services - strange behaviour

2007-01-17 Thread Marcin Stępnicki
Dnia Wed, 17 Jan 2007 13:04:28 +, Richard Huxton napisał(a): > Andrew Sullivan wrote: >> I bet it's getting the column list from the table or some such thing. >> This is a lousy way to do it (the information_schema would be more >> correct, although maybe no faster). > > That'd be my guess.

Re: [SQL] Postgresql & Oracle Heteregenous services - strange behaviour

2007-01-17 Thread Richard Huxton
Andrew Sullivan wrote: On Wed, Jan 17, 2007 at 01:52:25PM +0100, Marcin St?pnicki wrote: I see this in postgresql logs: [6210] DEBUG: query: select * from "zew_patients" [6210] DEBUG: query: SELECT "A1"."p_nr_pesel" FROM "zew_patients" "A1" WHERE ("A1"."p_patient_id" = 19300) The point

Re: [SQL] Postgresql & Oracle Heteregenous services - strange behaviour

2007-01-17 Thread Andrew Sullivan
On Wed, Jan 17, 2007 at 01:52:25PM +0100, Marcin St?pnicki wrote: > I see this in postgresql logs: > > [6210] DEBUG: query: select * from "zew_patients" > [6210] DEBUG: query: SELECT "A1"."p_nr_pesel" FROM "zew_patients" > "A1" WHERE ("A1"."p_patient_id" = 19300) > > The point is, I don't

Re: [SQL] Update query by joining multiple tables.

2007-01-17 Thread Andrew Sullivan
On Wed, Jan 17, 2007 at 04:50:18PM +0530, Moiz Kothari wrote: > http://www.postgresql.org/docs/8.1/interactive/sql-update.html, it is not > specified if a join can be done between multiple tables to update a table, i Sure it is: A list of table expressions, allowing columns from other tables to a

[SQL] Postgresql & Oracle Heteregenous services - strange behaviour

2007-01-17 Thread Marcin Stępnicki
I'm not sure if it's proper group, if not then please direct me to more appropriate one (unixodbc?) I've set up connection from oracle to postgresql via unixodbc and oracle's heterogeneus services. The connection works, but when I issue the following: select "p_nr_pesel" from "zew_patients"@my_po

[SQL] Update query by joining multiple tables.

2007-01-17 Thread Moiz Kothari
Guys, on page this http://www.postgresql.org/docs/8.1/interactive/sql-update.html, it is not specified if a join can be done between multiple tables to update a table, i tried and it worked just fine for me. Something like this : Infact update can work between multiple tables to... do something