[GENERAL] Java Ex.

1999-11-17 Thread Jason Leach

hi,

Does anyone have a Java example of connecting to a DB and
executing a simple SQL command?

Thanks,
Jason





[GENERAL] Problem with CREATE RULE something ON DELETE (PostgreSQL only executes the first expression)

1999-11-17 Thread J. Roeleveld

Hi,

I have found what appears to be a bug in PostgreSQL, or is this a feature?
I don't think it's a feature, because the postgreSQL documentation state it
should work.

When creating delete-rules for views, i have found that only the first
expression is being executed, when
using multiple expressions.

I have managed to do this for Insert, and i think for Update as well...
although i haven't gotten around to testing that yet.

The following is the RULE-definition I use, it's for a View (
bedrijven_view ) which consists of
two tables ( adressen_table  and   bedrijven_table ).
When I change the sequence (eg. put the delete from bedrijven_table first)
it still only does the first statement.

CREATE RULE delete_bedrijven_view AS ON DELETE
TO bedrijven_view
DO INSTEAD (
DELETE FROM adressen_table
WHERE adres_id = get_adres_nummer(straatnaam,
huisnummer,postcode,land);
DELETE FROM bedrijven_table
WHERE firma_id = firma_id;
);


If you require more information, for instance a full list of statements
that can reproduce the problem,
please let me know, and I'll forward the bug-report I sent in yesterday
morning.

with kind regards,

Joost Roeleveld

PS. this is not a new problem, someone else reported this before, but he
hasn't found out how to solve
   this problem either.





[GENERAL] sql question

1999-11-17 Thread Herbert Liechti

I have a sql problem which I can't solve. The following table is defined

create table AdressGroup
(
   AdrGroup_Id INTEGER   NOT NULL
 DEFAULT NEXTVAL('adrverw_id_seq'),
   ZeitDATETIME  NOT NULL,
   Group_IdINTEGER   NOT NULL,
   Adress_Id   INTEGER   NOT NULL
);

The table assigns adresses to adressgroups.

I'd like to select the adresses which belongs to one specific adressGroup and to no 
other group. If an adress has more than one entry in the AdressGroup
table it should not be in the projection.

I tried the following:

SELECT * FROM adressGroup
 WHERE Group_Id = 6
   AND EXISTS( SELECT AdrGroup_Id FROM adressGroup ag_alias
WHERE adressGroup.AdrGroup_Id = ag_alias.AdrGroup_Id
GROUP BY AdrGroup_Id HAVING COUNT(*) == 1 );

When I do this I get the following error:
  ERROR:  rewrite: aggregate column of view must be at rigth side in qual
  ERROR:  rewrite: aggregate column of view must be at rigth side in qual


Does anybody knows the solution? Thanks

--
~~~
Herbert LiechtiE-Mail: [EMAIL PROTECTED]
ThinX networked business services   Stahlrain 10, CH-5200 Brugg
~~~








[GENERAL] FW: How to select the millisecond/microsecond parts of the datetime column

1999-11-17 Thread Narayanan, Kannan

 Hello,
 
 Product version: Postgres 6.5.3
 
 SELECT DATETIME('MILLISECOND', 'NOW'::DATETIME) always returns 0(ZERO) and
 so does 'MICROSECOND'. However a reading of the manuals indicate that the
 database supports much higher precision values. How do I retrieve the
 additional precision values (beyond seconds) when I use the datetime
 field? This is a requirement for a conversion project that I am working
 on. Could someone help please. 
 
 Thanks
 Kannan