Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic