Create a stored procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sweetsecret
    New Member
    • Aug 2010
    • 2

    #1

    Create a stored procedure

    Create a stored procedure that prints the list of the locations(locat ion_id,street_a ddress,city,cou ntry_name) from the locations table sorted by location id in ascending order along with the total number of employees working at the listed locations. Write an anonymous block that invokes the created stored procedure
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    What's your question?

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      That you can handle by a simple select query itself, you dont need a stored procedure for that:

      something like:

      [code=oracle]
      SELECT location_id,str eet_address,cit y,country_name, (SELECT COUNT(*) FROM emp_table WHERE location_id = l.location_id) emp_count FROM
      locations_table l
      order by location_id

      [/code]

      Comment

      Working...