[SQL] Data Type precision

2000-09-26 Thread Jerome Raupach
CREATE TABLE TR (f1 FLOAT4, f2 INT4, f3 INT4) ; UPDATE TR SET f1=f2/f3::FLOAT4 ; f1 -> xx,xx - but I want f1 -> xx,xx. (6,6) (6,2) anybody can help me ? Thanks. Jerome.

[SQL] Error with DISTINCT

2000-09-15 Thread Jerome Raupach
testdb=#SELECT DISTINCT table_2.f1, table_1.f2, '2000-08-22' AS testdb-#date FROM table_1, table_2 WHERE table_1.f1 = table_2.f1; ERROR: Unable to identify an ordering operator '<' for type 'unknown' Use an explicit ordering operator or modify the query I must execute this query : testd

Re: [SQL] work on some tables in the same time.

2000-09-13 Thread Jerome Raupach
Thanks, but: testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM table1_n; ERROR: DISTINCT not supported in views Jerome. Ian Turner wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I want to execute this query on some table2 in the same time : > > > > INS

[SQL] work on some tables in the same time.

2000-09-13 Thread Jerome Raupach
I want to execute this query on some table2 in the same time : INSERT INTO table2_n(f1, f2, f3) SELECT DISTINCT f1, f2, f3 FROM table1_n ; -- CREATE TABLE table1_1( INT2 f1, INT2 f2, INT2 f3, INT2 f4 ); CREATE TABLE table1_

[SQL] performance on insert/update

2000-08-29 Thread Jerome Raupach
I have a big problem of performance, please help me. it is my work : first : COPY table1 FROM 'file'-> 43s, INSERT INTO table2 -> 34s, UPDATE table2 -> 1mn 29s ( =2m 46s : OK) second : COPY table1 FROM 'same file' -> 1m 10s, INSERT

[SQL] [Fwd: Optimization in C]

2000-08-18 Thread Jerome Raupach
This solution isn't good when there are +1 tuples in the table, it's slowly... anybody can help me ? : string = "SELECT service, noeud, rubrique FROM table" ; res = PQexec( conn, string.data() ) ; if ( (! res) || (status = PQresultStatus( res ) != PGRES_TUPLES_OK)

[SQL] optimization in C

2000-08-17 Thread Jerome Raupach
This solution isn't good when there are +1 tuples in the table, it's slowly... anybody can help me ? : string = "SELECT service, noeud, rubrique FROM table" ; res = PQexec( conn, string.data() ) ; if ( (! res) || (status = PQresultStatus( res ) != PGRES_TUPLES_OK) )

[SQL] optimization in C

2000-08-17 Thread Jerome Raupach
in C, I work on a database (4 table). COPY FROM file ; SELECT, INSERT, UPDATE, DELETE for a result in the last table. COPY TO file ; in the file, are stored 1 informations. -> It's slowly !!! Can you help me for optimization this? I

[SQL] copy with libpq?

2000-08-01 Thread Jerome Raupach
I want to use copy ( file -> db ) with a command in C. How do i? Thanks.

[SQL] result in a variable?

2000-07-31 Thread Jerome Raupach
In a program writes in C. I want to store the result, of a count(*), in a variable. can I do, and How ? Thanks.

[SQL] Compile

2000-07-27 Thread Jerome Raupach
I must compile my program (who is accessing to DB) with g++, but his methods are using by another program who is compiling in CC. how do i ? thanks.

[SQL] Exec query

2000-07-26 Thread Jerome Raupach
Hi, what's the diffence, and is it well? : PgDatabase data(dbname) ; -> data.ExecCommandOk("SELECT * FROM table") ; -> data.ExecTuplesOk("SELECT * FROM table") ; thanks.

[SQL] command in C++

2000-07-25 Thread Jerome Raupach
am i use "PQexec()" or "conn.query()" for inserting informations in my BD ? thanks. Jerome.