Re: [SQL] problem with date

2000-07-10 Thread DalTech - Continuing Technical Education
Try NULL rather than ''. '' is not a null in postgres. - Original Message - From: Shalini shikha <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 10, 2000 3:15 PM Subject: [SQL] problem with date > How can I insert/update a null value in a date field. If a try a sql > s

Re: [SQL] MAX() of 0 records.

2000-07-07 Thread DalTech - Continuing Technical Education
> UPDATE entry_stats > SET entry_maxprice=MAX(item_price) > FROM item > WHERE item.item_entry_id=NEW.item_entry_id > AND item.item_live = 't'; Try COALESCE(MAX(item_price),0) Christopher J.D. Currie Computer Technician Dalhousie: DalTech - CTE _

Re: [SQL] Running queries from scripts.

2000-07-06 Thread DalTech - Continuing Technical Education
> It works for me, for example, this way: > athens% psql -d template1 -c "select datname from pg_database" Thanks, I feel a little sheepish at not trying it with quotes around the query, but the manuals don't mention that you have to enclose the query in quotes when you use the -c option. -Chris

[SQL] Running queries from scripts.

2000-07-06 Thread DalTech - Continuing Technical Education
I was wondering if anyone could help me out with the syntax of running queries from a unix script.   psql -c select 'I am a dummy' -d dbname  - never seems to work.  I've tried variations on the command line, but to no success.   Does the -c option work?   Cheers, Christopher Currie _

Re: [SQL] Re: unique sequences

2000-06-27 Thread DalTech - Continuing Technical Education
I imagine it should if you create a unique index on the field. Cheers, Christopher Currie - Original Message - From: K Parker <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 27, 2000 1:52 AM Subject: [SQL] Re: unique sequences > > Rather, each time you wish to do an in

[SQL] Does anyone know of a function equivilant to Oracle's decode function?

2000-06-20 Thread DalTech - Continuing Technical Education
I have not seen much information about this anywhere on the web.   If anyone has seen, or written a function similar, could you please let me know where?   Thanks.