Re: [SQL] Exceptions when 0 rows affected.

2004-05-10 Thread Andrei Bintintan
Hi Stef, Your problem depends on what interface/programming language you're using. In a Begin End transaction you will have to verify if the returned data is good for you so then you decide if you run at the end "COMMIT" or "ROLLBACK". In php (and where is compatible) I suggest this: //this is p

[SQL] Subqueries returning more than one value?

2004-05-10 Thread Adam Witney
Hi, I am using a function in a subquery, this works ok: SELECT name, (SELECT p_my_func(1)) AS id FROM test; However I would like to have the function return 2 values into the main query... Something like this: SELECT name, (SELECT p_my_func(1)) AS (id, type) FROM test; Of course this give

[SQL] Exceptions when 0 rows affected.

2004-05-10 Thread Stef
Hi all, I've been looking on Google,the archives and documentation, but cannot find what I'm looking for. Maybe I've read the answer, but it's still evading me. I'm working with postgres 7.3.4 using the psql client. I want to know if it's possible to raise an error in a transactional BEGIN->EN

[SQL] Trigger function to know which fields are being updated

2004-05-10 Thread Bernard Cheung
I am writing a trigger function. How can I know which fields are being updated in the PL/SQL function? For example I have a table here: CREATE TABLE COMPANY ( COMPANY_ID VARCHAR(10) NOT NULL, NAME VARCHAR(30), ADDRESS VARCHAR(30)); I want to write a trigger to block all update statements with

Re: [SQL] SELECT - ORDER BY Croatian characters ....

2004-05-10 Thread Kornelije Rabuzin
Thanks, but the problem is that I'm not using this database alone and there exist also some other users; so I've found this locale setings (lc_collate), but this cannot be changed because some indexes will be probably damaged. so database is not set up properly.. but I've started to work

[SQL] update table where rows are selected by inner join?

2004-05-10 Thread Jeff Kowalczyk
I have two tables orders and customerpaymentnote, which keep denormalized columns of the status in rows related by orderid. The column duplication is intentional, to ease end-user ad-hoc queries. I don't understand the UPDATE FROM clause at: http://www.postgresql.org/docs/7.4/static/sql-update.html

Re: [SQL] Trigger function to know which fields are being updated

2004-05-10 Thread Jeff Eckermann
--- Bernard Cheung <[EMAIL PROTECTED]> wrote: > I am writing a trigger function. How can I know > which fields are being > updated in the PL/SQL function? > > For example I have a table here: > > > CREATE TABLE COMPANY ( > COMPANY_ID VARCHAR(10) NOT NULL, > NAME VARCHAR(30), > ADDRESS VA

Re: [SQL] update table where rows are selected by inner join?

2004-05-10 Thread Stephan Szabo
On Mon, 10 May 2004, Jeff Kowalczyk wrote: > I have two tables orders and customerpaymentnote, which keep denormalized > columns of the status in rows related by orderid. The column duplication > is intentional, to ease end-user ad-hoc queries. I don't understand the > UPDATE FROM clause at: > htt

[SQL] working with schema

2004-05-10 Thread William Anthony Lim
Hi all, I'm just experimenting with schema usage. I'm going to use it as a fake 'multi-database' system. Is Postgresql support coding schema name using string variable so I can pass it with parameter? I'm give u an example: I have schema: D200401,D200402.D200403,D200404, etc. I've set my user

Re: [SQL] working with schema

2004-05-10 Thread Christoph Haller
> > Hi all, > > I'm just experimenting with schema usage. I'm going to use it as a fake > 'multi-database' system. Is Postgresql support coding schema name using string > variable so I can pass it with parameter? I'm give u an example: > > I have schema: D200401,D200402.D200403,D200404, etc. >

Re: [SQL] not really SQL but I need info on BLOBs

2004-05-10 Thread Theodore Petrosky
Denis, Interesting, have you had any experience using a SAN for the images? Do you know anyone that has successfully used a SAN to store images that are accessable to multiple servers? I do not, however the last place I worked was in the beginning stages of putting in a SAN. As it was explained,