[SQL] Passing a table to PL/pgSQL

2001-02-24 Thread Roberto Mello
Hi, I am trying to learn how can I pass a table to PL/pgSQL functions and what can I do with them. I have heard somethings about these things, but I'd like to know for certain. Especifically: - Can I pass a table to PL/pgSQL? - Can I pass a parameter that

Re: [SQL] greetings

2001-02-24 Thread Ian Lance Taylor
Ken Kline <[EMAIL PROTECTED]> writes: > it is to be server side code > the code I gave you was merely an example > of a cursor that I found when I did a search... > http://www.armed.net/how/pg001676.htm I think Tom addressed how to solve your actual problem. I'll just comment that the examp

Re: [SQL] greetings

2001-02-24 Thread Tom Lane
Ken Kline <[EMAIL PROTECTED]> writes: > orginally what I wanted to do was this: > INSERT INTO pledge_classes (semester, year) > SELECT distinct pseason, pyear from load_bros > WHERE pyear is not null > ANDpseason is not null > order by pyear, pseason; > however pgsql does not allow order by

Re: [SQL] greetings

2001-02-24 Thread Ken Kline
it is to be server side code the code I gave you was merely an example of a cursor that I found when I did a search... http://www.armed.net/how/pg001676.htm orginally what I wanted to do was this: INSERT INTO pledge_classes (semester, year) SELECT distinct pseason, pyear from load_bros WHERE

Re: [SQL] syntax prob

2001-02-24 Thread Tod McQuillin
On Fri, 23 Feb 2001, postgresql wrote: > when doing updates of multiple fields there commas between > the elements? Yes. update t set a=b, c=d where ... > if I could get to the server I would just try it. what happens if you have > only 1 field to update and you add a comma, like this > > up

[SQL] a tricky one

2001-02-24 Thread Olaf Marc Zanger
hi there, something brainboggling :-) three tables: fac with: id | integer | not null default nextval('fac_id_seq'::text) pre with: id | integer | not null default nextval('pre_id_seq'::text) fac_id |

[SQL] sum(bool)?

2001-02-24 Thread Olaf Marc Zanger
hi there, i want to add up the "true" values of a comparison like sum(a>b) it just doesn't work like this any workaround? it is postgresql 7.0 under linux thanks olaf -- soli-con Engineering Zanger, Dipl.-Ing. (FH) Olaf Marc Zanger Lorrainestrasse 23, 3013 Bern / Switzerland fon:+41-31-

Re: [SQL] Estimation of SQL statements

2001-02-24 Thread Richard Huxton
Kevin Quinlan wrote: > > Are there any good techniques that estimate the time it will take to execute > an SQL statement, specifically an INSERT, SELECT, UPDATE, or DELETE? What > factors are important to consider when estimating the execution time of > these types of SQL statements? > Thank you