Extraction of dynamic columns in table

I have table with 1000 rows and 200 columns. The columns have additional suffix IE
Table = 'X '.
Columns = ID, A, B, C, D1, D2, D3... D200

I would like to get the values of each column so that I can treat them accordingly.


OPEN c1 to SELECT * FROM X

LOOP
C1 FETCH BULK COLLECT INTO l_dies;

FOR indx IN 1... l_dies. COUNTY
LOOP
FOR indx to 0... 200
LOOP
colStr: = l_dies (indx). || » D'|| INDX; <-trying to dynamic column of concat name, but it gives an error.
Dbms_output.put_line ('indx =' | indx |) 'col = value' | colStr);
END LOOP;
END LOOP;
END LOOP;

Maybe it's not the right way, but just an example of what I want to achieve.

Thanks in advance.

http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1035431863958

Visit this link especially the very first post of Tom (Proc print_table).

I hope this helps.

Concerning

REDA

Tags: Database

Similar Questions

  • Missing cells in the table of dynamic columns

    Hello

    I am creating a table using dynamic columns. Here's an example simplified data that I use:

    < sales >
    ... < drive >
    ... Honda < brand > < / brand >
    ... < color > green < / color >
    ... < / car >
    ... < drive >
    ... Nissan < brand > < / brand >
    ... < color > blue < / color >
    ... < / car >
    ... < drive >
    ... Honda < brand > < / brand >
    ... < color > blue < / color >
    ... < / car >
    < sales >

    I am grouping the brands for the lines, and I want a number of colors as my dynamic column. I find myself with a table that looks like this:

    ----------------------------------------------------------------------------------
    Brand | Blue | Green |
    ----------------------------------------------------------------------------------
    Honda | 1. 1.
    ----------------------------------------------------------------------------------
    Nissan | 1
    --------------------------------------------------------

    Since there is no green Nissan, a cell not created so I find myself with a hole in my table. Ideally, I would want a cell containing 0 to be in this space.
    Is it possible, or to all the least have a cell in this space, so I did not have a table with gaps?

    Thank you!

    Hi cc22

    If you have a look at these. http://winrichman.blogspot.com/search/label/cross%20tab
    you will identify yourself,

    its simple... If this is not the case, let me know.

  • dynamic columns

    I use

    DB 10g Release 10.2.0.1.0

    Oracle 6i 6.0.8.8.3 reports

    in the table below.

    How can I have the dynamic columns 'fault' in reports in the order of its highest value of occur_times.

    and a view that gives me no reports (formats below).

    CREATE TABLE dem

    (trid NUMBER (9.0),)

    tr_date DATE,

    point VARCHAR2 (10),

    failure VARCHAR2 (5).

    occur_times NUMBER (9.0))

    /

    INSERT INTO dem

    VALUES

    (1, 26 - JAN 2016', 'MC', 'AB', 3)

    /

    INSERT INTO dem

    VALUES

    (2, 26-JAN 2016', 'MC', 'FM', 2)

    /

    INSERT INTO dem

    VALUES

    (3, 26 - JAN 2016', 'MC', 'SO', 5)

    /

    INSERT INTO dem

    VALUES

    (4, 27 - JAN 2016', 'MC', 'AB', 8)

    /

    INSERT INTO dem

    VALUES

    (5, 27-JAN 2016', 'MC', 'FM', 2)

    /

    INSERT INTO dem

    VALUES

    (6, 27-JAN 2016', 'MC', 'SO ', 1).

    /

    Commit

    /

    example1

    "Report of input parameter: count 26 January 2016 ' to 26 January 2016"

    Output format of report

    point defects Total SW AB FM

    -------   ----------------   ----    -----  -----

    MC                10       5      3      2

    e.g.2

    "Report of input parameter: count 26 January 2016 ' January 27, 2016"

    Output format of report

    point defects Total FM SW AB

    -------   ----------------   ---------  -----

    21 11 6 4 MC

    in example1 in date range, the flaws in the order of its value max occur_times is FM SW, AB,

    but in e.g.2. in view of the date range default by order of its value max occur_times is AB, SW, FM

    THE FAULT of MAX VALUE should take precedence i.e. dynamically in the reports.

    concerning

    teefu

    Lahore, pakistan.

    You must create the parameter in the oracle reports. When the report of the form calling create the parameter list and then pass the required parameter.

    SELECT the item,

    fault,

    Sum (occur_times) tot_times,

    ROW_NUMBER() over (ORDER BY SUM (occur_times) DESC) rn

    DEM

    WHERE the fault ("AB", "FM", "SW")

    AND tr_date BETWEEN TO_DATE(:p_dt1,'dd-Mon-yyyy') AND TO_DATE(:p_dt2,'dd-Mon-yyyy')

    GROUP BY item, fault

    ;

  • Dynamically read the table name in the query update

    Hi all

    I am trying to run the updated sql query where the name of the table should be read dynamically from another table below.

    Please let me what wrong with my request.

    setting a day (select CONCAT('T',schemaid) from outline, which the name = 'Analyzer') set c7 = 99;

    "outline" is a table that contains two columns name and schemaid.

    all the table created in our database with the prefix 't' T4345 for example.

    I did as suggested by you

    No, you didn't.  I did not any package creation code in my example, in order to better that you you point the finger.

    Your syntax is invalid for creating a package with the code like this, please read on creating packages and procedures within them if that's what you want to do.

    In addition, your package creation statement is to create a package specification, but you put in the code which must be in a package body, not a notebook loads.

    It should be something like (untested since I don't have your tables)...

    create or replace package my_packg as
    procedure dowhatever.
    end;
    /

    create or replace package body my_packg as
    dowhatever procedure is
    TBL varchar2 (30);
    Start
    Select 't' | SchemaId
    in tbl
    of outline
    where name = 'Analyzer ';
    run immediately 'Update'. "TBL |' set c7 = 99;
    end;
    end my_packg;
    /

    and then call this procedure by calling my_packg.dowhatever ();

  • Creating a dynamic column editable

    I tried to make my dynamic columns as editable. The problem is that my dynamic columns are nested.

    Now editable column works fine when I have diff columns with a different name. For example, col1, col2, col3 (not nested)

    Or I nested columns like "pass"(parent) given two columns col1 and col2. ".

    But, when I use them in a dynamic of columns in which all of them have the same name, in the example below, each with the same name 'col', I can change all of them, but the textfield never faded away, when I click on ENTER.


    Suppose I have an editable column with col name:
    for (final CategoryTypeVO type : typeList)
                    {
                           TableColumn<ItemVO, Integer> col = new TableColumn<ItemVO, Integer>(type.getTypeName());
                          col.setMinWidth(100);
                          col.setEditable(true);
                          col.setCellFactory(cellFactory);
                         
                         
                          col.setOnEditCommit(
                                   new EventHandler<TableColumn.CellEditEvent<ItemVO, Integer>>() {
                                   public void handle(TableColumn.CellEditEvent<ItemVO, Integer> t) {
                                   ((ItemVO)t.getTableView().getItems().get(
                                   t.getTablePosition().getRow())).getListType().get(type.getTypeId()).setQuantity(t.getNewValue());
                                   }
                                   });
                           quantity.getColumns().add(col);
                         }
    and cellfactory as:
    final Callback<TableColumn<ItemVO, Integer>, TableCell<ItemVO, Integer>> cellFactory = new Callback<TableColumn<ItemVO, Integer>, TableCell<ItemVO, Integer>>() {
                        public TableCell call(TableColumn p) {
                             return new EditingCell();
                        }
                   };
    and Editing class as
    class EditingCell extends TableCell<ItemVO, Integer> {
               
               private TextField textField;
              
               public EditingCell() {}
              
               @Override
               public void startEdit() {
                   super.startEdit();
                  
                   if (textField == null) {
                       createTextField();
                   }
                  
                   
                   setGraphic(textField);
                   setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                   textField.selectAll();
                   Platform.runLater(new Runnable() {
                       @Override
                       public void run() {
                           textField.requestFocus();
                       }
                  });
               }
              
               @Override
               public void cancelEdit() {
                   super.cancelEdit();
                  
                   setText(String.valueOf(getItem()));
                   setContentDisplay(ContentDisplay.TEXT_ONLY);
               }
          
               @Override
               public void updateItem(Integer item, boolean empty) {
                   super.updateItem(item, empty);
                  
                   if (empty) {
                       setText(null);
                       setGraphic(null);
                   } else {
                       if (isEditing()) {
                           if (textField != null) {
                               textField.setText(getString());
                           }
                           setGraphic(textField);
                           setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                       } else {
                           setText(getString());
                           setContentDisplay(ContentDisplay.TEXT_ONLY);
                       }
                   }
               }
               
              
               
          
               private void createTextField() {
                   textField = new TextField();
                   //textField.setText(getString());
                   textField.setText("0");
                   textField.setMinWidth(this.getWidth() - this.getGraphicTextGap()*2);
                   
                   textField.focusedProperty().addListener(new ChangeListener<Boolean>() {
    
                          @Override
                          public void changed(ObservableValue<? extends Boolean> arg0, Boolean arg1, Boolean arg2) {
                              if (!arg2) {
                                  commitEdit(Integer.parseInt(textField.getText()));
                              }
                          }
                      });
                   
                   textField.setOnKeyReleased(new EventHandler<KeyEvent>() {
                       @Override public void handle(KeyEvent t) {
                           if (t.getCode() == KeyCode.ENTER) {
                               commitEdit(Integer.parseInt(textField.getText()));
                           } else if (t.getCode() == KeyCode.ESCAPE) {
                               cancelEdit();
                           }
                       }
                   });
               }
    
              
               private String getString() {
                   return getItem() == null ? "" : getItem().toString();
               }
    Now what happens is this thing works fine if I separate columns with distinct names. But when it comes to dynamic columns, it fails, once I have edit a cell, the text field never leaves his place. It gets stuck in the cell. Any help!

    Published by: abhinay_a on January 21, 2013 12:31 AM

    Do not know what is the problem in your code, but it is easier to use TextFieldTableCell than building your own TableCell from scratch.

    This change to the example I posted in How to create a tableview for this? works for me:

    package itemtable;
    
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableColumn.CellDataFeatures;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.control.cell.TextFieldTableCell;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    import javafx.util.converter.NumberStringConverter;
    
    public class ItemTable extends Application {
    
      @Override
      public void start(Stage primaryStage) {
        final DAO dao = new MockDAO();
        final ChoiceBox choiceBox = new ChoiceBox();
        choiceBox.getItems().setAll(dao.getCategories());
    
        final TableView table = new TableView();
    
        // Make table editable:
        table.setEditable(true);
    
        final TableColumn nameCol = new TableColumn("Name");
        nameCol.setCellValueFactory(new PropertyValueFactory("name"));
        nameCol.setCellFactory(TextFieldTableCell.forTableColumn());
        final TableColumn priceCol = new TableColumn("Price");
        table.getColumns().addAll(nameCol, priceCol);
    
        choiceBox.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener() {
              @Override
              public void changed(ObservableValue observable, Category oldValue, Category newValue) {
                table.getItems().clear();
                priceCol.getColumns().clear();
                for (final Type type : newValue.getTypes()) {
                  final TableColumn col = new TableColumn(type.getName());
                  col.setCellValueFactory(new Callback, ObservableValue>() {
                    @Override
                    public ObservableValue call(CellDataFeatures cellData) {
                      Item item = cellData.getValue();
                      if (item == null) {
                        return null;
                      } else {
                        return item.priceProperty(type);
                      }
                    }
                  });
    
                  // Make column editable:
                  col.setEditable(true);
                  col.setCellFactory(TextFieldTableCell.forTableColumn(new NumberStringConverter()));
    
                  priceCol.getColumns().add(col);
                }
                table.getItems().setAll(dao.getItemsByCategory(newValue));
              }
            });
    
        BorderPane root = new BorderPane();
        root.setTop(choiceBox);
        root.setCenter(table);
    
        Scene scene = new Scene(root, 600, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    }
    

    Edited by: James_D January 22, 2013 07:22

  • can I insert a column of table in mysql?

    Hello

    I have a long column of table of numbers. I use labsql to connect to mysql.

    When I was a number, I change my channel number and then concatenate it with commands insert to insert my mysql table number.

    now, I want to insert a long column of numbers to mysql, but it is difficult. because for there needs to like before.

    can I insert this table in the form of lots and without recourse to a 'for' and as fast as possible?

    Best regards


  • Dynamic columns based on the user login

    Dear Experts,

    Is it possible to display the columns dynamically according to the connection of the BI Publisher user?

    For example, if the report of RTF model has 10 columns in total and if I connect with a user named "abc", I should be able to see, say 6 columns containing information about the user "abc".

    And if I have connection with "xyz", I should be able to see, say 7 columns containing information about the user "xyz".

    I will be able to assign to which column should be displayed to the user who?

    If there is a way to achieve this scenario, please let me know as soon as possible, since there is an urgent need.

    Your help will be very appreciated.

    Thanks in advance!

    Yes, using: xdo_user_name in the SQL data model, you can get the details for user identification.

    Then use this model column RTF for display of the dynamic columns.

    Example:

    Select: xdo_user_name as USER_ID of the double

    In RTF

    Column header

    Column data

  • How to map the csv (not columns) cells in the columns of table, import with sql loader

    Given «example.csv» csv file

    I want to load the data in:

    the C7 cell in column X

    cell D8 in column Y

    cell F7 in column Z

    Oracle table "exampletable" and so on. The csv file has not ordered rows and columns, so I can't just load the csv file into a new table itself. So what I'm asking is how to map to the columns in table cells load this file into Oracle (XE). Can someone point me to a tutorial?

    I know it's quite elementary, please let me know if I am sous-prescrit anything in the question.

    I ended up doing in Excel, through a very laborious process that will probably be repeated by others.

    What a pity that there is no functionality in Oracle for this kind of data import more flexible. Analysts of data often throw himself spreadsheets that look like this (or 485 of them) who must enter data one way or another.

  • OBIEE dynamic column headings based repository Variables

    Hello

    How can we provide variable name of the repository (from RPD) as column headings in reports (presentation Services).

    Can you please suggest me how to do it?

    Thanks in advance...

    RAM

    Hello

    You can use the following link.

    Oracle Business Intelligence 11g: OBIEE 11 g dynamic column headings

    I used the variable presentation here, you can substitute the variable repository. The difference is that you don't need to create variable presentation, instead you use repository variable there.

    If you are not clear with this, pleas come back. I'll write a new message on your problem.

  • OBIEE 11 g dynamic column headings

    I doubt I should do some dynamic column headings in OBIEE 11 g

    I have guest months (1,2,3...)

    but in the report I want column header to be something as if showing 1 do Jan...

    How to achieve this and is for the column headers!

    Thank you

    NK

    I fixed that with a dummy work around

    created a new prompt and pass values of the previous message and put this quick as a filter on the dashboard (dashboard properties).

    and used this new prompt variable as a header for the report

    He worked

    Thank you

    NK

  • R12 - equivalent column for table AP_AE_HEADERS_ALL GL_TRANSFER_RUN_ID

    Hello

    GL_TRANSFER_RUN_ID is a column present in the table of 11i AP AP_AE_HEADERS_ALL.

    In R12 the equivalent table is XLA_AE_HEADERS. Can you please let me know if there is an equivalent column for the 11i GL_TRANSFER_RUN_ID column in tables of R12?

    Thank you
    Rumi

    xla_ae_headers.accounting_batch_id is for creating accountants.
    Think of xla_ae_headers.group_id to transfer the GL. Other columns to consider for transfer of GL are gl_transfer_status_code and gl_transfer_date

    By
    VAMSi

  • Cannot change the column in Table

    Hello

    Well I have a table called T1 where I have some columns with 70 000 lines in this table.
    now I need to change a size of datatype of columns of 5.2 to 5.4, with the command below.

    SQL > alter table t1 modify column_name1 number (5.4);

    When I run this command I get the below error

    ORA-01440: column to change must be empty to reduce the precision or scale

    So what I did is based on the table in another table t2 and now deleted all t1 lines.
    Once again, I have changed now the column modified successfully to (5.4)
    But even once when I insert the backup to the top of table t2 in t1 I received this error below.

    ORA-01438: value larger than the precision specified for the column


    the table t1 column_name1 number (5.2)
    changed as column_name1 number (5.4)

    now why can't I could insert the values inside by a backup table?

    pls help.


    Concerning
    Stanlee.

    As the previous man said, you must change 7.4 like accuracy then try to insert. It's that workout.

    Iqbal

  • In the column of table when the values are grater that maximum linear axis it does not show the bar

    Hi guys,.

    In the column of table when the values are grater than there maximum linear axis it does not show the Bar.But I want to display the bar up to the maximum limit of the axis is linear without changing the limit max.

    Consider following the example:

    The values are 80 90 200 300

    and here is the result:

    Left: when I don't put maximum property of linear axis.

    Right: when I put in maximum property of linear axis to 200.

    Untitled.jpg

    Law 4th bar is not visible because the value of this bar is 300 which is excedding maxium. But I want the 4th bar to appear identical to 3 bar.

    How can I do this?

    Thanks in advance.

    Then you should change the value of Y to the maximum value.

    Another option, you should consider is changing the Render item column to reflect that the value is greater than the specified maximum value.

  • need a script to create multiple tables as the other columns in tables

    I need script to create multiple tables as the other columns of tables respectively.

    lets consider I want to create tables from table1... table99 like tablex1... .tablex99 columns (without data) respectively (i.e table1 as tablex1, table99 as tablex99).
    declare
    
    cursor c is select object_name from all_objects where object_type='TABLE';
    
    begin
    
    for i in c loop
    
    execute immediate 'create table '||i.object_name||'_x as select * from '||i.object_name||' where 1=2';
    
    end loop;
    
    end;
    
    use can use this and put your user names accordingly.
    If you get any error please post the error.
    
  • New calculated column MDB table indeed

    Hello

    I have a requirement to calculate the total cost. I have the quantity as a field and the actual cost as another field. Quantity * cost = total cost. How can I do this in the MDB.

    Thanks for your time and your help.

    Hi user,
    Done create a logical column in this table.
    layer of MDB-> made-> right click - Create a logical column (or table) duplicate a measure column in the table and rename it as Total cost.

    "Then name it as Total cost and mark physical sources using existing and click on the '... »
    Here, we see the logical tables and columns.give the formula using arrays of logiccal in functions that
    Quantity * cost

Maybe you are looking for

  • T520 24 '': T520 switching 24 roll on platter

    Is there a way to switch back and forth between rool feed and sheet tray application without having to manually feed or roll "no feed"?

  • 3D display of HP 2311gt

    Setting up new HP 2311gt display.  All the normal functions work fine. However, the RPF 3D does not seem to be well aligned. the intertwining of left/right seems to reverse the eyes all 10 lines or more. This only seems to happen with the outline of

  • Can't get the widget on home screen

    How can I get this "ad" off my home screen widget? It's on my wallpaper. Don't know how to get rid of it. Help! Thank you!!

  • What VB6 API to use for Resultlist

    Hello, I am trying to extract portions of the resultlist of teststand 3.5 in VB6.  In particular, I try to get the err.code and the err.msg of the last step in which the error has been reported in teststand.   I don't know what object API to use.    

  • Windows Vista is not updates.

    My Windows Vista is not updates. I get a message that says that one or more components of Windows Update are configured incorrectly. How can I configure my Windows updater?