Skip to Content
0
Former Member
May 02, 2013 at 04:08 AM

How to write a store procedure for sybase IQ with the following points

33 Views

I am trying t write a store procedure for below points below, please help me to write one...

  • IsPackageDownloaded – Checks an input trigger file name against the PackageHeader table to see if it exists and was previously downloaded/processed.
  • UpdateAsDeleted – This marks a given InvestmentVehicleId in the InvestmentVehicle table with a StatusFlag = ‘D’ and a DeletedDate of the current date.
  • UpdateAsUnderReview – This marks a given InvestmentVehicleId in the InvestmentVehicle table with a StatusFlag = ‘U’ and a UnderReviewDate of the current date.
  • UpdateStagingTables – This updates a set of records in the staging tables from the load tables per InvestmentVehicleId. If the InvestmentVehicleId is marked as deleted (StatusFlag = ‘D’ in the InvestmentVehicle table) it will not be updated.

UpdateStagingTablesForPackage – This is only a proposed procedure – this would take all of the InvestmentVehicleIds in the InvestmentVehicle table and create a cursor, processing each ID by calling UpdateStagingTables. This step may be done by calling from the console code instead, which would be a call to get all the IDs from InvestmentVehicle table and repeatedly call UpdateStagingTables.