Cant' tsee column names

Hello!
What is wrong with this code ?
I can't see the column names.
Regards
Ilhan
TABLES:     ekko.
TYPE-POOLS: slis.                                 "ALV Declarations
TYPES: BEGIN OF t_ekko,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
  menge TYPE ekpo-menge,
  meins TYPE ekpo-meins,
  netpr TYPE ekpo-netpr,
  peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      it_ekpo     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko     TYPE t_ekko,
      wa_ekpo     TYPE t_ekko.
DATA: ok_code like sy-ucomm,           "OK-Code
      save_ok like sy-ucomm.
DATA: fieldcatalog  TYPE lvc_t_fcat WITH HEADER LINE.
DATA: gd_fieldcat   TYPE lvc_t_fcat,
      gd_tab_group  TYPE slis_t_sp_group_alv,
      gd_layout     TYPE slis_layout_alv.
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA: gd_tree             TYPE REF TO cl_gui_alv_tree,
      gd_hierarchy_header TYPE treev_hhdr,
      gd_report_title     TYPE slis_t_listheader,
      gd_logo             TYPE sdydo_value,
      gd_variant          TYPE disvariant.
DATA: l_tree_container_name(30) TYPE c,
      l_custom_container        TYPE REF TO cl_gui_custom_container,
     gd_tree_container_name    TYPE REF TO cl_gui_custom_container,
     gd_custom_container TYPE REF TO cl_gui_custom_container.
* Add following code to 'Z......F01' INCLUDE
*&      Form  CREATE_ALVTREE_CONTAINER
*       Create container for alv-tree
FORM create_alvtree_container.
*  gd_tree_container_name = 'SCREEN_CONTAINER'.
  create object gd_custom_container
      exporting
            container_name = 'SCREEN_CONTAINER'
      exceptions
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5.
  if sy-subrc <> 0.
    message x208(00) with 'ERROR'.
  endif.
ENDFORM.
*Includes
*INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
*INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
*INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
*Start-of-selection.
START-OF-SELECTION.
* ALVtree setup data
    PERFORM build_fieldcatalog.
    PERFORM data_retrieval.
    PERFORM build_layout.
    PERFORM build_hierarchy_header CHANGING gd_hierarchy_header.
    PERFORM build_report_title USING gd_report_title gd_logo.
    PERFORM build_variant.
* Display ALVtree report
  call screen 100.
*&      Form  DATA_RETRIEVAL
*       Retrieve data into Internal tables
FORM data_retrieval.
  SELECT ebeln
   UP TO 10 ROWS
    FROM ekko
    INTO corresponding fields of TABLE it_ekko.
  loop at it_ekko into wa_ekko.
    SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
      FROM ekpo
      appending TABLE it_ekpo
     where ebeln eq wa_ekko-ebeln.
  endloop.
ENDFORM.                    " DATA_RETRIEVAL
*&      Form  BUILD_FIELDCATALOG
*       Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
* Please not there are a number of differences between the structure of
* ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
* For example the field seltext_m is replace by scrtext_m in ALVtree.
  fieldcatalog-fieldname   = 'EBELN'.           "Field name in itab
  fieldcatalog-scrtext_m   = 'Purchase Order'.  "Column text
  fieldcatalog-col_pos     = 0.                 "Column position
  fieldcatalog-outputlen   = 15.                "Column width
  fieldcatalog-emphasize   = 'X'.               "Emphasize  (X or SPACE)
  fieldcatalog-key         = 'X'.               "Key Field? (X or SPACE)
*  fieldcatalog-do_sum      = 'X'.              "Sum Column?
*  fieldcatalog-no_zero     = 'X'.              "Don't display if zero
  APPEND fieldcatalog TO gd_fieldcat.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'EBELP'.
  fieldcatalog-scrtext_m   = 'PO Iten'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 1.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'STATU'.
  fieldcatalog-scrtext_m   = 'Status'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 2.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'AEDAT'.
  fieldcatalog-scrtext_m   = 'Item change date'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 3.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MATNR'.
  fieldcatalog-scrtext_m   = 'Material Number'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 4.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MENGE'.
  fieldcatalog-scrtext_m   = 'PO quantity'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 5.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MEINS'.
  fieldcatalog-scrtext_m   = 'Order Unit'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 6.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'NETPR'.
  fieldcatalog-scrtext_m   = 'Net Price'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 7.
  fieldcatalog-datatype     = 'CURR'.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'PEINH'.
  fieldcatalog-scrtext_m   = 'Price Unit'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 8.
  APPEND fieldcatalog TO gd_fieldcat..
  CLEAR  fieldcatalog.
ENDFORM.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT
*       Build layout for ALV grid report
FORM build_layout.
  gd_layout-no_input          = 'X'.
  gd_layout-colwidth_optimize = 'X'.
  gd_layout-totals_text       = 'Totals'(201).
*  gd_layout-totals_only        = 'X'.
*  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
*                                         "click(press f2)
*  gd_layout-zebra             = 'X'.
*  gd_layout-group_change_edit = 'X'.
*  gd_layout-header_text       = 'helllllo'.
ENDFORM.                    " BUILD_LAYOUT
*&      Form  build_hierarchy_header
*       build hierarchy-header-information
*      -->P_L_HIERARCHY_HEADER  structure for hierarchy-header
FORM build_hierarchy_header CHANGING
                               p_hierarchy_header TYPE treev_hhdr.
  p_hierarchy_header-heading = 'Hierarchy Header'(013).
  p_hierarchy_header-tooltip = 'This is the Hierarchy Header !'(014).
  p_hierarchy_header-width = 30.
  p_hierarchy_header-width_pix = ''.
ENDFORM.                               " build_hierarchy_header
*&      Form  BUILD_REPORT_TITLE
*       Build table for ALVtree header
*  <->  p1        Header details
*  <->  p2        Logo value
FORM build_report_title CHANGING
      pt_report_title  TYPE slis_t_listheader
      pa_logo             TYPE sdydo_value.
  DATA: ls_line TYPE slis_listheader,
        ld_date(10) TYPE c.
* List Heading Line(TYPE H)
  CLEAR ls_line.
  ls_line-typ  = 'H'.
* ls_line-key     "Not Used For This Type(H)
  ls_line-info = 'PO ALVTree Display'.
  APPEND ls_line TO pt_report_title.
* Status Line(TYPE S)
  ld_date(2) = sy-datum+6(2).
  ld_date+2(1) = '/'.
  ld_date+3(2) = sy-datum+4(2).
  ld_date+5(1) = '/'.
  ld_date+6(4) = sy-datum(4).
  ls_line-typ  = 'S'.
  ls_line-key  = 'Date'.
  ls_line-info = ld_date.
  APPEND ls_line TO pt_report_title.
* Action Line(TYPE A)
  CLEAR ls_line.
  ls_line-typ  = 'A'.
  CONCATENATE 'Report: ' sy-repid INTO ls_line-info  SEPARATED BY space.
  APPEND ls_line TO pt_report_title.
ENDFORM.
*&      Form  BUILD_VARIANT
*       Build variant
form build_variant.
* Set repid for storing variants
  gd_variant-report = sy-repid.
endform.                    " BUILD_VARIANT
*&      Module  STATUS_0100  OUTPUT
*       text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'STATUS1'.
  SET TITLEBAR 'STATUS1'.
IF gd_tree IS INITIAL.
    PERFORM create_alvtree_container.
    PERFORM create_object_in_container.
    PERFORM create_empty_alvtree_control.
    PERFORM create_alvtree_hierarchy.
ENDIF.
  CALL METHOD cl_gui_cfw=>flush.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
*       text
MODULE USER_COMMAND_0100 INPUT.
DATA return TYPE REF TO cl_gui_event.
  save_ok = ok_code.
  case ok_code.
    when 'BACK' or '%EX' or 'RW'.
*     Exit program
      leave to screen 0.
*   Process ALVtree user actions
    when others.
      call method cl_gui_cfw=>get_current_event_object
              receiving
                 event_object = return.
      call method cl_gui_cfw=>dispatch.
  endcase.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
* Add following code to 'Z......F01' INCLUDE
*&      Form  CREATE_OBJECT_IN_CONTAINER
*       Create ALVtree control
FORM create_object_in_container.
  create object gd_tree
    exporting
        parent              = gd_custom_container
        node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
        item_selection      = 'X'
        no_html_header      = ''
        no_toolbar          = ''
    exceptions
        cntl_error                   = 1
        cntl_system_error            = 2
        create_error                 = 3
        lifetime_error               = 4
        illegal_node_selection_mode  = 5
        failed                       = 6
        illegal_column_name          = 7.
  if sy-subrc <> 0.
    message x208(00) with 'ERROR'.
  endif.
ENDFORM.
* Add following code to 'Z......F01' INCLUDE
*&      Form  CREATE_EMPTY_ALVTREE_CONTROL
*       Create empty tree control
FORM create_empty_alvtree_control.
* Create emty tree-control
  CLEAR: it_emptytab.
  REFRESH: it_emptytab.
  CALL METHOD gd_tree->set_table_for_first_display
     EXPORTING
               is_hierarchy_header  = gd_hierarchy_header
               it_list_commentary   = gd_report_title
               i_logo               = gd_logo
*               i_background_id      = 'ALV_BACKGROUND'
               i_save               = 'A'
               is_variant            = gd_variant
     CHANGING
               it_outtab            =  it_emptytab      "Must be empty
               it_fieldcatalog      =  gd_fieldcat.
ENDFORM.                    " CREATE_EMPTY_ALVTREE_CONTROL
* Add following code to 'Z......F01' INCLUDE
*&      Form  CREATE_ALVTREE_HIERARCHY
*       text
*       Builds ALV tree display, (inserts nodes, subnodes etc)
form create_alvtree_hierarchy.
  data: ls_sflight type sflight,
        lt_sflight type sflight occurs 0.
  data: ld_ebeln_key type lvc_nkey,
        ld_ebelp_key type lvc_nkey.
  loop at it_ekko into wa_ekko.
    perform add_ekko_node using      wa_ekko
                            changing ld_ebeln_key.
    loop at it_ekpo into wa_ekpo where ebeln eq wa_ekko-ebeln.
      perform add_ekpo_line using      wa_ekpo
                                       ld_ebeln_key
                              changing ld_ebelp_key.
    endloop.
  endloop.
* calculate totals
  call method gd_tree->update_calculations.
* this method must be called to send the data to the frontend
  call method gd_tree->frontend_update.
endform.                    " CREATE_ALVTREE_HIERARCHY
*&      Form  ADD_EKKO_NODE
*       text
*      -->P_WA_EKPO  text
*      -->P_0553   text
*      <--P_EBELN_KEY  text
form add_ekko_node using    ps_ekko like wa_ekko
                            value(p_relate_key)
                   changing p_node_key.
data: ld_node_text type lvc_value,
       ls_sflight type sflight.
* Set item-layout
  data: lt_item_layout type lvc_t_layi,
        ls_item_layout type lvc_s_layi.
  ls_item_layout-t_image   = '@3P@'.
  ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
  ls_item_layout-style     = cl_gui_column_tree=>style_default.
  ld_node_text             = ps_ekko-ebeln.
  append ls_item_layout to lt_item_layout.
* Add node
  call method gd_tree->add_node
    exporting
          i_relat_node_key = p_relate_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = ld_node_text
          is_outtab_line   = ps_ekko
          it_item_layout   = lt_item_layout
       importing
          e_new_node_key = p_node_key.
endform.                    " ADD_EKKO_NODE
*&      Form  ADD_EKPO_LINE
*       text
*      -->P_WA_EKPO  text
*      -->P_LD_EBELN_KEY  text
*      <--P_LD_EBELP_KEY  text
form add_ekpo_line using    ps_ekpo like wa_ekpo
                            value(p_relate_key)
                   changing p_node_key.
data: ld_node_text type lvc_value,
       ls_sflight type sflight.
* Set item-layout
  data: lt_item_layout type lvc_t_layi,
        ls_item_layout type lvc_s_layi.
  ls_item_layout-t_image   = '@3P@'.
  ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
  ls_item_layout-style     = cl_gui_column_tree=>style_default.
  ld_node_text             = ps_ekpo-ebelp.
  append ls_item_layout to lt_item_layout.
* Add node
  call method gd_tree->add_node
    exporting
          i_relat_node_key = p_relate_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = ld_node_text
          is_outtab_line   = ps_ekpo
          it_item_layout   = lt_item_layout
       importing
          e_new_node_key = p_node_key.
endform.                    " ADD_EKPO_LINE

Hi!
In the fieldcatalog form, you have to give all kind of texts, not only the middle sized one.
fieldcatalog-scrtext_m   = 'Status'.
Enter the other ones also, like S, and L. SAP picks the text, which fits the best to the actual size of the column. It is very rare when it is using the m size.
fieldcatalog-scrtext_s   = 'Status'.
fieldcatalog-scrtext_l   = 'Status'.
Personally I prefer to set up an own structure for every alv grid, in SE11. I can prevent this way the "hard coding" and the texts can be easily translated.
Regards
Tamá

Similar Messages

  • How to get table and column names thats being used in SQL , that's generating all my reports on SSRS.

    Good day,
    I searched through the forum and cant find anything.
    I have around 300 published reports on SSRS and we are busy migrating to a new system.
    They have already setup their tables on the new system and I need to provide them with a list of table names and column names that are being used currently to generate the 300 reports on SSRS.
    We use various tables and databases to generate these reports, and will take me forever to go through each query to get this info.
    Is it at all possible to write a query in SQL 2008 that will give me all the table names and columns being used?
    Your assistance is greatly appreciated.
    I thank you.
    Andre.

    There's no straightforward method for that I guess. There are couple of things you can use to get these details
    1. query the ReportServer.dbo.Catalog table
    for getting details
    you may use script below for that
    http://gallery.technet.microsoft.com/scriptcenter/42440a6b-c5b1-4acc-9632-d608d1c40a5c
    2. Another method is to run the reports and run sql profiler trace on background to retrieve queries used.
    But in some of these cases the report might be using a procedure and you will get only procedure. Then its upto you to get the other details from procedure like tables used, columns etc
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to select columns in a table by their column id and not the column name

    Hello,
    How do you select columns from a table based on their column_id.
    I have create a view
    but other than Select * , i cant now select one just one column from it
    the view as follow:
    create view count_student as
    select a.acode "acode",aname "Activity Name",count(ae.acode) "Number of student joined"
    from aenrol ae, activity a
    where a.acode= ae.acode
    group by a.acode,aname;

    The issue is that you have decided to use quoted column names. A pretty horrible idea (mostly for the reasons that you are now finding).
    Re-create the view and get rid of the silly double quotes.

  • Unknown Column Name "XYZ" not detemined untill runtime.Select query.

    Hi,
    I have written a query in ABAP.I am getting following error.Can some one help me resolve this.There is a column "LANDX" in standard table T005 of PI which i need to get values from. The problem is that the column is visible only at runtime and not otherwise.How can i fetch data from this coulmn writing a select query for this.
    Query written is:
    SELECT landx from T005 into table it_t005.
    Error:
    "Unknown column name "XYZ" not determined untill runtime,you cannot specify a field list."

    Hi Deepika u were right. that there is a landx field but it is included in that table.
    so u cant exactly get it.
    now u can get ur country name and iso code just like this.
    tables: t005t  , t005.
    data: BEGIN OF it OCCURS 100,
            landx like t005t-landx,
            intca like t005-intca,
            END OF it.
    SELECT t005t~landx t005~intca   into CORRESPONDING FIELDS OF TABLE it
      from T005t
      INNER JOIN t005 on ( t005t~land1 = t005~land1 ).
    it is fulfilling ur need.
    Edited by: Matt on Feb 3, 2009 7:49 AM - Please don't use txtspk

  • Column name- desc

    hi gems..
    cant i use DESC as a column name???
    when i was trying to create a table having one of the column name DESC VARCHAR2(250) , then it got failed with invalid identifier error..

    No, you cannot use "DESC" as it is a reserve word.
    SQL> create table t (desc varchar2(100));
    create table t (desc varchar2(100))
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL>and not advisable to use mixed case for table/column names.
    SQL> create table t ("Desc" varchar2(100));
    Table created.
    SQL> desc t
    Name                                      Null?    Type
    Desc                                               VARCHAR2(100)
    SQL> select "Desc" from t;
    no rows selected
    SQL>

  • TO Rename a column name

    Hi all,
    I have a table employee with columns
    'employee_id',
    'employee_name'
    ' employee_city' ( Note the spaces before the column name )
    The table is created successfully.
    But i cant to able to retreive the data by specifying the column name..
    eg: select employee_city from employee.
    It throws an error.
    Please send me a solution to reanme the column name, so that it should not contain any spaces at start & end.
    Thanks & Regards,
    Hariharan ST

    Obviously the table was created this way:
    SQL>create table testtab
    "employee_id" number,
    "employee_name" varchar2(100),
    " employee_city" varchar2(100)
    Table created.
    SQL>desc testtab
    Name                                      Null?    Type
    employee_id                                        NUMBER
    employee_name                                      VARCHAR2(100)
      employee_city                                     VARCHAR2(100)Note the double quotes: Columns that are created this way can only be selected using double quotes, too:
    SQL>select employee_city from testtab;
    select employee_city from testtab
    ERROR at line 1:
    ORA-00904: "EMPLOYEE_CITY": invalid identifier
    SQL>select " employee_city" from testtab;
    employee_city
    Chicago
    SQL>This of course is a very bad idea. Dave already showed you how to rename the columns.
    Regards,
    Gerd

  • Adding column names to data file

    Hi,
    I have a question regarding writing to file. Currently in my program, when I start running it, a dialog box pops up and the user gets to pick/ create a file. My data is written on to a file as columns. I want to add column names to the file. Any suggestions on how to do it? Since the file is created by the user at run time and since the column names have to be added just once at the beginning, I'm not sure how to go about doing this. Any suggestions or pointers?
    Thanks,
    Sukanya

    dear sir
    i wanted to ask you help. i saw your program bt i am having a big problem
    here is my VI. i actually have to do a database where there is the name of the student,
    date of equipment of borrowal. time of the equiment when it was borrowed and its date
    but when am doing this. each time i always have to create a new file each time.
    i cant use the only onw file.
    and also my 2nd problem is that when the output is being yielded, it is repeatedly
    givine me the same output twice, thrice and a lot like in the pic below
    help please
    Attachments:
    1we.JPG ‏84 KB
    doom..JPG ‏44 KB

  • How to rename C00n generic column names in a Dynamic SQL report

    I have a an interface whereby the user can select 1 to 60 (upper limit) columns out of 90 possible columns (using a shuttle) from one table before running a report.
    To construct the SQL that will eventually execute, I'm using a "PLSQL function body returning SQL query" with dynamic SQL. The only problem is that I have to use "Generic Column Names" option to be able to compile the code and end up with c001 to c060 as the column names.
    How can I use the names of the selected columns as the report headings rather than c001, C002... etc?
    I do not know beforehand which columns, or how many columns or the order of the selected columns.
    I know Denes K has a demo called Pick Columns but I can't access his code. I have a hunch though that he may be just using conditions to hide/show the apropriate columns.
    thanks in advance
    PaulP

    Hi Paul
    I would change the Heading Type in the Report Details screen to PLSQL and use the shuttle item to return the column values. e.g.
    RETURN :p1_shuttle;
    I'm assuming the shuttle already has a colon separated list of the column headings in the correct order?
    I hope that helps
    Shunt

  • Reading MS Project column names and data on the fly from a selected View

    Hi guys,
    I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
    1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
    2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
    The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
    The solution needs to work on a master schedule as well.
    Appreciate your feedback.

    Just to get you started the following code writes the field name and data for the active task to the Immediate window.
    Sub CopyData()
    Dim fld As TableField
    For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
    If fld.Field >= 0 Then
    Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
    End If
    Next fld
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Oracle 10g - Defining the column name in Non English

    Hi Experts,
    I have an exisitng application which is developed on Windows using ASP Technology and uses Oracle 10g 10.1.0.2.0.
    The application is supported with an instance of Data Base within which multiple tablespaces are created for different clients. The application is developed in such a way that some of the tables arecreated dynamically and the columns are named using the data entered through the UI.
    This application needs to be globalized now. The problem is, the column name entered through the UI can be in any language based on the client's settings and those values in turn will be used for naming the columns in the tables.
    1) Can I have the column names to be named using non english characters in Oracle 10g DB? If so,
    1.1) what should I do to configure the exisiting Oracle instance to support it?
    1.2) To what level is that configuration possible, is it per DB instance level (or) can it be done at Tablespace level. I would like to configure each tablespace to host tables with columns defined with different languages, say for example, tablespace 1 will have tables with Japaenese column names and tablespace 2 will have tables with German column names?
    2) What should I do to make my entire DB to support unicode data i.e., to accept any language strings. Currently all strings are declared as VarChar2, should I change all VarChar2 to NVarChar2 (or) is there a way to retain the VarChar2 as is and make some database wide setting?
    Please note that I do not have an option of retaining the column in English as per the Business Requirement.
    Envionment:
    OS - Windows 2003 32 bit
    Oracle 10g 10.1.0.2.0
    UI forms in ASP
    TIA,
    Prem

    1. Yes, you can.
    SQL> create table ÜÝÞ( ßàá number(10));
    Table created.
    SQL> insert into ÜÝÞ values (10);
    1 row created.1.1 and 1.2 and 2. You can choose UTF as your default character set. It allows the user of non-English characters in VARCHAR columns in your whole database. It is not per tablespace.
    SQL> create table ÜÝÞ( ßàá varchar2(100));
    Table created.
    SQL> insert into ÜÝÞ values ('âãäçìé');
    1 row created.

  • What is the order of Column Names in Sqlite query results?

    I am writing an application using Adobe Air, Sqlite, and Javascript.
    After writing the following select statement:
              SELECT field1, field 2, field 3, field 4 FROM TableA;
    I would like to get the columnName/data combination from each row -- which I do successfully with a loop:
              var columnName="";
              for (columnName in selResults.data[i]) {
                   output+=columnName + ":" + selResultsdata[i][columnName] + ";";
    My issue is that the column names come out in a different order every time I run the query and never once have they come out in the desired order -- field 1, field 2, field 3, field 4.  If I run the query in Firefox's Sqlite Manager, the columns come out in the "proper" order. When I run them in Adobe Air, the order will be the same if I run the query mulitple times without closing the app.  If I make a change such as declaring the columnName variable with "" before the for column, or declare it as (var = columnName in selResults.data) , then the order changes.  If I shut down my app and re-open after lunch and run query, it comes out in another order.  At this time, I'm not interested in the order of the rows, just the order of the columns in each output row.  I've even tried assiging an index to columnName which seems to just pick up a single letter of the columnName.
    I'm in the process of changing my HTML presentation of the data to assign a precise columnName to an HTML table title, but I'm reluctant to let go of the above concept as I think my separation of HTML/presentation and Javascript would be better if I could use the solution described above.
    So, does anybody know how to force the order of the columnNames in my output -- or what I'm doing to cause it to come out in a different order?
    Jeane

    Technically there isn't any "order" for the return columns. They aren't returned as an Array -- they're just properties on an Object instance (a "generic object"). The random order you're seeing is the behavior of the for..in loop iterating over the properties of the object. Unfortunately, with a for..in loop there is no guaranteed order for iterating over properties (and, as you've seen, it tends to vary wildly).
    The only solution is to create your own list of the column names and sort it the way you want to, then use that to create your output. For example, use the for..in loop to loop over the properties, but rather than actually get the values, just dump the column names into an Array:
    var columnName="";
    var columns = [];
    for (columnName in selResults.data[i]) {
        columns.push(columnName);
    columns = columns.sort(); // just uses the default alphabetical sort -- you would customize this if desired
    var j = 0;
    for (j = 0; j < columns.length; j++) {
        columnName = columns[j];
        output+=columnName + ":" + selResultsdata[i][columnName] + ";";

  • Can we use Column Names in Parameter Cursor

    Hi
    can we use Column Names in Parameter Cursor??
    DECLARE
    CURSOR Emp_Cur (P_Deptno NUMBER)
    IS
    SELECT Empno, Ename
    FROM Emp
    WHERE Deptno = P_Deptno;
    BEGIN
    FOR Emp IN Emp_Cur(10)
    LOOP
    DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
    DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
    END LOOP;
    FOR Emp IN Emp_Cur(20)
    LOOP
    DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
    DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
    END LOOP;
    END;
    In the above Program, I send Deptnumber. If i send Column names like Empno, Ename. What can i do??
    If Declare Samething Through Parameter Cursor, it doesn't accept VARCHAR2(Size)

    For parameters you don't use size, just the type (DATE, NUMBER, VARCHAR2, CLOB, ...)
    DECLARE
      CURSOR Emp_Cur (P_Ename VARCHAR2)
      IS
        SELECT Empno, Ename
        FROM Emp
        WHERE Ename = P_Ename;
    BEGIN
      FOR Emp IN Emp_Cur('SCOTT')
      LOOP
        DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
        DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
      END LOOP;
    END;

  • Can I use bind variable instaed of writing static COLUMN Name

    Hi , I am having a table containing id and column names, the data is stored against that id in other tables. Now I wish to update data into another table so that it goes into apppropriate column without using decode function.
    I am trying to do this:
    EXECUTE IMMEDIATE 'update TEST set :1 = :2
    where PROJECT_ID= :3 and UNIQUE_ID= :4' using P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID;
    the values P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID are populated using a cursor in PL/SQl
    Is this statement valid? If not can you tell me how to do it as I am getting some error I am unable to comprehend.
    thanks
    Rishabh

    Column names cannot be substituted at run-time as bind variables. If you need to specify the column name at run-time, you'd need to construct a new string and execute that string dynamically, i.e.
    EXECUTE IMMEDIATE 'UPDATE test SET ' || p_dest_column || ' = :1 ' || ...From a data model standpoint, storing column names as data elements in another table is generally a rather poor idea. It's likely to make ad-hoc reporting nearly impossible and to cause a lot more parsing than would otherwise be required.
    Justin

  • Need help on getting the column names of Tabletype

    I have a table Mapping with the following values: This Mapping table contains the table names (in Tabname) and the column names(colname) of various tables and values(ValuesTobeFilled) for the columns.
    I have to insert into the tables present in the Tabname field with the values present in the ValuesTobeFilled in the columns present in the Colname field.
    Note: The Mapping table need not contain all the columns of the base table. The columns that are not present can be filled with null. And this mapping table is not fixed i.e. rows can be inserted/deleted frequently.
    Sample values in mapping table:
    Tabname                        Colname        ValuesTobeFilled
    sample_items     Eno     Corresponding Expression to get the values from XML input
    sample_items     Ename     Corresponding Expression to get the values from XML input
    XXX     YYY     Corresponding Expression to get the values from XML input
    Before filling in the actual tables, I have to store the entire data temporarily and I have used a tabletype declared as follows:
    TYPE T_sample_items IS TABLE OF sample_items%ROWTYPE INDEX BY BINARY_INTEGER;
    l_sample_items T_sample_items;
    Where the table sample_items have the following columns:
    •     Eno
    •     Ename
    •     Eaddress
    •     Eemail
    So, the tabletype should be filled as:
    Eno     Ename     Eaddress     EEmail
    1     XXX     -     -
    I have declared a cursor to select the values from mapping table and I need to fill in the ValuesTobeFilled values to the corresponding table.
    CURSOR c_xpath (c_tname mapping.TABNAME%type)
    IS
    select * from mapping where tabname = c_tname;
    CURSOR c_tables
    IS
    SELECT DISTINCT TABNAME FROM mapping;
    FOR crsr IN c_tables
    LOOP
    p_tname := CRSR.TABNAME;
    FOR csr IN c_xpath(p_tname)
    LOOP
    IF l_xml_doc.EXISTSNODE(CSR.XPATH_EXP) = 1
    THEN
    l_node_value := l_xml_doc.extract(CSR.XPATH_EXP).getStringVal(); -- This is the value to be stored in the corresponding column
    ELSE
         l_node_value := NULL;
    END IF;
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).name := l_node_value;
    END IF;
    END LOOP;
    END LOOP;      
    And I need to eliminate hard coding while comparing the column names (in the following piece of code) as the Mapping table values are subject to insertion/deletion:
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).ename := l_node_value;
    END IF;
    I need to insert the values directly into the tabletype without this hardcoding. Please suggest me ways to compare the mapping table values with the field (column) names of the tabletype. If it is not possible using tabletype, please suggest any other ways of fixing the problem.
    Many thanks,
    Gopi

    I take it this isn't going to be a serious production system at the end of the day?
    Storing metadata in tables for extraction and insertion of data is just wrong in so many ways. It smells heavily of Entity Attribute Value modelling, which is the most wrong way to use a relational database and is known to have major performance implications and be liable to bugs and issues. The idea that EAV modelling allows for 'generic' databases where new data items can be added flexibly later on without having to change code is usually justified with an excuse of "it means we don't have to update all our tables when we want a new column" which is easily countered with "if you're adding a single column a good relational design wouldn't require you to add it to more than one table anyway in most cases".
    Just what exactly are you trying to do and why? There has to be a better way.

  • Excel 2013 connect to a cube, and Power View concatenate the column name by default

    Hi Guys,
    Currently, we met a problem with excel services to connect to a cube, when we develope a Excel 2013 Powerview report, the data model column name is concatenate into terrible name by default. e.g. Dim TimeDate Date, Dim TimeTime HierachyYear -Month.
    But when start up the data model with Powerpivot, everything gone well. We knew that it can be manual update the name as workaround, but we need to do it every time we create a new powerview with the data model.
    Is that any other solution we can do with?
    Please help.
    Johnny

    Hi,
    As this question is more related to PowerView Report, I suggest you can create a new post in the PowerView forum, you will get more helpful information from there.
    PowerView Forum:
    https://social.technet.microsoft.com/Forums/en-US/home?forum=powerview
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

Maybe you are looking for

  • Resetting a LAP

    So supposing I have a LAP that I move from one WLC to another WLC on a different subnet. I reset this very same AP to factory settings using the mode button, when I attempt to join to the 2nd WLC I have issues with the AP retaining its previous IP se

  • IChat and a D-Link DIR-655

    I've read the various support discussions on this router and using it with iChat. Lots of fixes and settings have been given. People say it works and it doesn't work. If you use iChat (especially with screen sharing) and have a DIR-655, please post h

  • How can I get rid of "handles" on a Numbers table?

    The "handles" on tables are useful when designing a spreadsheet. However, when entering data into that same table those same "handles" are annoying. This is not a problem for me, but I have designed a couple of spreadsheets for my 87 year old mother

  • Service Reuqest Custom Fields on Reports

    Hi, I Added 3 new custom fields of type "Integer" to Service Reuqest. Now, when I come to combine them in an analysis (Going to Reports -> Design Analysis -> under REPORTING choosing "Service Reuqests" I can't see these fields, when looking in "Servi

  • Help on sequence

    I have a table school. In thisw school_id is the primary key. SQL> CREATE SEQUENCE sch_SEQ; I need to insert some rows into the table using sch_SEQ to populate the sch_id column. BUt the data is not affected. please help me to resolve the issue Thank