Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread paallen
Joel, To avoid ms access from managing the query, use a pass-through query. Then access will send the raw sql statment to psql and psql will return just the results to access. It will speed things up a bit too for large datasets. Phillip allen Sent via BlackBerry by AT&T -Original Messag

[SQL] Update Field with function/data from other tables?

2007-04-06 Thread paallen
Hi all, I want to update the values of a column with the result of a function that requires information from another table. Specifically it needs a minium and maximum value from another table. How do I perform the update query? Below is my attempt but it doesn't work. The "bhlineid" is my prim

[SQL] Permissions Query?

2007-01-19 Thread paallen
Hi all, still working on dabo a bit. Thanks for all the earlier suggestions, they are working well. I now want to know if the user/role has permision to the schema.table. How do I query to pgsql to know what permissions a particular user has on the table? I was thinking something along the line

Re: [SQL] Query to return schema/table/columname/columntype

2007-01-19 Thread paallen
Hi all, I think I have fixed my own problem. At: http://developer.postgresql.org/~momjian/upgrade_tips_7.3 I found the answer which was: SELECT a.attrelid as oid, a.attname, t.typname FROM pg_attribute a inner join pg_type t on a.atttypid = t.oid WHERE a.attrelid = 'co.hole_tes

[SQL] Query to return schema/table/columname/columntype

2007-01-19 Thread paallen
Hi all, I am trying to modify the dabo (a python wxpython ide for database forms creation) code to allow the selection of tables in any schema. I need a query that will return records with schema, table, columname and columne type. For background I am selecting table & schema by the query: SELEC

Fw: [SQL] How to FindNearest

2006-10-03 Thread paallen
I guess I explained that very poorly. Sorry. It is actually much simplier. I have 3 tables Hole Hole_id X Y Z Down_hole_survey Hole_id Depth_meters Azimuth Vertical_inclination X Y Z Sample Hole_id Depth_meters X Y Z Hole_id is a primary key in the hole table

[SQL] Update 3 columns w/ 1 function calc 3 values?

2006-10-03 Thread paallen
Hi all, I am moving some of my old MS Access functions to plpgsql. My function was made to return coordinates, X,Y,Z for a point along a curved line. So it is not the fastest of functions because it has to call and query data from 3 different tables. I used to just create 3 wrapper functions fo

[SQL] Joint a table back on itself?

2006-09-12 Thread paallen
Hi all, I have a union query that generates a table with directional measurments (a=azimuth, i=depth) at various depths (md) down a hole. The results look like: hole_id | md | a| i|e |n |v ---++++--