Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Bruce Momjian
Tom Lane wrote: > Roland Roberts <[EMAIL PROTECTED]> writes: > > What can we do to at least get this on the radar screen as a known > > bug? > > Oh, it's on the radar screen all right. Who wants to step up and fix > it? Do we need a TODO for it? -- Bruce Momjian| ht

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Tom Lane
Roland Roberts <[EMAIL PROTECTED]> writes: > What can we do to at least get this on the radar screen as a known > bug? Oh, it's on the radar screen all right. Who wants to step up and fix it? regards, tom lane ---(end of broadcast)---

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Tom Lane
Ian Barwick <[EMAIL PROTECTED]> writes: > On Friday 27 September 2002 18:04, Josh Berkus wrote: >> Currently, if you want to use an array, it has to be passed as a >> parameter, or come from an external table. You cannot declare an >> Array data type. Annoying, really. > If I replace the retur

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Roland Roberts
> "Greg" == Greg Johnson <[EMAIL PROTECTED]> writes: Greg> CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' Greg> DECLARE Greg> return_array VARCHAR[]; Greg> BEGIN Greg> return_array[0] := ''test''; Greg> return_array[1] := ''test 1''; Greg> re

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Ian Barwick
On Friday 27 September 2002 18:04, Josh Berkus wrote: > Greg, > > > CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' > > DECLARE > > return_array VARCHAR[]; > > BEGIN > > return_array[0] := ''test''; > > return_array[1] := ''test 1''; > > return_array[2] := ''test 2''; > > RETU

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Greg Johnson
Is it possible to construct and return an array with plpgsql like.. CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' DECLARE     return_array VARCHAR[]; BEGIN     return_array[0] := ''test'';     return_array[1] := ''test 1'';     return_array[2] := ''test 2''; RETURN (return_array); EN

Re: [SQL] Passing array to PL/SQL and looping

2002-09-27 Thread Josh Berkus
Greg, > CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' > DECLARE > return_array VARCHAR[]; > BEGIN > return_array[0] := ''test''; > return_array[1] := ''test 1''; > return_array[2] := ''test 2''; > RETURN (return_array); > END;' > LANGUAGE 'plpgsql'; No, it's not possible

Re: [SQL] Passing array to PL/SQL and looping

2002-09-26 Thread Josh Berkus
Peter, > I'm a newbie to PL/SQL and need help badly. I'm trying to pass my array of > id's to the function and then loop through until the array is empty. I know > there must be atleast five things I'm doing wrong. Simplified example: CREATE FUNCTION test_array ( INT[] ) RETURNS INT AS

[SQL] Passing array to PL/SQL and looping

2002-09-26 Thread Peter Atkins
All, I'm a newbie to PL/SQL and need help badly. I'm trying to pass my array of id's to the function and then loop through until the array is empty. I know there must be atleast five things I'm doing wrong. Please help! Cheers, -p Call to Procedure and Array: $myArray = array(15, 6, 23); se