I solved my problem :)
the problem is in the query that calls my function:
select * from calcolo_inventario('26','2008-02-22','05')
where giacenza > 0
because the resulset has a negative row that doesn't appear on screen
Thank you very much to all of you
Enrico
---(end
Enrico wrote:
Hi all,
I have this piece of code
DECLARE
minv my_inv;
r record;
totale numeric(20,5);
valore numeric(20,5);
BEGIN
[.]
totale := 0;
for r in select * from tminv loop
[.]
valore := r.prezzo*r.giacenza;
totale := totale+valore;
On Fri, 22 Feb 2008 11:51:01 -0500
Tom Lane <[EMAIL PROTECTED]> wrote:
> Enrico <[EMAIL PROTECTED]> writes:
> > the first record has valore=98 and totale=0 for the first time of
> > the loop, but my first result of totale is -298 instead of +98.
>
> Hmm, that's a bit hard to believe.
Yes you ri
Enrico <[EMAIL PROTECTED]> writes:
> the first record has valore=98 and totale=0 for the first time of
> the loop, but my first result of totale is -298 instead of +98.
Hmm, that's a bit hard to believe. Could we see the whole example
not just a fragment? Usually, when you can't understand the p
Hi all,
I have this piece of code
DECLARE
minv my_inv;
r record;
totale numeric(20,5);
valore numeric(20,5);
BEGIN
[.]
totale := 0;
for r in select * from tminv loop
[.]
valore := r.prezzo*r.giacenza;
totale := totale+valore;
minv.total
ABHANG RANE <[EMAIL PROTECTED]> writes:
> I have written a function called similarity in postgresql which accepts
> real[] as argument. I then call it by saying
> select * from similarity('{1.232,5., 5.100, 1}');
> I get this error.
> Could not choose a best candidate function. You may
Hi,
I have written a function called similarity in postgresql which accepts
real[] as argument. I then call it by saying
select * from similarity('{1.232,5., 5.100, 1}');
I get this error.
Could not choose a best candidate function. You may need to add
explicit type casts.
Is it th
On Mon, Dec 06, 2004 at 10:34:12AM +1100, Jamie Deppeler wrote:
> I am trying to store value in a TEMPORARY table and I am getting the
> following error
>
> ERROR: relation with OID 51533 does not exist
The FAQ has a question regarding functions and temporary tables.
See also past discussion in
Problem
I am trying to store value in a TEMPORARY table and I am getting the
following error
ERROR: relation with OID 51533 does not exist
Trigger
CREATE TRIGGER "createtemporytable" AFTER INSERT
ON "component" FOR EACH ROW
EXECUTE PROCEDURE "createtemp"();
Function
begin
CREATE temporary TABLE
Sky wrote:
HI everybody !
I have a problem, but I don't know the solution:
CREATE TABLE person(
user_id SERIAL NOT NULL,
uid CHARACTER(20) NOT NULL,
pwd CHARACTER(20) NOT NULL,
PRIMARY KEY (user_id)
);
OK, That's right...
CREATE FUNCTION getuserid (CHARACTER(20),CHARACTER(20))
RETURNS SETOF
Sky <[EMAIL PROTECTED]> writes:
> uid CHARACTER(20) NOT NULL,
> pwd CHARACTER(20) NOT NULL,
Incidentally, are you sure you want character(20) ? The input will be padded
out to 20 characters with spaces. Usually people find varchar() more
convenient.
--
greg
---(en
Sky wrote:
HI everybody !
I have a problem, but I don't know the solution:
CREATE TABLE person(
user_id SERIAL NOT NULL,
uid CHARACTER(20) NOT NULL,
pwd CHARACTER(20) NOT NULL,
PRIMARY KEY (user_id)
);
OK, That's right...
CREATE FUNCTION getuserid (CHARACTER(20),CHARACTER(20))
RETURNS SETO
Sky <[EMAIL PROTECTED]> writes:
> SELECT user_id FROM person WHERE uid=$1 AND pwd=$2;
> ERROR: Unable to identify an operator '=$' for types 'character' and
> 'integer
You need spaces:
SELECT user_id FROM person WHERE uid= $1 AND pwd= $2;
This is fixed as of PG 7.4, IIRC. Prior to that it's
HI everybody !
I have a problem, but I don't know the solution:
CREATE TABLE person(
user_id SERIAL NOT NULL,
uid CHARACTER(20) NOT NULL,
pwd CHARACTER(20) NOT NULL,
PRIMARY KEY (user_id)
);
OK, That's right...
CREATE FUNCTION getuserid (CHARACTER(20),CHARACTER(20))
RETURNS SETOF INTEGER
AS
14 matches
Mail list logo