Skip site navigation (1) Skip section navigation (2)

Re: query and stored procedures

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: David(dot)Bear(at)asu(dot)edu
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: query and stored procedures
Date: 2005-01-06 03:14:22
Message-ID: 41DCAD0E.8050402@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-admin
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(at)commandprompt(dot)com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL


Attachment: jd.vcf
Description: text/x-vcard (285 bytes)

In response to

pgsql-admin by date

Next:From: Thomas LeducDate: 2005-01-06 09:19:01
Subject: Re: postgresql 7.4.6 and pam_ldap
Previous:From: Uwe C. SchroederDate: 2005-01-06 02:12:40
Subject: Re: query and stored procedures

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group