Re: [SQL] Odd sort behaviour

2009-09-02 Thread Lew
Rob Sargent wrote: I'm sure this a life-time's worth of discussion on the merits of treating "." as nothing when sorting Well, every sorted reference work in society at large seems to have a different idea of how to sort - just compare the phone book to the dictionary. That's the point

[SQL] Question

2009-09-02 Thread aymen marouani
Hi for all, What is the possible sources of the SQLState 55000 "OBJECT NOT IN PREREQUISITE STATE" ? The error 55000 was triggered when I executed the following query : "select currval('"BatchTreatment_batch_treatment_id_seq"');" Thanks in advance. Cordially.

Re: [SQL] PostgreSQL Function: how to know the number of the returned results of the Query

2009-09-02 Thread Harun Bolat
count aggregate function can be use like this. "SELECT count(rate) into row_count from voiptariff where id= 9;" CREATE OR REPLACE FUNCTION get_credit_time(text, text) RETURNS integer AS $BODY$ DECLARE row_count integer; BEGIN rate numberic(9,4); SELECT count(rate) into row_count from v

Re: [SQL] Question

2009-09-02 Thread Ross J. Reedstrom
On Wed, Sep 02, 2009 at 04:28:34PM +0200, aymen marouani wrote: > Hi for all, > What is the possible sources of the SQLState 55000 "OBJECT NOT IN > PREREQUISITE STATE" ? > The error 55000 was triggered when I executed the following query : > "select currval('"BatchTreatment_batch_treatment_id_seq"'

Re: [SQL] Question

2009-09-02 Thread Rob Sargent
Call nextval first? Too many quotes? aymen marouani wrote: Hi for all, What is the possible sources of the SQLState 55000 "OBJECT NOT IN PREREQUISITE STATE" ? The error 55000 was triggered when I executed the following query : "select currval('"BatchTreatment_batch_treatment_id_seq"');" Tha

[SQL] Question

2009-09-02 Thread aymen marouani
Hi for all, What is the possible sources of the SQLState 55000 "OBJECT NOT IN PREREQUISITE STATE" ? The error 55000 was triggered when I executed the following query : "select currval('"BatchTreatment_batch_treatment_id_seq"');" Thanks in advance. Cordially.

Re: [SQL] Min and max element of an array column

2009-09-02 Thread A. Kretschmer
In response to Gianvito Pio : > Hello, > is it possible to obtain the minimum and the maximum single element of > an array column? > > Example: > [1, 2 ,5] > [3, -1, 6] > [9, 18,-4 ] > > I'd just like to make a query that gives me the min (-4) and the max(18) > of the column. Is that possible w

[SQL] Min and max element of an array column

2009-09-02 Thread Gianvito Pio
Hello, is it possible to obtain the minimum and the maximum single element of an array column? Example: [1, 2 ,5] [3, -1, 6] [9, 18,-4 ] I'd just like to make a query that gives me the min (-4) and the max(18) of the column. Is that possible without a function? Thanks -- Sent via pgsql-sql

Re: [SQL] How to create Function which retruns username and password

2009-09-02 Thread A. Kretschmer
In response to venkat : > Dear All, > >     I want to create function which returns username and password from the > database.I have users table in the database.in that i have username and > password columns.I need return username and password using functions.it is > urgent. I am waiting for your

[SQL] How to create Function which retruns username and password

2009-09-02 Thread venkat
Dear All, I want to create function which returns username and password from the database.I have users table in the database.in that i have username and password columns.I need return username and password using functions.it is urgent. I am waiting for your great response, Thanks, Regards, Ve