Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2009
    Posts
    8

    Unanswered: Create temporary table for processing

    Hi,

    I am a newbie to Oracle and PLSQL, I gets 1..n cols of data from different tables from different queries.

    COLA (from tableA)
    1
    2
    .
    .
    n

    COLB(from tableB)
    1
    2
    .
    .
    n

    I need these different cols in a temporary table for processing like below

    temp_tab
    COLA COLB
    1 1
    2 2
    . .
    . .
    n n

    Would you tell me how I can accomplish this in plsql.. Do I need to create temp_tab first and insert these col values or I just alter the table n add each cols?

    Any help would be appreciated, I have no experience writing plsql code

    Thanks,
    Shijumic
    Last edited by shijumic; 11-16-09 at 17:39.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I need these different cols in a temporary table for processing like below
    NO! You do not need any temporary table.

    Explain what problem you really need to be solved.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2009
    Posts
    8
    Actually I need those different cols like COLA COLB etc in a temporary table and I need to do some modifications of that data like update sone values or delete some values upon user request.

  4. #4
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    Then you really don't want a temporary table.

    Who knows where you are going, but this should get you in the ballpark.
    Code:
    INSERT INTO temp_tab
    SELECT tablea.id AS cola, tableb.id AS colb
    FROM tablea
    FULL OUTER JOIN tableb ON tablea.id = tableb.id

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Actually I need those different cols like COLA COLB
    How do you determine which row value from Table_A matches which row value from Table_B?

    Does every row value in Table_A have a one for one matching row value in Table_B?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Nov 2009
    Posts
    8
    Yes, every row value in Table_A have a one for one matching row value in Table_B.

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Quote Originally Posted by shijumic View Post
    Yes, every row value in Table_A have a one for one matching row value in Table_B.
    Then only a single table should exist.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  8. #8
    Join Date
    Nov 2009
    Posts
    8
    I am querying out the data from an EAV type of database.

  9. #9
    Join Date
    Aug 2009
    Posts
    262
    Ask Tom "Temporary tables (comparision with SQLSe..."


    read through .

    obviously enough you have sql-server background and its software limited programing capability .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •