Hello
Is there a way to find out if the EXECUTE of a UPDATE, INSERT has been
completed successfully?
Here is an example of what I do:
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Form_Store_PSQL"
Set oRs = Server.CreateObject("ADODB.Recordset" )
strSQL = "INSERT INTO TABLE_TEM
Hello
I'm having some trouble checking if a table exist before i create it.
Example:
SELECT * FROM distributors
IF (table not found) THEN
CREATE TABLE distributors (
did integer,
namevarchar(40),
UNIQUE(name)
);
END IF
If i have a table like the above h
I managed to make the connection work. I tried inserting records from 2
computers. It works fine untill 2 computers insert a nextwall one after
another.
Here is a small example of what i see in my DB
++|+|++
N °| Session| Number
+
This is the test i did for the connection.
' Connecting to the database
WriteToFile logfilepath, date & " " & time & "isobject(conn) = " &
isobject(session("connection")) & vbcrlf , True
if not isobject(session("connection")) then
Set conn = Server.CreateObject("ADODB.Connection")
conn.Op
Hello
I'm using Nextval and Currval in my ASP programme. But everytime i run the code
only the nextval record is inserted and the currval record is lost. I wrote the
INSERT INTO in the log and when i tried it via pgadmin both the records were
inserted correctly, so there is no syntax error.
I
Hello
I'm trying to connect to my postgresql db from a JSP page but my db is on one
computer and the jsp in another..
Has anyone done something like this before??
private synchronized Connection getConnection() throws ClassNotFoundException,
SQLException {
final String DRIVER = "org
Thanks.. So it was a uppercase problem ;)
Shavonne.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Strange coz i created the table. Why doesn't it seem to find it??
CREATE TABLE "REGIONI"
(
"AREA" int4,
"PERIMETER" int4,
"REGIONI_" int4,
"REGIONI_ID" int4,
"COD_REG" int4,
"REGIONE" text
)
WITHOUT OIDS;
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to yo
Thanks. I tried the following command
COPY REGIONI FROM
'C:/Inetpub/wwwroot2/FORMWebSite1/database/FormAjax/REGIONI.copy' WITH
DELIMITER '\t';
But i get this error
ERROR: relation "regioni" does not exist
Here is a sample of my file (fields seperated with a tab)
1360077,00 848351,00 2
Hello
I have a db in MS Access 97 and now i have to import the data in PostgreSQL. I
can create the table structure in PostgreSql but in what format can i export
the table from Access so Postgresql can read it?
Thanks
Shavonne
I wrote the query in the SQL windows provided by the pgadmin.
According to the examples in "Chapter 35. PL/pgSQL - SQL Procedural
Language" i don't see what i did different.
BEGIN
SAVEPOINT s1;
... code here ...
EXCEPTION
WHEN ... THEN
ROLLBACK TO s1;
ing wrong with the code..
Shavonne
- Original Message -
From: "Teemu Torma" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, February 26, 2008 4:17 PM
Subject: Re: [SQL] duplicate key violates unique constraint
On Tuesday 26 February 2008, Shavonne Marietta Wijesinghe wrote:
Duri
Hello
During an "INSERT INTO" I get an "Error - duplicate key violates unique
constraint"
Is there any way, that i can test the error. Something like this??
IF error = "duplicate key violates unique constraint" then
do something
else
insert into
end if
Thanks
Shavonne
Hello
I have 2 records with the same value. Even when i do a select with DISTINCT, it
returns me both the records instead of one.
SELECT DISTINCT ON (TE_COGNOME) TE_COGNOME, TE_NOME, N_GEN_TEST, TE_SESSO,
TE_ATTNASC, TE_LUONASC, TE_INDI, TE_DTNASC, TE_PROVSTATO, TE_PROV,
TE_PATERNITA, TE_RICH
But how is it possible to know if some other user is reading the db??
Thanks
- Original Message -
From: "Richard Huxton" <[EMAIL PROTECTED]>
To: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
Cc: "Jean-David Beyer" <[EMAIL PROTECTED]&g
;. Sadly both the current users get the value "6".
Have i set the isolation level correctly??
Thanks
Shavonne
- Original Message -
From: "Jean-David Beyer" <[EMAIL PROTECTED]>
To:
Sent: Monday, February 11, 2008 5:55 PM
Subject: Re: [SQL] Check before IN
ossible to change the SQL string before it does the
update.. But i can't seem to find a solution for it.. Any idea ??
Thanks,
Shavonne
- Original Message -
From: "Gregory Stark" <[EMAIL PROTECTED]>
To: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]&g
ehmm and where is it said that N_GEN should add 1 before inserting the record??
sorry i don't understand the help.
Shavonne
- Original Message -
From: Kopljan Michael
To: 'Shavonne Marietta Wijesinghe'
Sent: Monday, February 11, 2008 1:45 PM
Subject: RE: [SQ
My table structure
CREATE TABLE my_shevi
(
id text,
n_gen serial NOT NULL,
n_sheet serial NOT NULL,
tot_sheet serial NOT NULL,
CONSTRAINT my_shevi_pkey PRIMARY KEY (n_gen, n_sheet, tot_sheet)
)
WITH OIDS;
ALTER TABLE my_shevi OWNER TO postgres;
The user updates the DB via ASP. When 2 u
Thanks alot Shane..Just what I wanted.. Didn't think of a solution with 3
primary keys.
Have a nice day ^___^
Shavonne Wijesinghe
www.studioform.it
- Original Message -
From: "Shane Ambler" <[EMAIL PROTECTED]>
To: "Shavonne Marietta Wijesinghe"
Hello
I am working with a database that has a Index number defined as Serial NOT NULL
I used this because,
1. I want to make sure that when many users login at the same time the Index
number won't be repeated.
2. I don't have to increment it by programming (I use ASP)
But now i have a situation
]>
To:
Sent: Thursday, April 05, 2007 12:05 PM
Subject: Re: [SQL] Insert only if not found
am Thu, dem 05.04.2007, um 11:47:35 +0200 mailte Shavonne Marietta
Wijesinghe folgendes:
I think i spoke to soon. It works. But if i change a letter from capital
to
simple it inserts my record 2 ti
#x27; AND
TE_DTNASC='01/05/2006');
but this doesn't work. I don't know why. If i try only the part
SELECT upper(TE_COGNOME), upper(TE_NOME), upper(TE_SESSO), TE_DTNASC FROM
MOD48_02
it returns me the fields in UPPERCASE. It's really strange why it doens't
work
Hello everyone..
Here is the result of my Insert. and also the insert works ok.
INSERT INTO MOD48_02 (ID, TE_INDI, TE_COGNOME, TE_NOME, TE_SESSO, TE_ATTNASC,
TE_LUONASC, TE_DTNASC, TE_PROVSTATO, TE_PROV, TE_PATERNITA, TE_RICHIESTA,
USERNAME, DATE_INSERTED, TIME_INSERTED) VALUES ('12700120074510
, dem 05.04.2007, um 10:38:21 +0200 mailte Shavonne Marietta
Wijesinghe folgendes:
Hello everyone..
Here is the result of my Insert. and also the insert works ok.
INSERT INTO MOD48_02 (ID, TE_INDI, TE_COGNOME, TE_NOME, TE_SESSO,
TE_ATTNASC,
TE_LUONASC, TE_DTNASC, TE_PROVSTATO, TE_PROV, TE_PATERNI
I'm mixed up now. I was suppose to something but i did something else.
OK so i have my FAMOUS table with the n_gen serial NOT NULL
I got lost a bit. When and where do i use the setval() ??
For example i INSERT records via ASP. so i should put the setval() in the
INSERT INTO of the ASP page??
A
R: syntax error at or near "nextval" at character 38
What should i do?
Shavonne Wijesinghe
- Original Message -
From: "A. Kretschmer" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 03, 2007 11:32 AM
Subject: Re: [SQL] Serial
am Tue, dem 03.04.2007, um 11:
Ok so i'm posting alot in the forums. Anyway for a change i have another
problem ^___^
I have a table that has a field n_gen serial NOT NULL
ermm let me explain. I have 5 records inserted (n_gen = 1, 2, 3, 4, 5)
At a surtain point i DELETE the record 2 and UPDATE the record 5 with the n_gen
2
17 PM
Subject: Re: [SQL] Update problem.
On Mon, Apr 02, 2007 at 04:52:46PM +0200, Shavonne Marietta Wijesinghe
wrote:
At a surtain point i need to replace a record with another
For example i have inserted 4 records. (1, 2 , 3 , 4) I need to
replace all the values from the record 4 to the
Hello
I have a table created as the following
CREATE TABLE mod48_00_2007
(
id text,
n_gen serial NOT NULL,
formstore text,
te_cognome text,
te_paternita text,
te_nome text,
te_sesso text,
te_dtnasc text,
te_attnasc text,
te_luonasc text,
te_provstato text,
te_indi text,
Hello
I have a table created as the following
CREATE TABLE mod48_00_2007
(
id text,
n_gen serial NOT NULL,
formstore text,
te_cognome text,
te_paternita text,
te_nome text,
te_sesso text,
te_dtnasc text,
te_attnasc text,
te_luonasc text,
te_provstato text,
te_indi text,
Hello
I have a postgresql table and i do a select via ASP
strSQL = "SELECT * FROM " & MioTabella & " WHERE TRIM(date_inserted) >= '" &
datainizio & "' AND TRIM(date_inserted) <= '" & datafine & "'"
oRs.open strSQL,oConn,3
schede = oRs.RecordCount
Do until oRs.EOF
sch_sin = cint(sch_sin) + cin
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 PROTEC
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: ; "Shavonne Marietta Wijesinghe"
&l
not to be relied
upon by any person other than the addressee, except with our prior written
approval. If you received this message please send an e-mail to the se
- Original Message -
From: "Guillaume Lelarge" <[EMAIL PROTECTED]>
To: "Bart Degryse" <[EMA
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 sel
When i alter a table and add a new column it always adds it to the end of the
table. Is there any way to tell it to add the new column at the 5th position or
to add the new column after a surtain column.
Thanks
Shavonne Wijesinghe
http://www.studioform.it
else is unauthorized. It is not to be relied
upon by any person other than the addressee, except with our prior written
approval. If you received this message please send an e-mail to the se
- Original Message -
From: "Rodrigo De León" <[EMAIL PROTECTED]>
To:
C
León" <[EMAIL PROTECTED]>
To:
Cc: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2007 3:09 PM
Subject: Re: [SQL] CREATE TABLE
On 3/9/07, Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]>
wrote:
Hello
From my asp page i create a
Hello
>From my asp page i create a table
TableName = "CON01"
strSQL = "CREATE TABLE " & TableName & " ( ID text, N_GEN serial not null);"
But the problem i have is that when i go and open my database in pgadmin the
table name and coloumn name is written in lowercase :(
How do i ask it to
Thanks alot Mario. It did exactly what i wanted. I shall also take alook at the
link you gave for more details..
Shavonne Wijesinghe
- Original Message -
From: M.P.Dankoor
To: Shavonne Marietta Wijesinghe
Cc: pgsql-sql@postgresql.org
Sent: Wednesday, March 07, 2007 12:57
Hello
I have created a table
CREATE TABLE MOD48_00_2007 ( ID text, N_GEN int PRIMARY KEY, FORMSTORE text,
COD_NOTAIO text, PA_COGNOME text);
And i insert the rows via a form in ASP. When the form loads i have a functin
that goes and gets the value of the field N_GEN adds 1 to it and shows it to
i figured it out
Set oRs = oConn.Execute("SELECT N_GEN FROM " & MyTable & " ORDER BY N_GEN::INT
DESC")
thanks to everyone
- Original Message -
From: Shavonne Marietta Wijesinghe
To: pgsql-sql@postgresql.org
Sent: Tuesday, March 06, 2007 3:32 PM
S
alue = clng(oRs("N_GEN")) + 1
In the last two cases make sure that the function or property get returns an
int or long
Also remember that if oRs("N_GEN") is NULL the sum will also be NULL
>>> "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
Hello
i have a column N_GEN in postgreSql defined as text. In this coloumn i insert a
number 10
N_GEN (text) = 10
on error resume next
Set oRs = oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC")
If err <> 0 then 'If table not found
GetFieldValue = "1"
else
GetFieldVal
day, February 19, 2007 4:25 PM
Subject: Re: [SQL] Uppercase and Lowercase
Replace && by ||
>>> "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> 2007-02-19 16:22 >>>
Hello
In my PostgreSQL database i have records inserted in Uppercase.
Hello
In my PostgreSQL database i have records inserted in Uppercase.
For example: VIA SENATO
What i want is to change them to "Via Senato". Ofcourse i'm looking for a
automatico way. I wrote this code update registro1 set pa_indirizzo =
upper(substr(pa_indirizzo, 1, 1)) && lower(substr(pa_ind
how
can i do a query with 2 databases??
I have 2 schemas "operativo" and "autore" and they both have a table "PECDT00"
i want to create a function with the following sql
command (using the programme pgadmin 3) in pgadmin 3 there is a small wizard to
fill when u create a function and u have to add the return type..
this is the
Hello
How can i copy a table from one schema to
another..
Example..
* I have a database "mydatabase"
* then i have 2 schemas "myschema1" and
"myschema2"
* in "myschema1" i have inserted a new line and i
want to copy that to "myschema2" so they both will be same..
How can i do it with
HelloI have 2
postgreSQL databases called "DATA1" and "DATA2" with several tables inside them
(table A, B, C). I modify the details in table "A" in database "DATA1"
How can I copy table "A" from database "DATA1" and paste it in database
"DATA2" using the same table name ??Thank you.
Hey!!
I have a problem and i hope this is the correct section to post it!!!
When i use the COPY Table Name FROM Location command to insert values to a
table using a txt file, the programme gives me errors when he finds letter
as "ò, è, à" inside the txt file.
But when i use the insert command
52 matches
Mail list logo