How to create dynamics columns in oracle query1.

hi,
how to create dynamics columns in oracle query.its very urgent.
regards
prasad..

Urgent is it?
Why? Have you forgotten to do your coursework and you'll get thrown off your course if you don't hand it in today?
What makes you believe that your request for help is more important than someone else who has requested help? It's very rude to assume you are more important than somebody else, and I'm sure they would like an answer to their issue as soon as they can get one too, but they've generally been polite and not demanded that it is urgent.
Also, you assume that people giving answers are all sitting here just waiting to answer your question for you. That's not so. We're all volunteers with our own jobs to do. How dare you presume to demand our attention with urgency.
If you want help and you want it answering quickly you simply just put your issue forward and provide as much valuable information as possible.
Looking at your post you haven't told us what database version you are using, you haven't provided any create table DDL's and insert statements to populate that with sample data, and you haven't even shown us that you've had a go at doing something yourself.
You will find if you post on here demanding your post is urgent then most people will just ignore it, some will tell you to get lost, and some will explain to you why you shouldn't post "urgent" requests. Occasionally you may find somebody who's got nothing better to do who will actually provide you with an answer, but you really are limiting your options by not asking properly.
/rant
As a basic example of dyanamic SQL:
DECLARE
  cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
  cols DBMS_SQL.DESC_TAB;
  ncols PLS_INTEGER;
BEGIN
  -- Parse the query.
  DBMS_SQL.PARSE(cur, 'SELECT hiredate, sal FROM emp', DBMS_SQL.NATIVE);
  -- Retrieve column information
  DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
  -- Display each of the column names
  FOR colind IN 1 .. ncols
  LOOP
    DBMS_OUTPUT.PUT_LINE (cols.col_name);
  END LOOP;
  DBMS_SQL.CLOSE_CURSOR (cur);
END;
/

Similar Messages

  • How to create  hidden column in Oracle Table

    Hi folks
    i have one doubt regarding hidden column creation in Oracle Table..
    Let me briefly explain my requirements.
    I have one table called UWRMC_MAST is table contain the following columns
            RMC_N_ID           NUMBER(10)                    NOT NULL,
           COB_N_ID           NUMBER(2)                      NOT NULL,
           SUBCOB_N_ID     NUMBER(2),
           RMC_C_CODE      VARCHAR2(10 BYTE)         NOT NULL,
           RMC_C_NAME      VARCHAR2(100 BYTE)       NOT NULL,
           CREATED_N_BY   NUMBER(10)                     NOT NULL,
           CREATED_D_DT   DATE                              NOT NULL,
           MODIFIED_N_BY  NUMBER(10)                     NOT NULL,
           MODIFIED_D_DT  DATE                              NOT NULL,
           RECORD_N_STS   NUMBER(1)                      NOT NULL,
           RMC_C_REMARKS VARCHAR2(256 BYTE),
           EFFECT_D_DT     DATE                           NOT NULL
    RMC_N_ID is primary key
    i want to create one column like Old_EFFECT_D_DT as virtual column
    when ever i update the effective date that date should be insert into Old_EFFECT_D_DT i.e., Virtual Column
    For example
    SQL> select RMC_N_ID, COB_N_ID, SUBCOB_N_ID, RMC_C_CODE, EFFECT_D_DT from uwrmc_mast;
      RMC_N_ID   COB_N_ID SUBCOB_N_ID RMC_C_CODE EFFECT_D_
            46          1          74 PCTMOTR    02-FEB-11
    Below i update the effective date(01-feb-2011
    SQL> update uwrmc_mast
      2  set EFFECT_D_DT = '01-apr-2011'
      3  where rmc_n_id =46;
    1 row updated.
    But i want a result like below
    SQL> select RMC_N_ID, COB_N_ID, SUBCOB_N_ID, RMC_C_CODE, EFFECT_D_DT from uwrmc_mast;
      RMC_N_ID   COB_N_ID SUBCOB_N_ID RMC_C_CODE EFFECT_D_   OLD_EFFE
            46          1          74 PCTMOTR    01-APR-11   02-FEB-11Is this possible to do in oracle , kindly give a solution for my requirement
    Regards
    Arun

    Arun wrote:
    Hi Mr.David_Aldridge
    Am having the doubt that's why i posted my quires in oracle forums.. just i want to know whether my requirement suit for VIRTUAL COLUMN in Table.
    Regards,
    ArunWell, I'm not sure exactly what your requirement is.
    If you want to audit changes to the records of that table then it would be better to use Oracle's auditing facility. If this previous change date is really a required part of your actual application functionality then you might use the application itself to maintain the previous date as a column in the table, as you say, or if you need to maintain the history of changes then add a new table so you can keep track of multiple changes.

  • How to create a user in oracle.

    how to create a user in oracle level.i know how to create from front end.can any body suggest.how to create oracle user from backend.
    Thanks,
    Dave

    Hi,
    We can use the 'hr_user_acct_internal.create_fnd_user' API to create the users. The sample code is as follows:
    BEGIN
    apps.hr_user_acct_internal.create_fnd_user
    (p_user_name => 'XXX',
    p_password => 'XXX',
    p_employee_id => 1234(This is the person id from per_all_people_f),
    p_user_id => x_user_id,
    p_user_start_date => SYSDATE,
    p_email_address => 'XXX',
    p_description => 'XXX',
    p_password_date => NULL
    COMMIT;
    END;
    and to add the responsibility to the user, we can use the following code.
    BEGIN
    fnd_user_pkg.addresp
    (username => 'XXX',
    resp_app => user_res_rec.application_short_name,
    resp_key => user_res_rec.responsibility_key,
    security_group => 'STANDARD',
    description => 'DESCRIPTION',
    start_date => SYSDATE,
    end_date => NULL
    END
    Best Regards
    Arun Kumar S.R
    Apps Associates

  • How to create a wallet in oracle RAC environment

    How to create a wallet in oracle RAC environment.
    While running following command "alter system set encryption key identified by "thalesdata4";
    I am getting error message "cannot auto create wallet" or "failed to open wallet.
    Please suggest correct way to create a wallet in RAC environment.
    Thanks
    Sudhir

    hi,
    please refer for detailed explanation
    Master Note for SSL Configuration in Fusion Middleware 11g [ID 1218695.1]
    regards

  • How to create a database in ORACLE 8i

    How to create a database in ORACLE 8i

    hello ...
    enter in
    http://www.oracle.com/pls/db102/portal.portal_db?selected=2 between demand and type in "create database"
    or read others docs ORACLE.
    AF

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How To create Connection Pooling in Oracle 10.1.2.0 Application Server

    Hi,
    How to create Conncetion Pooling in Oracle 10g Application Server. I am using 10.1.2.0 version.
    Thanx
    Dhans

    Hi,
    How about these tutorials?
    http://www.oracle.com/technology/tech/java/newsletter/articles/oc4j_data_sources/oc4j_ds.htm
    http://www.oracle.com/technology/products/jdev/tips/duff/mysql_and_oc4j3.html

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to find encrypted columns in oracle 10g database

    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?
    Thanks..

    user602872 wrote:
    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?Hmm not which I could find,
    SQL> select * from dict where lower(table_name) like '%encrypted%';
    TABLE_NAME
    COMMENTS
    DBA_ENCRYPTED_COLUMNS
    Encryption information on columns in the database
    ALL_ENCRYPTED_COLUMNS
    Encryption information on all accessible columns
    USER_ENCRYPTED_COLUMNS
    Encryption information on columns of tables owned by the user
    SQL>HTH
    Aman....

  • How to create database link from oracle to sql server

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal
    Hi Vishal,
    I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
    https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
    We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
    Regards,
    Elvis Long
    TechNet Community Support

  • How to create new database on Oracle 10g

    Hi All,
    Can any one tell me how to create new database on oracle 10g.
    Thanks in Advance for your help.

    again some confusion here.....
    u said u need a new database in your first post and now you saying u need a new schema..
    one database has many schemas(users)..... ex: scott,sys,system are few of them...
    now it depends you need seperate database for test,dev environment - this is in the case u have many schemas under each database and many tables(objects) under each schema.
    OR
    You just need a separate schema (in same db) for test,dev environment...where in you will have multiple tables in each schema...U need to know the dba credentials of the db to create a new schema.
    ideally u need to have different database...You can create one with out sys/system(oracle users) password as these passwords are db dependent.
    what you need is access to the any machine where server is installed(can be the same mc where you have your dev db or a diff machine) and that will be the machine where your db will be installed (can do it through database configuration assistance),ofcourse you will need windows authentication for this.
    so you login to the same machine or access it from your machine using remote login.
    I hope that is clear.Hope i am not listing things that you already know..Just did it coz of confusion between db and schema
    Message was edited by:
    coolguy

  • How to create Invoice Approval in oracle Payable R12 ?

    Hi All..
    Can any one let me know how to create Invoice Approval in oracle payable R12?

    pl.go thru following link.
    http://oracleerpfunctional.blogspot.in/2012/08/ap-invoice-approval-workflow-setup-and.html
    http://oracleerpfunctional.blogspot.in/2012/08/oracle-approvals-management-ame-setup.html
    http://www.scribd.com/doc/101107120/Oracle-Payables
    HTH
    Sanjay

  • How to create trial  version in oracle project

    assalamualikum and hi ..
    sir how to create trial version in oracle project
    i want to
    anyone use my oracle (forms) project for some limited time..
    and then expire after some time..

    ummm...you test it using the UTL_FILE package.
    BTW...you can also spool text files out of SQL*Plus on your local machine, without even needing UTL_FILE. but if you need to create files on a server, then UTL_FILE is the way to go.

  • How to create page zero in oracle apex 4.0?

    Hi All,
    How to create page zero in oracle apex 4.0?
    Regards
    Mani

    Hi,
    Home > Application Builder > Application xxx > Create Page
    At bottom center on wizard there is Page Zero
    Regards,
    Jari
    Edited by: jarola on Aug 25, 2010 7:28 PM
    And here is chapter about in documentation
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/ui.htm#BGBFFFGH

  • How to create sub columns in interactive report

    can u tell me , how to create sub columns in
    interactive report. i really need it.i search lot but i dont get proper information.
    help plz...
    example : -
    |_____total_ persons _____|
    | persons | male | female |
    100 200 3000
    400 500 600

    i am nile.
    select id as id,
    male as male,
    female as female
    from persons.
    i want interactive report with main column total persons(static text) in that male , female.
    e.g.
    |___total persons_| - - - - -> main cloumn
    | male | female | - - - - -> sub columns
    100 200
    300 400
    Edited by: user9512075 on Aug 29, 2008 1:46 AM
    Edited by: user9512075 on Aug 29, 2008 1:47 AM
    Edited by: user9512075 on Aug 29, 2008 1:48 AM
    Edited by: user9512075 on Aug 29, 2008 1:49 AM

Maybe you are looking for

  • Error while Deploying WebApp in exploded form on 6.1

    Hi, I am trying to deploy a webapp named "test" in the exploded form on 6.1 and the following is what I have put in the config.xml file. I am using SP2. <Application Deployed="true" Name="test" Path=".\config\coolDomain\applications"> <WebAppComponen

  • Open command for Appleworks Imac G5 OS 10.4.2

    When I use the open command from the file menu it takes 20secs before the document window appears, same when I save as or save for first time. Also occurs with Office 2004 applications and other applications but strangely not with "pages trial"

  • What type of SDHC Memory Reader do I need to transfer 32g of pictures to Iphoto?

    I have a MAC OS X 10.5.8 computer . Can I transfer 32Gig of pictures with  seperate SDHC Card Reader?

  • JDBC..

    Hi! What are all the interfaces and classes that are available in latest JDBC version 3.0?. how can i retrieve the values from database without making use of ResultSet in JDBC?. is there any seperate methods are there other than Result Sets? -Thanx

  • HT5137 after I installed mavericks my music on iPhone5 doesn't work

    after I installed os mavericks my music application cannot be open and it doesn't even launch, omg it's so annoying, if anyone knows how to fix it or have the same problem please let me know