title: How to attache a String in generated sequence number
body: <p>In my application, I am using Struts2 for UI and JPA for DAO layer. And Oracle 11G database.</p>
  
  <p>In my database I have created a sequence ..</p>
  
  <pre><code>CREATE SEQUENCE  "PERK"."EMP_CODE_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 501 CACHE 500 NOORDER  NOCYCLE ;
  </code></pre>
  
  <p>Now my requirement is changed. As per the requirement I want to attache "TMP" to my generated  sequence number.</p>
  
  <p>For example : If my sequence no is : 1 then It will give me TMP000001.</p>
  
  <p>For this the SQL query will be like this ..</p>
  
  <pre><code>select 'TMP'||lpad(EMP_CODE_SEQ.nextval,6, '0') test from dual;
  </code></pre>
  
  <p>But is there any way to implement the above query in JPA ? OR is there any way in ORACLE,so we can change the output sequence?</p>