[SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
Hello I have 2 tables. TABLE1 and TABLE2. TABLE1 has about 400 records with details (client code, name, surname, address, date of birth) of my clients. TABLE2 is filled with some of the client details and other extra details (client code, address, telephone, etc) So in my ASP page i have a

Re: [SQL] INSERT INTO

2007-03-16 Thread Bart Degryse
I don't use ASP but in PHP I would do something in the line of $valuetoinsert = SANT'ANGELO LODIGIANO; $query = INSERT INTO TABLE2 (TE_INDI) VALUES (' . str_replace(', '', $valuetoinsert) . '); I'm sure ASP has also a string replacement function Shavonne Marietta Wijesinghe [EMAIL

Re: [SQL] INSERT INTO

2007-03-16 Thread Guillaume Lelarge
Bart Degryse a ecrit le 16/03/2007 10:03: I don't use ASP but in PHP I would do something in the line of $valuetoinsert = SANT'ANGELO LODIGIANO; $query = INSERT INTO TABLE2 (TE_INDI) VALUES (' . str_replace(', '', $valuetoinsert) . '); I'm sure ASP has also a string replacement function

Fw: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
thanks.. i will take a look at the link Shavonne Wijesinghe http://www.studioform.it Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque destinate esclusivamente alle persone o alla Società sopra indicati. La diffusione,

Re: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
i took a look at the link Guillaume gave me. But it also explains on PHP i'm using ASP :( - Original Message - From: Guillaume Lelarge [EMAIL PROTECTED] To: Bart Degryse [EMAIL PROTECTED] Cc: pgsql-sql@postgresql.org; Shavonne Marietta Wijesinghe [EMAIL PROTECTED] Sent: Friday,

Re: [SQL] INSERT INTO

2007-03-16 Thread Guillaume Lelarge
Shavonne Marietta Wijesinghe a ecrit le 16/03/2007 11:31: i took a look at the link Guillaume gave me. But it also explains on PHP i'm using ASP :( Yes, that's why I said that it didn't answer your question. Sorry if this wasn't clear. After a bit of googling, I found the replace function.

Re: [SQL] INSERT INTO

2007-03-16 Thread Richard Broersma Jr
When i have a string that has a ' inside of it the record is not inserted in to TABLE2. I know that writing it twice will fix it but how can i ask my ASP code to do it.. INSERT INTO TABLE2 (TE_INDI) VALUES ('SANT'ANGELO LODIGIANO'); If you are using PostgreSQL = 8.0 you can use dollars

Re: [SQL] INSERT INTO

2007-03-16 Thread Richard Broersma Jr
INSERT INTO TABLE2 (TE_INDI) VALUES ($SANT'ANGELO LODIGIANO$); My mistake, a single $ will not work you need two like $$: INSERT INTO TABLE2 (TE_INDI) VALUES ($$SANT'ANGELO LODIGIANO$$); Regards, Richard Broersma Jr. ---(end of broadcast)---

Re: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
Thanks alot ^_^ Shavonne Wijesinghe http://www.studioform.it - Original Message - From: Richard Broersma Jr [EMAIL PROTECTED] To: Richard Broersma Jr [EMAIL PROTECTED]; Shavonne Marietta Wijesinghe [EMAIL PROTECTED]; pgsql-sql@postgresql.org Sent: Friday, March 16, 2007

Re: [SQL] INSERT INTO

2007-03-16 Thread Alvaro Herrera
Shavonne Marietta Wijesinghe wrote: Thanks alot What happens if you try to insert a string with $$ on it? -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---(end of

[SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Travis Whitton
Given the following test table, I want to grab only the newest record and disregard any older duplicates based on name. Is this the most efficient way to do it? Will the indicies even make a difference? The table below demonstrates a simple proof of concept. My final table will have millions of

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
Travis Whitton [EMAIL PROTECTED] writes: Given the following test table, I want to grab only the newest record and disregard any older duplicates based on name. Is this the most efficient way to do it? No, it's gonna be pretty awful. The best way I know of involves DISTINCT ON (see the

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Travis Whitton
One last question, using the weather report example, is it going to improve performance for the DISTINCT ON query to add an index to the location and time columns? Thanks a lot, Travis On 3/16/07, Tom Lane [EMAIL PROTECTED] wrote: Travis Whitton [EMAIL PROTECTED] writes: Given the following

[SQL] log file permissions?

2007-03-16 Thread Gerardo Herzig
Hi dudes. I have my pg log file rotation configured so i have a psql_`today`.log. The thing is, can i configure postgres so the file permissions (today is 600) could by 640, so developers could login and tailf the logfile (without using the postgres superuser, course)? Thanks! Gerardo

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
Travis Whitton [EMAIL PROTECTED] writes: One last question, using the weather report example, is it going to improve performance for the DISTINCT ON query to add an index to the location and time columns? A two-column index matching the ORDER BY that you use might help, or then again might not

Re: [SQL] log file permissions?

2007-03-16 Thread Steve Crawford
Gerardo Herzig wrote: Hi dudes. I have my pg log file rotation configured so i have a psql_`today`.log. The thing is, can i configure postgres so the file permissions (today is 600) could by 640, so developers could login and tailf the logfile (without using the postgres superuser, course)?

Re: [SQL] log file permissions?

2007-03-16 Thread Tom Lane
Gerardo Herzig [EMAIL PROTECTED] writes: Hi dudes. I have my pg log file rotation configured so i have a psql_`today`.log. The thing is, can i configure postgres so the file permissions (today is 600) could by 640, so developers could login and tailf the logfile (without using the postgres

Re: [SQL] INSERT INTO

2007-03-16 Thread Josh Williams
From: Shavonne Marietta Wijesinghe [EMAIL PROTECTED] I have 2 tables. TABLE1 and TABLE2. TABLE1 has about 400 records with details (client code, name, surname, address, date of birth) of my clients. TABLE2 is filled with some of the client details and other extra details (client code,