Home » SQL & PL/SQL » SQL & PL/SQL » how to write below procedure
how to write below procedure [message #646856] Tue, 12 January 2016 02:56 Go to next message
ram7aj1a0235
Messages: 7
Registered: January 2016
Junior Member
actually i had two tables one is staff table and other one is medical speciality table and both are interlinked by staff_id,and in staff table date hired column is there and in medical speciality date awarded column is there and my requirement is date hired should be greater than date awarded,otherwise raise an error.
i want to create a procedure for this one.
Re: how to write below procedure [message #646858 is a reply to message #646856] Tue, 12 January 2016 03:09 Go to previous messageGo to next message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
So what's stopping you?
We're not a code writing service but if you get stuck on a particular point and show us what you've done we'll be happy to help.
Re: how to write below procedure [message #646860 is a reply to message #646856] Tue, 12 January 2016 03:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

In addition to CM's answer:
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: how to write below procedure [message #646868 is a reply to message #646860] Tue, 12 January 2016 09:24 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>i want to create a procedure for this one.
a CHECK constraint would be better, IMO.
Re: how to write below procedure [message #646869 is a reply to message #646868] Tue, 12 January 2016 09:43 Go to previous messageGo to next message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
the dates are on separate tables.
Re: how to write below procedure [message #646873 is a reply to message #646869] Tue, 12 January 2016 11:57 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Do you want an error generated immediately or the data fixed immediately (use a trigger) or simply a report where the data needs to be fixed (a simple sql query)
Re: how to write below procedure [message #646881 is a reply to message #646873] Wed, 13 January 2016 02:21 Go to previous messageGo to next message
ram7aj1a0235
Messages: 7
Registered: January 2016
Junior Member
yes dates are on separate tables
Re: how to write below procedure [message #646882 is a reply to message #646881] Wed, 13 January 2016 02:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Michel Cadot wrote on Tue, 12 January 2016 10:44

In addition to CM's answer:
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: how to write below procedure [message #646884 is a reply to message #646869] Wed, 13 January 2016 04:00 Go to previous message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
cookiemonster wrote on Tue, 12 January 2016 15:43
the dates are on separate tables.

True, but you could always create a view with an appropriate where clause and a with check option to achieve the same...
Previous Topic: To Log DBMS in a file from procedure
Next Topic: Odd case of removing duplicates within a set.
Goto Forum:
  


Current Time: Wed Jun 24 20:41:00 CDT 2026