Friday, 9 August 2013

Dynamic query for a procedure

Dynamic query for a procedure

I am new to oracle and i have a requirement to generate a procedure,hope
someone will help with that 1.There is a table x with username,area(only 4
values are possible for this column say chennai,mumbai,delhi,assam) and
count column
2.I need a procedure which will get the count for each area for a
particular user and store it in a procedure
variables(Chennai_cnt,Mumbai_cnt,Delhi_cnt,Assam_cnt),
say if a user 'ME' has only three area
User Area Count
ME Chennai 4
ME Delhi 23
ME Assam 65
then the variables values should be saved as Chennai_cnt=4,Mumbai_cnt=0(as
there is no entry for mumbai area for this
user),Delhi_cnt=23,Assam_cnt=65. if all four area has value for the user
it should load accordingly. the requrement is immediate please someone
help me

No comments:

Post a Comment