Re: [SQL] MySql 'REPLACE'

2001-04-25 Thread Alessio Bragadini
Thomas Swan wrote: > You should be able to do this with two separate queries inside a > transaction. Yes, sorry, I was not clear enough. Unfortunately, the function I need to write is a "generic" one that takes a number of fields/values and generate a SQL instruction. So, there is no previous in

[SQL] MySql 'REPLACE'

2001-04-25 Thread Alessio Bragadini
I am working in porting the Slash software from MySql to PostgreSQL. I stepped in MySql's REPLACE command (a SQL command) that to my knowledge is not supported by PostgreSQL and it's not standard SQL. According to MySql's manual: "REPLACE works exactly like INSERT, except that if an old record in

[SQL] 'Include' function in SQL scripts

2001-03-30 Thread Alessio Bragadini
I was wondering if PostgreSQL supports some kind of #include between SQL script files, to split a long script in different files. -- Alessio F. Bragadini[EMAIL PROTECTED] APL Financial Services http://village.albourne.com Nicosia, Cyprus phone: +357-2-755750

Re: [SQL] "'" in SQL INSERT statement

2001-01-25 Thread Alessio Bragadini
Markus Wagner wrote: > I have some data that I wish to transfer into a database using perl/DBI. If you use Perl DBI you should issue statements like $dbh->do ('INSERT INTO table (field1, field2) VALUES (?,?)', undef, $value1, $value2); This binding takes care of quoting and escapes all

Re: [SQL] Bounds checking on an alias

2000-12-19 Thread Alessio Bragadini
[EMAIL PROTECTED] wrote: > SELECT DISTINCT tbl_restaurant.restaurant, > tbl_restaurant_location.postal_code, tbl_restaurant_location.latitude > AS latitude, tbl_restaurant_location.longitude AS longitude, distance > (49.24894, -122.90419, latitude, longitude) AS distance FROM > tbl_restaurant, tb

Re: [SQL] Confused by timezones

2000-12-18 Thread Alessio Bragadini
Tom Lane wrote: > I'm guessing that's not a legal timezone name on your platform. > On my box I have to spell it "PST8PDT" ... note that the displayed > abbreviation is not the same as the name used to set the timezone. I used PST as an example, but it doesn't work with any other zone, including

Re: [SQL] Confused by timezones

2000-12-15 Thread Alessio Bragadini
Karel Zak wrote: > Yes it's possible, but in freezed 7.1 *only*. It's 'TZ' and output is Thanks, on my experimental 7.1 works perfectly, another reason to switch as soon as possible. :-) > You must use same names (definitions) as are used in your OS > (an example on Linux at /usr/share/zonein

[SQL] Confused by timezones

2000-12-15 Thread Alessio Bragadini
Sorry, I am trying to find my way in formatting timestamps for different timezones and I am a little confused. [ PostgreSQL 7.0.0 on alphaev6-dec-osf4.0f, compiled by cc ] Let's imagine CREATE TABLE tztest (id SERIAL, v TEXT, ts TIMESTAMP DEFAULT now()); How can I format a SELECT to_char(ts,'