[GENERAL] How to run a procedure

2009-03-19 Thread jc_mich
Hi all I'm new developing procedures in PL/PGSQL. I'm using Query Tool as code editor, but execute query button only mark sintax errors and I want to run my application. How can I test my function? Thanks! -- View this message in context: http://www.nabble.com/How-to-run-a-procedure-tp2260619

[GENERAL] Initializing variables from SQL query

2009-03-19 Thread jc_mich
Hi all I'm new in PL/PGSQL developing, I'm trying to initialize a variable from a SQL query, this query counts some rows, I've made the next code, but it doesn't work. CREATE FUNCTION schema.myFunction() RETURNS BOOLEAN AS $$ DECLARE counter RECORD; BEGIN SELECT * INTO STRICT counter

[GENERAL] PL/PGSQL arithmetic errors

2009-03-30 Thread jc_mich
Hi all! I'm developing an algorithm with PL/PGSQL using statistical operations from a table. I have several differences between expected results and the results generated by the function. I want to know if there are differences in arithmetic operation sintax or if there's any special arithmetic

[GENERAL] Doubt about join queries

2009-04-20 Thread jc_mich
Hello I have a table with clients and other with stores, I want to calculate minimum distances between stores and clients, the client name and its closer store. At this moment I can only get clients ids and minimum distances grouping by client id, but when I try to join their respective store id

Re: [GENERAL] Doubt about join clause

2009-04-20 Thread jc_mich
tance Thanks a lot Bill Moran wrote: > > In response to jc_mich : >> >> Hello >> >> I have a table with clients and other with stores, I want to calculate >> minimum distances between stores and clients, the client name and its >> closer >> st

Re: [GENERAL] Doubt about join queries

2009-04-21 Thread jc_mich
ROM stores, clients WHERE 1=1 ORDER BY stores.id, dist) AS distances GROUP BY distances.client_id; I only want to assign to each store a client in function of the minimum distance between them. Thanks Best regards Filip RembiaƂkowski-3 wrote: > > 2009/4/20 jc_mich > >> >>

Re: [GENERAL] Doubt about join queries

2009-04-21 Thread jc_mich
Thanks a lot! It works as good as I wish Best regards. Michael Nolan wrote: > > On Tue, Apr 21, 2009 at 12:04 PM, jc_mich wrote: > >> >> The problem is not the formula, the problem is the join. I've summarized >> it >> because is a large formula and