X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 47BD33A4299 for ; Thu, 6 Jan 2005 00:54:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93078-07 for ; Thu, 6 Jan 2005 00:53:47 +0000 (GMT) Received: from post5.inre.asu.edu (post5.inre.asu.edu [129.219.110.120]) by svr1.postgresql.org (Postfix) with ESMTP id 0ABE73A4406 for ; Thu, 6 Jan 2005 00:51:26 +0000 (GMT) Received: from conversion.post5.inre.asu.edu by asu.edu (PMDF V6.1-1X6 #30769) id <0I9V00001EC47B@asu.edu> for pgsql-admin@postgresql.org; Wed, 05 Jan 2005 17:50:28 -0700 (MST) Received: from smtp.asu.edu (smtp.asu.edu [129.219.110.107]) by asu.edu (PMDF V6.1-1X6 #30769) with ESMTP id <0I9V00L31EC4VS@asu.edu> for pgsql-admin@postgresql.org; Wed, 05 Jan 2005 17:50:28 -0700 (MST) Received: from moroni.pp.asu.edu (moroni.pp.asu.edu [129.219.69.200]) by smtp.asu.edu (8.12.10/8.12.10/asu_smtp_relay, nullclient, tcp_wrapped) with ESMTP id j060oNMC022206 for ; Wed, 05 Jan 2005 17:50:27 -0700 (MST) Received: by moroni.pp.asu.edu (Postfix, from userid 500) id 1F086F7E; Wed, 05 Jan 2005 17:50:24 -0700 (MST) Date: Wed, 05 Jan 2005 17:50:24 -0700 From: David Bear Subject: query and stored procedures To: pgsql-admin@postgresql.org Reply-To: David.Bear@asu.edu Message-id: <20050106005024.GK374@asu.edu> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200501/30 X-Sequence-Number: 15889 I'm so totally new to postgresql that I'm not sure how to word this. I want to create a query, that does two things 1) take input in the form of a string of numbers, and test if a) is ssn b) or internal id if the string is an ssn, make a second query to another data base, asking it to convert the ssn to our internal id otherwise, 2) use the id given to query an existing table I'm not sure what feature/function postgresql has to help me do this. I'd like to stick with using python as my language, and I'm guessing this would be stored procedure, but I'm too new to know. Please point me to some good reading. -- David Bear phone: 480-965-8257 fax: 480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing"