Re: [SQL] Accessing field of OLD in trigger

2007-10-12 Thread Erik Jones
On Oct 12, 2007, at 8:18 AM, Josh Trutwin wrote: On Fri, 12 Oct 2007 12:00:55 +0200 (CEST) Daniel Drotos <[EMAIL PROTECTED]> wrote: Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can

Re: [SQL] OT: array_accum equivalent in Oracle

2007-10-12 Thread Jonah H. Harris
On 10/12/07, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > > Something like this: > > > > CREATE TYPE varchar2_table_t AS TABLE OF VARCHAR2(32767); > > SELECT job, CAST(MULTISET(SELECT ename FROM emp WHERE job = e.job) AS > > varchar2_table_t) FROM emp e GROUP BY job; > > Amazing! Works like a

Re: [SQL] OT: array_accum equivalent in Oracle

2007-10-12 Thread Andreas Joseph Krogh
On Friday 12 October 2007 17:02:23 Jonah H. Harris wrote: > On 10/12/07, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > > Anybody knows if Oracle has an equivalent of PG's array_accum or > > ARRAY(subselect) construct? > > Something like this: > > CREATE TYPE varchar2_table_t AS TABLE OF VARCHAR

Re: [SQL] OT: array_accum equivalent in Oracle

2007-10-12 Thread Jonah H. Harris
On 10/12/07, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > Anybody knows if Oracle has an equivalent of PG's array_accum or > ARRAY(subselect) construct? Something like this: CREATE TYPE varchar2_table_t AS TABLE OF VARCHAR2(32767); SELECT job, CAST(MULTISET(SELECT ename FROM emp WHERE job =

[SQL] OT: array_accum equivalent in Oracle

2007-10-12 Thread Andreas Joseph Krogh
WARNING: The rest of this post is for somebody who has worked with Oracle and has migrated to PG, or for some other reason has good experience with Oracle. I know this is off-topic for this list and should be asked in an Oracle support-forum, but I don't have access to that, and Uncle Google did

[SQL] How to escape a memo field as a binary value in postgresql

2007-10-12 Thread rdyes
I want to take the value of my memo field in Paradox and insert/update the value of a binary field in my backend postgresql database. How would I write this sql statement for the sake of this example lets say the field name is pmemo in paradox and the is bymemo a bytea field in Postgresql dat

Re: [SQL] Accessing field of OLD in trigger

2007-10-12 Thread Josh Trutwin
On Fri, 12 Oct 2007 12:00:55 +0200 (CEST) Daniel Drotos <[EMAIL PROTECTED]> wrote: > Hi, > > > I'm working on a row level plpgsql trigger running after delete, > using a 8.0.3 server. It gets a parameter which is a field name of > the OLD record. How can that field be accessed? > > I'd like to

[SQL] Accessing field of OLD in trigger

2007-10-12 Thread Daniel Drotos
Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can that field be accessed? I'd like to do something like: for recvar in 'select OLD.'||quote_ident(TG_ARGV[0])... Daniel Ps: sorry a