• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trigers in oracle

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
This is an SOS.
I am writing a trigger on table CUSTOMER whoch has a column ACCOUNTNUMBER.
I want to write a trigger such that if the ACCOUNTNUMBER is already present in he tbale, i want to append 'A' to the accountnumber and then insert it.
for eg: ACCOUNTNUMBER 123 already exists iin the table
when i try to insert again , in trigger shud make it as '123A'
again itf i try to insert it shud increment the alphabet and insert it as '123B'. till 'Z'.
How can i go about doing this..
pls help me sson as i have a deadline to meet. and i am new to oracle...
Thanx in advance
Chhaya
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By any chance is this your homework for a class?
We can't do your homework for you, but there is one thing I can help with
Look at
ASCII('A')
This converts the letter A to an ascii value. The letter B is the next number. So you could theoretically find the MAX letter already used. Convert it to ASCII and add one then convert it back to a character.
Mark
reply
    Bookmark Topic Watch Topic
  • New Topic