sql - Create VARCHAR FOR BIT DATA column -


i trying create sql table in netbeans 8.0 1 of columns meant store byte[] (so varbinary type looking for). wizard creation of new table offers me option of varchar bit data, should work, raises syntax error when creating table:

    create table "bank".accounts     (     id numeric not null,     pin varchar bit data not null,     primary key(id)     ) 

the error due presence of word for, manually change statement is

    create table "bank".accounts     (     id numeric not null,     pin "varchar bit data" not null,     primary key(id)     ) 

but problem type not exist. ideas?

thank you.

here's manual page varchar bit data: http://db.apache.org/derby/docs/10.10/ref/rrefsqlj32714.html

note section says:

unlike case char bit data type, there no default length varchar bit data type. maximum size of length value 32,672 bytes.

so problem haven't specified length.

if byte array is, say, 256 bytes long, specify

pin varchar (256) bit data not null, 

you might consider using blob if fits requirements. can see derby data types here: http://db.apache.org/derby/docs/10.10/ref/crefsqlj31068.html


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -