Re: Plsql Function with error: No space left on device.

From: "David M(dot) Richter" <D(dot)Richter(at)DKFZ-heidelberg(dot)de>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Plsql Function with error: No space left on device.
Date: 2001-06-26 13:24:21
Message-ID: 3B388D05.C3919F0F@DKFZ-heidelberg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hallo!

The query works, but not right.(apart from the timeaspect)
UPDATE image SET seriesoid = r.parentoid
FROM image i JOIN relseries_image000 r ON i.chilioid=r.childoid;

it does not same than this function:

CREATE FUNCTION series_image () RETURNS integer AS '
DECLARE

psr_rec record;
i integer := 0;

BEGIN
FOR psr_rec IN SELECT * FROM relseries_image000 LOOP
UPDATE image
SET seriesoid = psr_rec.parentoid
WHERE chilioid = psr_rec.childoid;
i := i + 1;
END LOOP;
IF NOT FOUND THEN RETURN -1;
ELSE RETURN i;
END IF;
END;

' LANGUAGE 'plpgsql';

Only always the same one oid is written in seriesoid(e.g. 0x0)
But the part of the query
Select * FROM image i JOIN relseries_image000 r ON
i.chilioid=r.childoid;
works right.
Here the Table descriptions:

Table "relseries_image000"
Attribute | Type | Modifier
-----------+-----------------------+----------
chilioid | character varying(80) |
parentoid | character varying(80) |
childoid | character varying(80) |
Indices: indseries_image_child,
indseries_image_parent


Table "series"
Attribute | Type | Modifier
---------------------+------------------------+----------
chilioid | character varying(80) |
instanceuid | character varying(64) |
number | integer |
acquisition | integer |
echonumber | integer |
temporalposition | integer |
seriesdate | date |
seriestime | time |
description | character varying(128) |
contrast | character varying(128) |
bodypartexamined | character varying(16) |
scanningsequence | character varying(16) |
frameofreferenceuid | character varying(64) |
Indices: indseries_oid,
indseries_uid

Table "image"
Attribute | Type | Modifier
---------------+------------------------+----------
chilioid | character varying(80) |
instanceuid | character varying(64) |
imagetype | character varying(64) |
number | integer |
imagedate | date |
imagetime | time |
slicelocation | double precision |
rows | integer |
columns | integer |
bitsallocated | integer |
path | character varying(256) |
relevance | integer |
thickness | double precision |
spacing_x | double precision |
spacing_y | double precision |
spacing_z | double precision |
tilt | double precision |
tableheight | double precision |
position_x | double precision |
position_y | double precision |
position_z | double precision |
window_center | integer |
window_width | integer |
seriesoid | character varying(80) |
Indices: indimage_oid,
indimage_uid

What do I have to change in the Query?
Thanks a lot

David

Attachment Content-Type Size
D.Richter.vcf text/x-vcard 468 bytes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2001-06-26 13:32:55 Re: Plsql Function with error: No space left on device.
Previous Message David M. Richter 2001-06-26 11:32:53 Re: Plsql Function with error: No space left on device.