Re: [SQL]

2004-02-02 Thread Richard Huxton
On Thursday 29 January 2004 12:02, MUKTA wrote: > > res=PQexecute(Conn,"INSERT into table values(a,b,c,d)); > > Is there some special way to insert variables rather than plain values? do > i have to build functions (in sql) or somehting?help! Thanx Yes, but the something you want is probably E

Re: [SQL] Sometimes referential integrity seems not to work

2004-02-02 Thread Jan Wieck
Stephan Szabo wrote: On Sat, 31 Jan 2004, Tom Lane wrote: Stephan Szabo <[EMAIL PROTECTED]> writes: > On Mon, 26 Jan 2004, Enio Schutt Junior wrote: >> In a database I am working, I sometimes have to delete all the records in >> some tables. According to the referential integrity defined in the c

Re: [SQL] Sometimes referential integrity seems not to work

2004-02-02 Thread Rod Taylor
> TRUNCATE cannot be used inside of a transaction, and since 7.3 it checks > for foreign keys. So I guess Enio is getting but ignoring the error In 7.4 truncate is transaction safe. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe comma

Re: [SQL] Sometimes referential integrity seems not to work

2004-02-02 Thread scott.marlowe
On Mon, 2 Feb 2004, Jan Wieck wrote: > Stephan Szabo wrote: > > > On Sat, 31 Jan 2004, Tom Lane wrote: > > > >> Stephan Szabo <[EMAIL PROTECTED]> writes: > >> > On Mon, 26 Jan 2004, Enio Schutt Junior wrote: > >> >> In a database I am working, I sometimes have to delete all the records in > >> >

[SQL] Novice SQL Question

2004-02-02 Thread Terry Lee Tucker
I need to the following query: select distinct event_code, level from logs join stat on (stat.prime is not null) where order_num = 130680; Ok, no problem. Does exactly what I want; however, I need to sort this is a particular way to get the right results. When I try to add the order by clause,

Re: [SQL] Novice SQL Question

2004-02-02 Thread Terry Lee Tucker
To answer my own question: I discoverd that the order by fields had to be in the select list. Apparently, this is a requirement when using "DISTINCT". On Monday 02 February 2004 05:38 pm, Terry Lee Tucker wrote: > I need to the following query: > select distinct event_code, level from logs join

Re: [SQL] Novice SQL Question

2004-02-02 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > If I put this where I thought it should go as in: > select distinct event_code,level from logs join stat on (stat.prime is not > null) where order_num = 130680 order by event_date,event_time,event_secs; > I get the following error: > ERROR: For SELE

[SQL] Outer join

2004-02-02 Thread Russell Shaw
Hi, I'm using postgresql 7.3.4 on debian. I get bad results from a two-table left outer join. First table: select * from descriptions; desc_id | description -+- 909097 | cap 107890 | resis 223940 | ic 447652 | electro (4 rows) Second table: select * from

Re: [SQL] Outer join

2004-02-02 Thread Tomasz Myrta
Dnia 2004-02-03 07:28, Użytkownik Russell Shaw napisał: Hi, I'm using postgresql 7.3.4 on debian. I get bad results from a two-table left outer join. First table: select * from descriptions; desc_id | description -+- 909097 | cap 107890 | resis 223940 | ic

Re: [SQL] Outer join

2004-02-02 Thread Russell Shaw
Tomasz Myrta wrote: Dnia 2004-02-03 07:28, Użytkownik Russell Shaw napisał: Hi, I'm using postgresql 7.3.4 on debian. I get bad results from a two-table left outer join. First table: select * from descriptions; desc_id | description -+- 909097 | cap 107890 | resis