Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> Need plsql join pls

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Need plsql join pls
 mohamed riaz  Posted: Feb 13, 2008 01:38:48 AM

 Total Post: 95
 Joined: Sep, 2006






 
Dear all,

can any one help me i have 2 tables

1) wss_act
2) dat_map

primary keys are : product_type for these 2 tables
so how will you write a cursor or simple select into statements to join?

Need urgent reply soon.

Regards
RIAZ

 Priya
Posted: Feb 13, 2008 01:43:09 AM  

 Total Post: 19
 Joined: Jul, 2007






 
Hi Riaz,

you can join the tables by providing,

select a.col_name1,b.col_name2 from wss_act a,dat_map b where a.product_type = b.product_type.

This is Equi - join. please let me know whether you any help.

Regards,
Priya

 mohamed riaz
Posted: Feb 13, 2008 01:47:28 AM  

 Total Post: 95
 Joined: Sep, 2006






 
Hi priya,
i need this in as plsql code which means as a select into statements

riaz

 Priya
Posted: Feb 13, 2008 01:49:50 AM  

 Total Post: 19
 Joined: Jul, 2007






 
Hi Riaz,

Can you provide me the correct requirements?

You need a cursor or select into statement?

Also provide what are the columns you need from these 2 tables.

Regards,
Priya

 mohamed riaz
Posted: Feb 13, 2008 01:50:50 AM  

 Total Post: 95
 Joined: Sep, 2006






 
i need into cursor

urgent reply soon


 mohamed riaz
Posted: Feb 13, 2008 01:52:24 AM  

 Total Post: 95
 Joined: Sep, 2006






 

Column name: corp_code,bran_code
primary key(s) : product_type
table names : wss_act,prod_map



 Priya
Posted: Feb 13, 2008 01:55:38 AM  

 Total Post: 19
 Joined: Jul, 2007






 
cursor cur_name is (query which i gave you)

begin

OPEN cur_name;

LOOP

FETCH cur_name INTO var_1,var_2;

EXIT WHEN cur_name%NOTFOUND;

end;

Hope this will help you..

regards,
Priya


 mohamed riaz
Posted: Feb 13, 2008 01:58:53 AM  

 Total Post: 95
 Joined: Sep, 2006






 
can you give me as a select into statements
pls

Riaz

 Priya
Posted: Feb 13, 2008 02:04:01 AM  

 Total Post: 19
 Joined: Jul, 2007






 
Pls let me know what is the requirement and what do you want to do with these 2 tables.

 mohamed riaz
Posted: Feb 13, 2008 02:07:30 AM  

 Total Post: 95
 Joined: Sep, 2006






 
Hi priya,

i am waiting for SELECT INTO statement also

Urgent!!
Riaz

 mohamed riaz
Posted: Feb 13, 2008 02:13:31 AM  

 Total Post: 95
 Joined: Sep, 2006






 

Hi priya,

This is the requirement which i have given below:-

a) use product_type of wss_act (table) to look up prod_map table. from this
prod_ind_cat_c field to determine whether it is MM or DV.

Example : prod_ind_cat_c='MM' or 'DV'

prod_map table has prod_ind_cat_c (field)

Thanks
Riaz


 Priya
Posted: Feb 13, 2008 02:15:01 AM  

 Total Post: 19
 Joined: Jul, 2007






 
See Riaz.... Select into means what should i provide? Let me know what you want to do with those tables.... will give you code in few mins

 mohamed riaz
Posted: Feb 13, 2008 02:19:40 AM  

 Total Post: 95
 Joined: Sep, 2006






 

COLUMNS : copr_c,bran_c,prod_type_c from table wss_act
COLUMNS : copr_c,bran_c,prod_ind_c from table prod_map
primarykey : prod_type_c for 2 tables. from prod_ind_c to determine
whether it is MM or DV these are the prod_indicator_codes (prod_ind_c)
just comparison


THANKS
RIAZ

 Priya
Posted: Feb 13, 2008 02:22:17 AM  

 Total Post: 19
 Joined: Jul, 2007






 
Hi priya,

This is the requirement which i have given below:-

a) use product_type of wss_act (table) to look up prod_map table. from this
prod_ind_cat_c field to determine whether it is MM or DV.

Example : prod_ind_cat_c='MM' or 'DV'

prod_map table has prod_ind_cat_c (field)

Thanks
Riaz

cursor cur_name is select col_name1,col_name2 from wss_act;

begin

for x in cur_name loop

select prod_ind_cat_c into v_prod_ind_cat_c from prod_map where product_type = x.product_type;

// you can change the col_names as per ur reqmt.

end loop;


let me know whether you need any help.

 mohamed riaz
Posted: Feb 13, 2008 02:33:27 AM  

 Total Post: 95
 Joined: Sep, 2006






 
Thanks priya, can you compare by using prod_ind_cat_c which means
use prod_cat_ind_c to determine from the tables like prod_ind_cat_c='mm'
or DV like that

can you write a if condition.

Thanks
Riaz

 mohamed riaz
Posted: Feb 13, 2008 02:40:35 AM  

 Total Post: 95
 Joined: Sep, 2006






 

Hi priya,

From this prod_cat_ind_c to determine whether it is 'MM' and 'DV'
can you write a if condition.

Thanks
Riaz


 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software