Vc++ how to read column header of cursor

How to fetch the Column name or header of the stored procedure which is using a cursor as the output.
P_out  out sys_refcursor
need to read the column name of this output.
I am using Vc++ code to reterive the data, in Vc++ how to read column header of cursor

You haven't provided much detail to go on.  How are you reading data from the ref cursor? Do you already have a reader from it?
Maybe this helps.
Greg
create or replace procedure proc1 (v1 out sys_refcursor) as
begin
open v1 for select * from emp;
end;
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
public class RefCur
    public static void Main()
        using (OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
            con.Open();
            using (OracleCommand cmd = new OracleCommand("proc1", con))
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new OracleParameter("v1", OracleDbType.RefCursor, ParameterDirection.Output));
                cmd.ExecuteNonQuery();
                using (OracleDataReader reader = ((OracleRefCursor)cmd.Parameters[0].Value).GetDataReader())
                    for (int i=0;i<reader.FieldCount;i++)
                        Console.WriteLine(reader.GetName(i));

Similar Messages

  • How to get column header text in IWDTable

    Hi
    Just want to know how to get column header name in IWDTable.
    I know that you can get it with
    IWDAbstractTableColumn[] groupedColumns = table.getGroupedColumns();
    for (int i = 0; i < groupedColumns.length; i++) {
         IWDAbstractTableColumn column = groupedColumns<i>;
         column.getHeader().getText();
    But what if text isnt set on header level but its rendered from cellEditor  model binding (im not sure if its like that).

    Finally after your suggestion i did it with this code
    String header = column.getHeader().getText();
                       if ((header == null || header.length() == 0) && column instanceof IWDTableColumn){
                            IWDTableCellEditor tableCellEditor = ((IWDTableColumn) column).getTableCellEditor();
                            if (tableCellEditor instanceof IWDTextView){
                                 String bindingPath = ((IWDTextView)tableCellEditor).bindingOfText();
                                  StringTokenizer tokenizer = new StringTokenizer(bindingPath,".");
                                  String token = "";
                                  IWDNodeInfo nodeInfo = context.getNodeInfo();
                                  while (tokenizer.hasMoreTokens()){
                                       token = tokenizer.nextToken();
                                       if (tokenizer.hasMoreTokens()){
                                            nodeInfo = nodeInfo.getChild(token);          
                                  IWDAttributeInfo attribute = nodeInfo.getAttribute(token);
                                  ISimpleType simpleType = attribute.getSimpleType();
                                  simpleType.getDescription();
                                 header = simpleType.getDescription();

  • How To avoid column heading for only total line in ALV list Display

    Hi,
    How To avoid column heading for only total line in ALV list Display.

    Hi,
    to change colunm header field catlog is built
    look at the example below
    Changing column text headers
    use this to change, hide, or alter the ALV columns
    CLEAR: gt_fcat.
    READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
    *TEXT1 is your field name
       ASSIGNING <gtfcat>.
    IF sy-subrc = 0.
       <gtfcat>-coltext   = 'Date Type'.
       <gtfcat>-no_out    = ' '.
       <gtfcat>-tooltip   = 'Date Type Text from IT0019'.
       <gtfcat>-seltext   = 'IT0019'.
    keep seltext to '' if u want to hide
    ENDIF.
    regards
    austin

  • How to Link column header only in classic Report in APEX 4.1

    Hello Everybody,
    Probably there is a simpler way to do this, but I am not sure. I want a link on column header in Report on a specific column. The link will take me to new region or a page.
    How to achieve this in APEX 4.1
    Theme : Blue 2
    Database 11g
    I see there is a column link opiton, but that creates link for every row in that column on a specific icon, I just want link on a title of the column in Classic Report.
    For Example,
    if there are two columns Name and Client ID, which has 10 records to display on a classic report. I wan the link on Client ID on header only not on the records.
    Can anybody provide some simple solution for this.
    Thanks,
    --CP
    Edited by: cpora007 on Jun 22, 2012 10:38 AM

    Hello,
    I didn't understand, what do you mean by default it is going to sort popup. I have a classic report based on SQL, which generates a report with static header, there is no sort or any other link on that.
    I added a link in column header name with an anchor. It works and takes to the new page.
    But it is not a proper solution. A solution based on Jquery dynamic action is preferable. Also the preferred option is that the link opens a hidden region of the same page at the same location of the report and the report gets hidden. after the procession on the form region and submitting the update/ insert process. the report region shows up with the change data.
    Moving on to new page is 2nd option, if the first do not work.
    In the JavaScript, put: apex.submit("GO_TO_MY_OTHER_PAGE");
    On the page, create a Branch to the Second page. Set the condition to Request=Expression 1. Set the request to "GO_TO_MY_OTHER_PAGE"
    On which page I need to create a branch?, Is it on the report page or the form page.
    Thanks a lot for the response. I appreciate your kind efforts in this regard.
    --CP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read 'clicked header' AND selected row from multicolumn listbox?

    I have a multicolumn listbox filled with 6 columns and about 500 rows.
    I want the user to be able to click on a column header, and sort the listbox alphabetically on that column. I've written the code for that, and that works. (using the 'itemnames' en 'get clicked col hdr' properties.)
    However, I also want to include the option, that when a user highlights a row, and then clicks on the header, that after the listbox gets sorted it scrolls down to the selected row.
    (So that the user doesn't have to search for it)
    And that's where things go wrong, because the value of the listbox changes to zero when you click on a column header. No I idea why it does that, but it's rather
    annoying. Can I change that behaviour somehow?
    Or any ideas how to get around it?

    My thanks to you and Jared.
    Seems I got a working solution now.
    Did take a while to figure out why your solution worked. Basicly, you're reading the row from a few iterations before.
    As soon as I understood that, I simplified it a little. Look at the attached file... I think it does the same. :-)
    Jared asked for the sorting routine. As I don't seem to be able to attach files when replying to comments, I took the liberty to include it here also.
    Basicly, I just use the 'sort 1D array' that comes with Labview 6. To be able to sort a 2D array, I convert every row to a cluster. That's something the 'sort 1D array' VI can handle nicely.
    To sort on the correct column, I just cut all columns in front, and paste them behind again. A
    fter sorting, I reverse the process.
    Anthony.
    Attachments:
    copy2_of_multicolumn.vi ‏26 KB
    sort_2d_string_array.vi ‏34 KB

  • How to implement column header sort

    Hi all,
    Does anyone know how to configure Oracle 9i AS Portal Release 2 column header sort.
    In Portal, Oracle has setup the IDE to sort your columns using arrow keys in the
    column headers. I would like to do the same thing without using the Custom Form.
    TIA,
    Daniel N

    I would suggest using the built in Collections framework for sorting.
    have class A implement the Comparable interface then implement the compareTo method as follows:
    public int compareTo(Object o) {
        A a = (A)o;  // <-- may cause ClassCastException if (o instanceof A) != true, but that should not be a problem.
        int value = attr1.compareTo(a.attr1);
        if (value != 0) return value;
        value = attr2.compareTo(a.attr2);
        if (value != 0) return value;
        value = a.attr3.compareTo(attr3);  //Notice I switched a.attr3 and attr3 for desc
        return value;
    }That should do it for you.
    Now put everything into an instance of java.util.List and pass that to java.util.Collections.sort(java.util.List);
    If you didn't create class A, and therefore can't add a method to it, then implement a Comparator. The idea is the same, just look at the java.util.Comparator API and use java.util.Collection.sort(java.util.List, java.util.Comparator) method to sort;

  • How to set column heading dynamically?

    Hi:
    How can I set a column heading dynamically -by PL/SQL code- ?
    Regards,

    Hi,
    Create a formula field, and return desired heading depending on your conditions, and use that field as the column header.
    Regards,
    Manu.

  • How to pass column header as a parameter in Validation Expression (APEX4.0)

    Hello
    I created a new Page validation in APEX4.0 ( not 4.1 ).
    (1) Type : Function Returning error text
    (2) Validation Expression 1 :
    begin
    return validate_name ( p_c=> #COLUMN_HEADER# ,p_c_value=> to_date(:p26_LEAVE_FROM,'dd/mm/yyyy') );
    end;
    note: the validate_name is an oracle pl/sql procedure which takes two input parameters ( column header name and actual value ) and return a specific error message ( to that column ) or NULL.
    (3) In the Error Message section, I left Error Message blank ( as the app ignored the mssage but used the one returned from the above function)
    However, I chose "The Error display location" to be inline with field and notification" and Associated Item to be "p26_LEAVE_FROM".
    My question, it worked if I hard coded the actual column header "LEAVE FROM" , but it didn't work if I used the above #COLUMN_HEADER# in Validation Expression. Can I avoid hard coding as the column header might be changed one day. Is there a better way to deal with multiple column validations with different error message for each column ? It seems that I will have to create similar page valiation for each column to be validated.
    Thanks for your advice.
    Edited by: Susanna on 19/01/2012 17:45

    You want something like this:
    DECLARE
      lio_success  VARCHAR2( 2000 );
      li_id        NUMBER;
      li_dep_id    NUMBER;
      li_sel_id := NUMBER;
      li_date DATE;
      lo_date DATE;
      lio_return_message xyz_bpe_rec_fn.xyz_bpe_rec_col;
      l_ret xyz;
    BEGIN
      lio_success := 'some value';
      li_id := NULL;     -- or some number
      li_dep_id := NULL; -- or some number
      li_sel_id := NULL; -- or some number
      li_date DATE := sysdate;
      lio_return_message.col1 := somevalue;
      lio_return_message.col2 := somevalue;
      lio_return_message.coln := somevalue;
      l_ret := get_xyz( lio_success
                      , li_id
                      , li_dep_id
                      , li_sel_id
                      , li_date
                      , lo_date
                      , lio_return_message );
    END;
    /

  • How to read file header/open filein binary mode

    i am using FileConnenction API to read from a file. how can i open a file in binary mode so that i can read file header. In other words i want to open a file in binary mode.

    You can always try looking at the [Header Signatures|http://www.techpathways.com/uploads/headersig.txt]. But it would probably be easier to adjust your application so it doesn't have to guess.
    ~

  • How to create column header text while downloading file

    How can we create column header text while downloading file using function GUI_DOWNLOAD(in SAP Release 4.6c) because there is no FIELDNAMES parameter in
    4.6c version.

    Hii,
      Check this sample code. I have called GUI_DOWNLOAD twice. Onetime to download header of table and next time data of table
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:\flight.xls'
       FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    *   CONFIRM_OVERWRITE             = ' '
    *   NO_AUTH_CHECK                 = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   WRITE_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = t_head
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF sy-subrc NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      IF sy-subrc NE 0.
    *  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards
    Abhijeet

  • How to change column heading in line item report

    Hello Experts,
    How to change the column heading in the line item report CJI4 or CJI3  ?
    for eg: The field WBS will show as Object in the heading. Here  I would like to change to WBS.
    Is there a way to do this without changing ABAP code
    FATMAN

    Not possible through standard I guess.
    Enhancement you should be looking is COOMEP01 which includes the component EXIT_SAPLKAEP_009
    i.e., Line Item Reports: Customer-specific Formatting of the Lists.You use this enhancement to modify column headings.
    Regards
    Sreenivas

  • How to read the header of an FLV 1.1 file?

    I would like to read the header of an FLV file and determine
    if it's an FLV 1.1 file, and if so, get it's length. (Without
    downloading the entire file. ) How do I do this?

    bump

  • How to read File Header in JAVA

    I wanna upload a(doc/pdf) file from client site, where I hv to check whether the the file is originally a doc/pdf file or not, I mean not just the extension, but the actual header information of the file. Please some body help me to do this, I dont know how to read the file header. Thnx in advnc.

    You can always try looking at the [Header Signatures|http://www.techpathways.com/uploads/headersig.txt]. But it would probably be easier to adjust your application so it doesn't have to guess.
    ~

  • In ALV how to make column heading in two lines ?

    In ALV if one the column heading is say for example "Purchase Order", if i want to display it as "Purchase" and "Order" below the "Purchase". Is it possible? if so how?
    Thanks in advance.
    Sounder

    Hi Sounder,
         It is highly impossible... If u tell your requirement clearly... we will try for solution..
    thanks and regards
    sk
    Rewards if helpful

  • How to display column header of a JTable in JScrollpane's RowHeader

    Can anyone tell me if it's possible to display the colum headers of a JTable which acts as the row headers of a JScrollpane object?
    If the answer is yes, could he/she point me to the right direction?
    Thanks,

    I'm guessing the answer is no because the column header is layed out horizontally and a row header is layed out vertically. But it should be easy enough to test:
    scrollPane.setRowHeaderView(table.getTableHeader());
    Its not hard to create your own row header. Search the forum using "+setrowheaderview +camickr" to find examples I've posted.

Maybe you are looking for

  • Problem with writing to file

    What the program is supposed to do Print the squares of one through ten to a file whose name is typed in by the user. My Program import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; public class SquareSend      private

  • Has anyone had any problem with the multi choice tick boxes on a windows computer?

    I have just created a form with check boxes on my iMac, emailed it to a windows based account and found that the check boxes don't work in windows explorer. Has anyone else had this problem?

  • How to transfer photo with 2 accounts

    hi, could somebody tells me how i can transfer photos (from iphoto) from one account to another? (i have created two accounts on my mac book pro. many thanks.

  • NESTED TABLE BIND VARIABLE IN A REF CURSOR

    Hi, this works: open c_ref for v_sql using cp_asset_type where cp_asset_type is a nested tables passed into the proc as an 'in' parameter, but since the number of passed tables varies I loaded the nemes into an a nested table and tried the following:

  • Trying to restore ipod, telling me to turn off find my iPhone?

    I forgot my ipod touch password, so I wanted to restore a backup. Whenever I press restore a backup, it tells me to turn off "find my iphone". However I can't do this becuase my ipod touch is disabled, and I don't know the password. Thanks beforehand