I`mtrying to make a select which envolves two tables with in a
function....if the query is written this way: (this is just an example,
not my query)

a := (select count(*) from xx);

it works fine, but if I type the query like this

select count(*) from xx;

it throws a message that says unexpected query in exec_stmt_execsql.
If anyone knows how to fix it, it woul be great.
Thanx


Fri, 19 Jan 2001 15:26:53 +0100
=?iso-8859-1?Q?Sinuh=E9?= Arroyo <sinuheag@isoco.com>
select within a fucntion
Sinuhi Arroyo wrote:
> I`mtrying to make a select which envolves two tables with in a
> function....if the query is written this way: (this is just an example,
> not my query)
>
> a := (select count(*) from xx);
>
> it works fine, but if I type the query like this
>
> select count(*) from xx;
>
> it throws a message that says unexpected query in exec_stmt_execsql.
> If anyone knows how to fix it, it woul be great.
> Thanx

    What  should  this "select count(*) from xx;" be good for, if
    you don't want to use  the  result?  You  can  of  course  do
    "perform  select  ..."   because  that'd use another PL/pgSQL
    executor construct that doesn't  complain  about  getting  an
    unused return value, but I still wonder why you want to waste
    CPU and IO (bought an oversized system?).


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Fri, 19 Jan 2001 14:47:59 -0500 (EST)
Jan Wieck <janwieck@Yahoo.com>
Re: select within a fucntion
The thing is that I�m not interested in wasting CPU nor my ystem is
oversized, and of course, "my friend", I willl use the results of the
select, because as a matter of fact it was a select .. into statement the
one I was trying, but to make it easier to understand (I now see you were so
smart that this was a waste of time), I just wrote a select statement which
by the way, trows the same exception.
Thanks


"Jan Wieck" <janwieck@Yahoo.com> escribi� en el mensaje
news:200101191947.OAA07997@jupiter.jw.home...
> Sinuhi Arroyo wrote:
> > I`mtrying to make a select which envolves two tables with in a
> > function....if the query is written this way: (this is just an example,
> > not my query)
> >
> > a := (select count(*) from xx);
> >
> > it works fine, but if I type the query like this
> >
> > select count(*) from xx;
> >
> > it throws a message that says unexpected query in exec_stmt_execsql.
> > If anyone knows how to fix it, it woul be great.
> > Thanx
>
>     What  should  this "select count(*) from xx;" be good for, if
>     you don't want to use  the  result?  You  can  of  course  do
>     "perform  select  ..."   because  that'd use another PL/pgSQL
>     executor construct that doesn't  complain  about  getting  an
>     unused return value, but I still wonder why you want to waste
>     CPU and IO (bought an oversized system?).
>
>
> Jan
>
> --
>
> #======================================================================#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me.                                  #
> #================================================== JanWieck@Yahoo.com #
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>



Tue, 23 Jan 2001 10:19:08 +0100
"Sinuh��� Arroyo G���mez" <sinuheag@isoco.com>
Re: select within a fucntion
"Sinuhďż˝ Arroyo Gďż˝mez" wrote:
> 
> The thing is that Iďż˝m not interested in wasting CPU nor my ystem is
> oversized, and of course, "my friend", I willl use the results of the
> select, because as a matter of fact it was a select .. into statement the
> one I was trying,

There was probably a syntax error that made it into a SELECT statement 
(which SELECT .. INTO is not)

> but to make it easier to understand (I now see you were so
> smart that this was a waste of time), I just wrote a select statement which
> by the way, trows the same exception.

when writing for help or to report a bug, _always_ include the _actual_
code that misbehaves not some other code. I just confuses people.

------------------
Hannu

Wed, 24 Jan 2001 17:43:36 +0200
Hannu Krosing <hannu@tm.ee>
Re: select within a fucntion