I am not sure why I used subselect, I just saw an example and followed it..
But now it's working as it should... Thx for all the help! :)
BTJ
On 9/19/05, Bjørn T Johansen wrote:
CREATE OR REPLACE FUNCTION trykkStatus (pressID INTEGER)
RETURNS SetOf trykkstatus_type AS '
DECLARE
On 9/19/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
CREATE OR REPLACE FUNCTION trykkStatus (pressID INTEGER)RETURNS SetOf trykkstatus_type AS 'DECLAREorderID ordrenew.id%TYPE;tmprec trykkstatus_type%ROWTYPE;BEGINselect id into orderID from ordrenew where now() between trykkstart and pro
Yes, I read the doc...
And I have now created this function, which seems to be ok but when I try to
select
from it, I get an error telling me that "subquery must return only one column".
But
my subquery does return only one column...?
My function looks like this?
CREATE OR REPLACE FUNCTION try
On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
Yes, I did and I found an answer... :)
you did what? read the docs?
But I am trying to use this function in a report designer and the result from the
select is in the way of the real data from the fetch... Is there a way around this?
and?
as
Yes, I did and I found an answer... :)
But I am trying to use this function in a report designer and the result from
the
select is in the way of the real data from the fetch... Is there a way around
this?
BTJ
hubert depesz lubaczewski wrote:
> On 9/15/05, *Bjørn T Johansen* <[EMAIL PROTECTED]
On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
But this function does not do what I need it to do... I want x rows returned, butinstead I just get a stringname...Either how do I use this name or how do I return x rows?
for refcursors - just use returned name in subsequent "FETCH FROM ";
f
Oki, I found a way...
begin;
select trykkstatus(1,'refcurs'); (I have added one parameter to know the cursor
name)
fetch all from refcurs;
commit;
But this returns two rowsets, first one for the select and then one for the
fetch,
but how do I get rid of the row that is returned by the select?
Yes, of course
But this function does not do what I need it to do... I want x rows returned,
but
instead I just get a stringname...
Either how do I use this name or how do I return x rows?
BTJ
Gnanavel S wrote:
> 'IF' block is not ended.
>
> On 9/15/05, *Bjørn T Johansen* <[EMAIL PROTECTE
'IF' block is not ended.On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
I am trying to write a function that returns x rows, where x >= 0 and this is what Ihave come up with...:CREATE OR REPLACE FUNCTION trykkStatus (pressID SMALLINT) RETURNS REFCURSOR AS 'declareorderID
ordrenew.id%TY