java - How to make the primary key in JDBC MYSQL case sensitive? -



java - How to make the primary key in JDBC MYSQL case sensitive? -

i have primary key defined string value. 2 tuples primary keys "hello" , "hello" cant exist because primary key case insensitive.

what sql statement create table primary key case insensitive?

you need check constraint uses sub query. since sub-queries not permitted in check constraints can write function runs query , returns result: (assuming pk called id)

create or replace function check_id(id_input in varchar2) homecoming number count_id number; begin select count(*) count_id table upper(id_input) = upper(id); return(count_id); end;

then utilize function in check constraint primary key

check check_id(id) = 0

try , allow me know. have not verified syntax.

java sql database jdbc primary-key

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -