Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Wednesday, October 31, 2012

oracle constraint bulma


gelen exceptionlar şu şekilde

ORA-00001: unique constraint (SCHEMA.SYS_C0067078) violated

sağolsun hibernate veya oracle create ederken çok nadide isim seçmiş SYS_C0067078 velhasılı bunu görücne insan bişey anlamıyor. constraintin ilişkili olduğu tablo ve detayı için oracle da

select * from all_constraints
where owner = 'SCHEMA'
and constraint_name = 'SYS_C0067078';

çalıştırmak yeterli.

Thursday, October 25, 2012

how to select hibernate envers audited dates in mysql

just select dates is easy like this

SELECT FROM_UNIXTIME( revtstmp/1000 )   FROM revinfo;

if you want the detailed data result you can do like this.



SELECT r.rev,FROM_UNIXTIME( revtstmp/1000 ),pa.* FROM revinfo r
left join picture_aud pa on pa.rev=r.rev;

well you just need to change table name up there picture to what ever is your table name is.

Friday, January 27, 2012

find all columns in oracle named as district_id

I had a problem today. it was about changing all district_id in a whole database. so I need to find who used district_id as column name in tables in oracle.

here is how I find it.
and I changed all values from found tables.

Wednesday, February 04, 2009

sql joinleri anlamak

benim hayal gücüm pek yoktur biçok şeyi algoritmik düşünüp çözerim. bu resim eminim bi çok insana yardımcı olacaktır.

sql join

Sunday, October 05, 2008

The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

bişeylerle uğraşırken sitelerimden birinde bunu gördüm admin panelinde ulan dedim durup durduk yere noluo. sonradan aklıma geldi ben bu sitenin databaseinde bi field ı ntext yapmıştım meğer ondan dolayı selectdeki order arıza eder olmuş.

çözüm basit order by fieldismi olan yeri order by cast(fielismi as varchar(8000)) gibi bişey yapıosunuz. zaten ilk harfe göre sıralama yapmasını istiodum bu yetioda artıo bile.

speed test hyperoptic