X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3E6DF11F6081 for ; Tue, 25 Apr 2006 09:21:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99784-07 for ; Tue, 25 Apr 2006 09:21:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by postgresql.org (Postfix) with ESMTP id 7EE6011F6083 for ; Tue, 25 Apr 2006 09:21:05 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1FYMXR2iNy-0005ca; Tue, 25 Apr 2006 14:21:05 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1FYMXQ-0008Qd-00 for pgsql-sql@postgresql.org; Tue, 25 Apr 2006 14:21:04 +0200 Date: Tue, 25 Apr 2006 14:21:04 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: SELECTing into usertype, how to do it? Message-ID: <20060425122104.GJ20325@webserv.wug-glas.de> Mail-Followup-To: "A. Kretschmer" , pgsql-sql@postgresql.org References: <1145966587.8822.5.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1145966587.8822.5.camel@localhost.localdomain> X-DEST: 208 X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/171 X-Sequence-Number: 24980 am 25.04.2006, um 14:03:07 +0200 mailte Mario Splivalo folgendes: > > And then, when I want to fill in the type_var, i do this: > > type_var.member_a := col_a FROM table_a WHERE col_c = 5; > type_var.member_b := col_b FROM table_a WHERE col_c = 5; > > Is there a way to fill in the type_var, but from just one statement? > Here I have two 'selects' on table_a, and that seems as bit expensive > when iterated a lot of times. > > I guess I could do: > SELECT col_a, col_b INTO type_var.member_a, type_var.member_b FROM > table_A WHERE col_c = 5; > > but that is a bit hard to read :) > > Are there more options on doing what I'd like to do? select into type_var col_a, col_b from table_a ... ; HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47215, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===