Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Data base insert problem

Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to hibernate implementation; I did normal insertions (just simple insert queries) with hibernate successfully. I struck up with a problem where I need to insert data with sub query (dynamic).
Query is:
INSERT INTO "CREDIT_CARD" (CNUMBER,CTYPE, EXPDATE,CUID,LAST_UPDATE) VALUES ((select tcrypt.tencrypt('234509873333') from dual),'AMEX','060627',43903873,sysdate);

Here my question is how can I execute �select tcrypt.tencrypt('234509873333') from dual� which is inside a Query.
I did one way is that, writing this as Native SQL and insert into data base.
Please suggest is there any alternative to execute the above query.
Thanks in advance
    Bookmark Topic Watch Topic
  • New Topic