var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How do I set the default value of a new BIT DATA column?
I need to add a new column for 8 bytes of data to a table that will not
be null. The following produces the error below:
ALTER TABLE MSTRDATA.USERS ADD COLUMN ENCRYPTEDPW VARCHAR(8) FOR BIT DATA NOT NULL DEFAULT 0
SQL0574N DEFAULT value or IDENTITY attribute value is not valid for column
"ENCRYPTEDPW" in table "MSTRDATA.USERS". Reason code: "1". SQLSTATE=42894
On the same subject, I cannot find any documentation or examples
on how to work with a BIT DATA column. What is the syntax
for an INSERT, UPDATE, or a QUERY?
Also, for java.sql, I have worked with ints, floats, strings, timestamps,
and a little with blobs, but have no clue, nor can I see any documentation
on how to work with an 8 byte field. Any help would be greatly appreciated.
And the answer is:
ALTER TABLE MSTRDATA.USERS ADD COLUMN ENCRYPTEDPW VARCHAR(8) FOR BIT DATA NOT NULL DEFAULT x'0000000000000000';
iaw, DB2 understands a hex syntax (BUT DOES NOT DOCUMENT IT IN AN
EASY TO FIND PLACE IF AT ALL!!!)
But, I still dont know how to use this with java.sql.*
Last edited by wayneb64; 05-03-04 at
ALTER TABLE MSTRDATA.USERS ADD COLUMN ENCRYPTEDPW VARCHAR(8) FOR BIT DATA NOT NULL DEFAULT '0'
if you select from that table you will see x'31' this is the hexadecimal equivalent.
bit data are not relevant to specific codepage.
I never tried that but can we use 0x000.....
Use PreparedStatement and supply it with a String containing your encrypted password.
Originally Posted by