| From: | "Felipe Schnack" <felipes(at)ritterdosreis(dot)br> |
|---|---|
| To: | pgsql-jdbc(at)postgresql(dot)org |
| Subject: | default values |
| Date: | 2002-11-17 22:30:15 |
| Message-ID: | 20021117213015.M38378@ritterdosreis.br |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
This is the third time I post this message. Nobody have ANY opinion about
it? I mean, I'm willing to implement a solution for this, but I would like to
discuss a little...
Someone wrote to pgsql general list telling that you could insert the
default value of a column using DEFAULT keyword on pgsql 7.3. Example:
INSERT INTO TEST (varcharfield1, varcharfield2) VALUES ('text', DEFAULT)
In this case, the "varcharfield2" column would get its default value (as
defined in CREATE TABLE). I was wondering, how I would do it using
PreparedStatements? If I prepare an SQL like
INSERT INTO TEST (varcharfield1, varcharfield2) VALUES (?, ?)
I need to have some way to set one of the the parameters as DEFAULT, but
how? Using the current JDBC driver I believe is impossible, probably we would
need something like a "setDefault(int)" method in PreparedStatement, where int
is the parameter index. What do you think about it?
Felipe Schnack
Analista de Sistemas
felipes(at)ritterdosreis(dot)br
Cel.: (51)91287530
Linux Counter #281893
Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes(at)ritterdosreis(dot)br
Fone/Fax.: (51)32303328
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Wall | 2002-11-18 00:58:31 | Re: default values |
| Previous Message | Nic Ferrier | 2002-11-16 23:47:44 | Re: streaming result sets: progress |