How to get output in column wise

hi,
i am just started learning plsql
i am trying to create and execute procedure
create procedure query_emp4
(p_id in emp.empno%type,
p_name out emp.ename%type,
p_job out emp.job%type,
p_sal out emp.sal%type)
is
begin
select ename as employee_name,job,sal into p_name, p_job, p_sal from emp where empno = p_id;
end query_emp4;
variable p_name varchar2(10)
variable p_job varchar2(9)
variable p_sal number
execute query_emp (7369, :p_name, :p_job, :p_sal)
print p_name
print p_job
print p_sal
i am getting ouput as
P_NAME
SMITH
P_JOB
CLERK
P_SAL
800
but i need output like this
P_NAME P_JOB P_SAL
SMITH CLERK 800
and i need output insted of P_NAME i need EMP_Name
please help me out

Why would yuo need to use a procedure for this when standard SQL would do. especially as you would enter a value for p_id at run time
eg
select ename as employee_name,job,sal
from emp where empno = [p_id];
G

Similar Messages

  • How to get the primarykey columns of the table in SAP BI Java SDK

    Hi, I'm new to sap BI Java SDK. I'm not getting how to get the primarykey columns, using BI JDBC Connector (for relational data sources). If anybody knows, please let me know. its very very urgent task to be done in my project. In the below following code.... I have written a code to connect to the database through resource bundle, reading table names, once user select table name, i need to show the primary key columns of that table to the user. here i'm not getting how to get the primary key columns . Please send me the code if there is any method to find out the primarykey columns or a logic to get them. I will be greatful to you.... if you can do this favour.
    Please check out the following code ........
    ManagedConnectionFactory mcf;
    IConnectionFactory cf;
    IConnectionSpec cs;
    mcf = new JdbcManagedConnectionFactory();
    cf = (IConnectionFactory) mcf.createConnectionFactory();
    cs = cf.getConnectionSpec();
    ResourceBundle rbLocal = ResourceBundle.getBundle( "xxxx");
    Enumeration propnames = rbLocal.getKeys();
    while (propnames.hasMoreElements())
    String key = (String) propnames.nextElement(); //out.print(key); //out.println("="rbLocal.getString(key)"");
    cs.setPropertyValue(key, rbLocal.getString(key));
    // Establishing the connection. // The IBIRelational interface provides an entrypoint to access // metadata and execute queries.
    IBIConnection connection = (IBIConnection) cf.getConnectionEx(cs); I
    BIRelational rel = connection.getRelational();
    IBIQuery query = rel.createQuery();
    String sqlStatement = "SELECT * FROM " + "BICQPERSON where type='pk'"; ResultSet rs = IBIDataSet dataset = query.execute();
    Thanks SreeKanth

    Hi,
    looks like you are on Infomation Builders, correct? If yes through which adapter and to what DB are you connecting?? in an R3/BW system you can do the folowing:
    "(ABAP)
    SELECT DISTINCT FIELDNAME
    FROM DD03L
    WHERE TABNAME = '/BIC/QPERSON'
      AND AS4LOCAL = 'A'
      AND KEYFLAG = 'X'
    ORDER BY 1
    Another option is goto directly to the RDBMS; in this case let me which one are you using
    hope this helps...
    Olivier.
    Message was edited by:
            Olivier Cora

  • How to get the dynamic columns in UWL portal

    Hi All,
    I am working on UWL Portal. I am new to UWL. I have down loaded uwl.standard XML file and costomized for getting the  values for "select a Subview" dropdown and I am able to see the values in the dropdown. Now my requirement is to get the dynamic columns based on the selection from dropdown value.
    can any body suggest on how to get the dynamic columns in UWL portal.

    Hi  Manorama,
    1) If you have already created a portal system as mentioned in following blog
                  /people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer
    2) If not, then try to create the same. Do not forgot to give the Alias name .
    3) After creating a system, log on to the VC, Create one iView.
    4) Now Click on "Find Data" button from the list which you can view in right side to Visual composer screen.
    5) After clicking on "Find Data" button, it will ask for System. If you have created your system correctly and Alias name is given properly, then your mentioned Alias name is appeared in that list.
    6) Select your system Alias name and perform search.
    7) It will display all the BAPIs and RFCs in your systems.
    8) Select required BAPI and develop the VC application.
    Please let me know if you any further problems.
    Thanks,
    Prashant
    Do reward points for useful answers.

  • How to get invoice status column in ap_invoice_all table

    how to get the invoice_status column like "NEEDS RE VALIDATION"      in account payables tables.

    The invoice approval status does not come from any table / lookup.
    Instead, Oracle builds it by calling the ap_invoices_pkg.get_approval_status function.
    You can also call it by passing invoice_id, payment_status_flag and invoice_type_lookup_code.
    All these 4 columns are present on the ap_invoices_all record.
    Hope this helps
    Sandeep Gandhi
    Independent Consultant

  • How to get two empty columns in reporting?

    Hi Experts,
    How to get Two empty columns in  a report, i have taken a formula and i have given '=0' in the formula box after executing the query that two columns containing zero's, but i don't want zero's, i want to display empty columns.
    pl help to do this,
    thanks & regards
    venakt

    Hi
    In the Query designer go to Properties and Select Active n Zero Supression
    also select Supress Zeros from the drop down.
    Regards
    M.A

  • How to get output in this way ?

    actual data is this :
    CRANE_ID CRANE_CASE SEQ desc
    C01 NORM 1 desc1
    C01 NORM 2 desc2
    C01 NORM 3 desc3
    C01 NORM 4 desc4
    C01 XX1 1 desc5
    C01 XX1 2 desc6
    C02 NORM 1 desc7
    C02 XX1 2 desc8
    C03 NORM 1 desc9
    C03 XX2 2 desc10
    how to get data in this format :
    crane_id case 1 2 3 4
    C01 NORM desc1 desc2 desc3 desc4
    C01 XX1 desc5 desc6
    C02 NORM desc7
    C02 XX1 desc8
    C03 NORM desc9
    C03 XX2 desc10
    header should contain all sequence that is maximum.

    How to group my output w.r.t one column ?
    you need to do your own homework assignments

  • How to get database growth month wise

    Hi All,
    Can any one help me getting the growth of production database month wise for the current year.
    I mean I need a script which will display the growth of my database month wise for the year 2010.
    Regards,

    hi,
    try something along the lines of this
    --Run the following create table to create segment info.
    create table stats$segment_info as
    select
      sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name /
    -- Run the following once a calendar month via dba_jobs.
    insert into stats$segment_info
    select
    sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name / commit;
    -- run the following report to get tablesapace growth
    column this_mon new_value this_mon
    column last_mon new_value last_mon
    column prev_mon new_value prev_mon
    select to_char(sysdate,'MON YYYY') This_mon
         , To_char(add_months(sysdate,-1),'MON YYYY') Last_mon
         , to_char(add_months(sysdate,-2),'MON YYYY') prev_mon from dual;
    column mins format 99999
    column size_mb heading '&&this_mon' format 99999 column size_mb2 heading '&&prev_mon' format 99999 column size_mb1 heading '&&last_mon' format 99999
    column growth heading 'Growth(%)|   in   |last month' format 9999.99
    select tablespace_name,
    --       to_char(snap_time,'MON YYYY') Month
           max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-2),'MON'),size_m,0))  size_mb2
          ,max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0))  size_mb1
          ,max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0))  size_mb
           ,100*(max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0))
         -    max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0)))
                     /max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,1)) growth from (select  tablespace_name, snap_time
         ,sum(bytes)/1024/1024 size_M
    from stats$segment_info
      where snap_time > trunc(add_months(sysdate,-2),'MON')-2
    group by tablespace_name,snap_time) a
    group by tablespace_name
    order by tablespace_name
    /as far as I am aware this is database independent.
    regards
    Alan

  • How to get text from column  labels in pivot using javascript?

    Hi, is it possible to get text from column labels in pivot using javascript? How?

    You don't get a response from a URLRequest, you get the response from a URLLoader:
    View this sample page for URLRequest and URLLoader and I think it'll make more sense to you.
    http://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#URLRequest()

  • How to get table data column by column dynamically

    Hi ,
    first of all
    i have something like this
    cursor sys_cursor is
    select * from sys.all_objects;
    v_data varchar2(200);
    fetch sys_cursor
    into v_owner, v_object_name, v_subobject_name, v_object_id, v_data_object_id, v_object_type, v_created, v_last_ddl_time, v_time_stamp, v_status, v_temporary, v_generated, v_secondary;
    v_data := v_owner || ' ' || v_object_name || ' ' || v_subobject_name || ' ' ||
    v_object_id || ' ' || v_data_object_id || ' ' ||
    v_object_type || ' ' || v_created || ' ' || v_last_ddl_time || ' ' ||
    v_time_stamp || ' ' || v_status || ' ' || v_temporary || ' ' ||
    v_generated || ' ' || v_secondary;
    encrypt(v_data);
    it is ok for "sys.all_objects" but i need to modify this for all tables
    so , i need to know column names of table and type of it and value of it
    then i need to get column values by one by and encrypt it.
    i used dbms_sql and succeed to find column name and type
    however , i couldnt get the values.i can't use dbms_sql.column_values because i find column type dynamically.
    what can i do?
    how can i get table data by row
    and then for each row , i need to get values of columns by one by and encrypt those values.
    any idea is appriciated.
    thanks
    Aykut

    Dynamic SQL is the solution. Right from getting the column names, their data types to passing the string to encrypt function that you have.
    You will need to handle datatypes like LONG, LOB etc... as they cannot be concatenated with strings.
    Also, you need to manage dates and numbers.
    Obviously this would be very complicated code.
    Even if you decide to code the procedure to encrypt tables one by one, still you need to make this procedure dynamic to handle above situations.

  • How to get the count monthly wise

    Hi All
    I have lot of order dispatched in a year 2010, how to get the moth wise total.
    For example jan 1000 orders ,feb 2500 orders.
    Thanks & Regards
    Srikkanth.M

    Pleiadian wrote:
    Maybe even
    b.schedule_ship_date between to_date('2010','YYYY') and to_date('2011','YYYY');)But this could return schedule ship dates that are 01-Jan-2011 00:00:00. I don't think this is wanted since it was not specified in the original requirement. I'm not even sure if to_date('2010','YYYY') returns 01. Feb.2010 in a few days (when we will have february).
    Just checking the docs....
    found it: http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#SQLRF51062
    from the docs:
    If you specify a date value without a time component, then the default time is midnight (00:00:00 or 12:00:00 for 24-hour and 12-hour clock time, respectively). If you specify a date value without a date, then the default date is the first day of the current month.Just to be on the safe side always give the complete format mask!
    b.schedule_ship_date >= to_date('01012010','DDMMYYYY')
    and b.schedule_ship_date < to_date('01012011','DDMMYYYY')Edited by: Sven W. on Jan 17, 2011 5:14 PM

  • How to get the last column info of the given table

    Hi All,
    I want to get the last column information like :
    column name, datatype of the last column in the given
    table use PL statement. Please help.
    Thanks,
    JP

    SCOTT@orcl SQL> desc emp
    Name                                                  Null?    Type
    EMPNO                                                 NOT NULL NUMBER(4)
    ENAME                                                          VARCHAR2(10)
    JOB                                                            VARCHAR2(9)
    MGR                                                            NUMBER(4)
    HIREDATE                                                       DATE
    SAL                                                            NUMBER(7,2)
    COMM                                                           NUMBER(7,2)
    DEPTNO                                                         NUMBER(2)
    SCOTT@orcl SQL> select column_name, data_type from user_tab_columns
      2  where table_name = 'EMP'
      3  and column_id = (select max(column_id) from user_tab_columns
      4  where table_name = 'EMP');
    COLUMN_NAME                    DATA_TYPE
    DEPTNO                         NUMBER
    SCOTT@orcl SQL>                                                                      

  • How to get Number of Column in Excel file

    Hi All,
                   My requirment is to get Number of Column in Excel file which i want to upload,
      so please suggest if there is any possible way to get this functionality.
    Thanks
    Anirudh

    Use FM "ALSM_EXCEL_TO_INTERNAL_TABLE".
    Adjust the values of i_begin_col & i_end_col parameters in this FM.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME                      =
          I_BEGIN_COL                   =
          I_BEGIN_ROW                   =
          I_END_COL                     =
          I_END_ROW                     =
        TABLES
          INTERN                        =
      EXCEPTIONS
        INCONSISTENT_PARAMETERS       = 1
        UPLOAD_OLE                    = 2
        OTHERS                        = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards,
    BBR.

  • How to get all the columns displayed in pdf.

    If the ALV Display contains 25 columns.When i tried to give the print in PDF format.
    in the PDF it is displaying only 10 columns.Can you let me know how to display all the columns (i.e 25) in the pdf.

    Hi,
    Check the OSS Note 186603 which deals with how to handle Spool lists with width > 255 characters.
    Regards,
    Satish

  • How to get invoice status columns available in invoice general screen

    Dear All,
    How to get invoice status in oracle invoices
    Invoice Status --> Validated, Never Validated, Cancelled etc
    please advice me.
    Thanks
    Rehan
    Edited by: 877432 on Oct 9, 2012 3:52 AM

    for
    >
    which is not giving this function kindly where i find these status.
    >
    re-read
    >
    plz see http://www.shareoracleapps.com/2010/10/api-to-find-ap-invoice-status.html
    also Where Is The Invoice Validation Status Stored? How Is The Invoice Validation Status Determined? [ID 301806.1]
    >
    those notes point about statuses - 'Validated' , 'Never Validated' , 'Needs Revalidation'
    if you want 'Unpaid' , 'Fully Applied','Available' etc instead of 'UNPAID', 'FULL', 'AVAILABLE' etc you can use lookups
    see note in http://andyblg.wordpress.com/2012/10/09/approval-status-for-invoice-in-r12/

  • How to get the other columns of a particular mininum value

    <p>I have a multiple rows per account in a table. I build a object minimum(col1) in the Business Object universe. I need to get the corresponding values of a min(col1) for each account. Problem is when i pull the min(col1) and other column, it always gives every combination of the min(col1) for each account. How do i get only the corresponding values.</p><p>Example</p><p>Acct         Col1     col2     col3 </p><p>1              34       3         4</p><p>1              45        5        6</p><p>2               3         7         8</p><p>output should be</p><p>1           45    5   6</p><p>2         3       7   8</p><p>How i accomplish with data providers or free hand sql combinations</p><p>&#160;</p><p>Thanks</p><p>&#160;</p><p>&#160;</p>

    you can do this very quickly by creating a crosstab with the Acct as the Row, and Col1,2,3 as the Columns, and the Maximum of your field as the summary.

Maybe you are looking for

  • Asking the Bridge Team:  Bridge "working color space" setting when one does not have the Suite?

    Common sense tells me there is really no such thing as a "working color space" in Bridge, because Bridge is not an image editor, just a browser Therefore, this may turn out to be a purely academic question; but that doesn't keep my curiosity from for

  • I appear to have 2 apple ID's  and can't use facetime as my other ID is using my email address. how do I fix? thank you ,Tom

    I had an awful time getting apple to accept my username and my credit card but finally got it to accept and purchased facetime App .It downloaded correctly and put an Icon on my toolbar,but would not operate as it said my email address was in use by

  • Random shutdowns/screen off on Mavericks

    I've been getting random shutdowns on my MBA 2013. It almost always happens when I've closed the lid to put it to sleep. After that when I open it the screen always stays black and nothing happens. I have to press down on the power button for a while

  • WiFi mystery

    I currently use an Airport Extreme (AE) hooked up to a cable modem. My desktop is connected directly to the AE with no problems - it also picks up the wireless signal with no problem. We also own a MacBook Air that receives the wireless signal with n

  • Log4j problem occuring through use of MDC.

    Hey folks, I've encountered a bit of a problem with using log4j's MDC class within applications in weblogic. It's not a bug at all it's just giving me grief. Basically I've setup ApplicationLifecycleListener on my ear app and on all web apps within w