From: Joshua D. Drake <jd@commandprompt.com>
To: David.Bear@asu.edu
Cc: pgsql-admin@postgresql.org
Subject: Re: query and stored procedures
Date: Wed, 05 Jan 2005 19:14:22 -0800
Message-ID: <41DCAD0E.8050402@commandprompt.com> (raw)
In-Reply-To: <20050106005024.GK374@asu.edu>
References: <20050106005024.GK374@asu.edu>
David Bear wrote:
>I'm so totally new to postgresql that I'm not sure how to word this.
>
>
>
What you want to do is create a function (store procedure)...
You can use plpythonu to do what you want. So you could create
something like this:
create or replace function check_id(text) returns integer as ...
Sincerely,
Joshua D. Drake
>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.
>
>
>
--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
Attachments:jd.vcf (text/x-vcard, 283B) download
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;PO Box 215 ;Cascade Locks;OR;97014;US
email;internet:jd@commandprompt.com
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
x-mozilla-html:FALSE
url:http://www.commandprompt.com
version:2.1
end:vcard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: jd@commandprompt.com, David.Bear@asu.edu
Subject: Re: query and stored procedures
In-Reply-To: <41DCAD0E.8050402@commandprompt.com>
References: <20050106005024.GK374@asu.edu> <41DCAD0E.8050402@commandprompt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox