Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:59:07+00:00 2026-06-15T09:59:07+00:00

I am new to sql so i need help in understanding this. I have

  • 0

I am new to sql so i need help in understanding this.

I have 3 tables :-

Table 1 :- employee no.
employee name
person_id

Table 2 :- Contact no.
person_id

Table 3 :- Address
person_id

I tried to make a package and use a procedure to define a cursor. now i want to display the contact no ,address and emp number from the tables using joins. i have applied the join condition but am not able to understand how to display the result.

Package body

create or replace package pacakge_name
    as 
    procedure procedure_name

    declare
    cursor cur_name is select * from table1 join table2 on table1.person_id=table2.person_id join table 3 on table1.person_idd=table3.id;

    var_curname cur_name%rowtype;

    begin

    open cur_name;

    loop
    fetch cur_name into var_curname
    exit
    when cur_name%NOTFOUND;
    end loop;
    close cur_name;
    end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:59:09+00:00Added an answer on June 15, 2026 at 9:59 am

    for displaying result to console you have to dbms_output.put_line(var_curname.fieldname);

    this will be your cursor query:

    select table2.contact_no,
    table3.address,
    table1.employee_no
    from 
    table1,
    table2,
    table3
    where table1.person_id = table2.person_id and
    table2.person_id = table3.person_id
    

    so your dbms_output.put_line will be

    dbms_output.put_line(var_curname.contact_no||'-'||var_curname.address||'-'||var_curname.employee_no);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Oracle's PL/SQL is fairly new to me, so I need some help understanding if
I'm new in SQL and need little help to understand parts in this SQL
I'm somewhat new to SQL and need help with query syntax. My issue involves
I am new to SQL Server 2008, and I need some help in query
I'm new to ORM stuff and I need some help understanding something. Let's assume
I am relatively new with sql and I need some help with some basic
I'm pretty new to the SQL and need some help with a certain task.
I am a bit new to sql and php so I need some help
I need help in writing queries which will update MySql tables from SQL server.
I am new to SQL, so I need your help on a query. Basically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.