2

I want to store the latest build number and date in the comment header section of my Oracle Procedures. I have searched on this topic but have only found storing dates and number in tables and not what I need.

Back story - in the middle of a botched deploy I had to file diff procedures to confirm the latest and greatest was deployed as expected. We have grown from a start up to more of an enterprise and are trying to get better processes in place. Most of our procedures do not have headers and developers do not often add modifications/dates to them. I want to update a build version and date in the comment header as a result of the deployment action. We are using Hudson to automate deploys. I believe I should be able to add something to the header and update that via Hudson during the deploy. Then, confirmation that the latest and greatest is there would be at a glance instead of having to wade through a file diff.

I have used Google and searched other sites to no avail. Any help would be greatly appreciated.

Thanks!

Nat Ritmeyer
  • 5,634
  • 8
  • 45
  • 58
  • 3
    What type of version control are you using? We've used SVN with Hudson for automated builds; and in SVN you can write the build number into your files as a SVN property. – WoMo Oct 05 '12 at 22:32
  • We use SVN and TFS primarily, although some utility stuff is kept in Mercurial. I suspect SVN would be the one with objects we need to update. – user1724182 Oct 09 '12 at 15:18
  • I did hear back from a contact at my old job and it seems it is a function of their source control as well. – user1724182 Oct 09 '12 at 15:18
  • If you use SVN, your question is a near duplicate of http://stackoverflow.com/questions/1142999/versioning-build-numbers-with-tortoisesvn. – jva Oct 17 '12 at 06:02

1 Answers1

0

You must ensure that all information you need to store within header comments must be after package/procedure/function declaration, it means

/* Build :
   Date:
*/
CREATE OR REPLACE PACKAGE SAMPLE AS
  function...
  procedure...
END SAMPLE;
/

Does not work because all comments are removed after compilation. Instead use:

CREATE OR REPLACE PACKAGE SAMPLE AS
/* Build :
   Date:
*/
  function...
  procedure...
END SAMPLE;
/

Comments will be stored as part of store procedure.

Additionally, you must ensure that you have a previous process (automatic or manuaally) to update build information within procedure header.

hth

Osy
  • 1,613
  • 5
  • 21
  • 35