Access to the data in dynamic queries in a stored Proc

Hello
I have a stored proc that gets select statements in a database table. These instructions must be carried out and the results to the format in HTML and sent by e-mail to a set of email addresses. The bits of HTML and e-mail are not a problem. I can also run the instructions using a sys_refcursor, but how do I do the following:
(1) determine the column names and the number of columns returned by select statements?
2) access to the data for each column of each row?
Since I know not the number and data types of the columns I can't use the standard INTO.
We use 10g.
Thank you
Johan

Dbms_sql package to create the cursor. Here you can describe the sql statement columns dynamically.

Visit this link for examples...
http://www.MCS.csueastbay.edu/support/Oracle/doc/10.2/AppDev.102/b14258/d_sql.htm#i1026120

Ravi Kumar

Published by: ravikumar.sv on August 12, 2009 17:34

Tags: Database

Similar Questions

  • No access to the data of a partition of a disk

    Windows Vista automatically starts the repair of my D: drive. Many errors have been reported and fixed.

    I now see the D: drive in the Windows Explorer, but no access to the data on D: is possible. The bar that shows the used/free space is not shown. A second partition on the hard drive works fine.

    In disk management I find D: drive with all the information on the used/free space, no error is reported.

    No idea how to fix?

    Any help is cordial welcome.

    Your machine to HD will have a free test bootable utility, for example WD SeaTools

  • The results of F1-QUERY-how to restrict or to SQL with the role of access to the data?

    Hello

    With the help of CC & B 2.3.1.

    I'm configuration of a Zone of F1-OF-QUERY to get and display customer information as level account; the filter criteria will be Geo val SP.

    With our application, we use access to accounts and groups access to the data on users roles to restrict access to sensitive accounts, such as VIP.

    What keywords should I use in the SQL statement to limit the results only for group accounts to which access is included in the Dar of the user?

    Example: If the user has DAR 'STANDARD', it won't see accounts with group access 'VIP '.

    I tried unsucessfully: USER: USER ID,: USER_ID.

    Unsucessfull example:

    Select dar_cd, user_id, expire_dt
    of ci_dar_usr
    Where user_id =: USER_ID
    and expire_dt > =: F1

    Thks,

    Fabien

    Hi, Fabien,

    If you are looking to determine the current user in the box,
    the keyword to use is: USERID

    You can check the zone of F1 "F1-FAVSCR" for its use.

  • Hyperion reports financial-EN has no access to the data in the report

    Is there a way to Hyperion reports to display #no access to data users do not have access to, similar to essbase excel. What report currently displays 0, tried to adjust remove option to 000, and #no access, still shows 0

    Published by: user646265 on 15 Sep, 2010 10:11

    EN is built to be dynamic, so that he not hide any access if set up correctly, however if items are hard coded which are no access, then the report will fail for that user.

    The only options via the deletion/text of grid options are: zero values, no data or errors.

  • Satellite M70: access to the data of temperature and fan

    While we did not have these problems with other laptops, we found a way to access the data of temperature and fan on a Satellite M70.

    A friend has tried this on Linux but have failed and also with XP I do not find a way to read data (current temperature of the CPU, or State of the fan-cooler).

    Given that I noticed several irregularities when using (the fan is that the CPU load is very minimal), work sometimes is going to be a little uncomfortable.

    Thanks for the advice / gw

    I put t know if it will help you, but in this ad, someone managed to run a control application of the material.
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=14284

    Maybe it will work on your laptop.
    But to my knowledge Toshiba doesn't support this request and I'm not sure it will work.
    Anyway, try it's free ;)

  • How to adjust the data in dynamic data?

    Hello

    I have problems when I want to convert the data that I have gained by using VISA to dynamic data. The data group consist of a row/column with relative timestamps (time measurement) and up to 30 channels of data. How can I do this?

    Thank you for the help

    Hello Thiago Bach,

    If you look at your code, the best way to proceed is to create a data type of waveform of your data. You can do this by using the generation 'Waveform.vi '. Here you will find the help file says of this feature. The format of data T0 is the regular Timestamp data format (for example generated by the 'get DateTime in Seconds.vi'.

    The type of waveform data can be entered directly on the waveform graphs.

    If you have questions and / or remarks, let me know.

    Best regards

    Peter S

  • Access to the table of dynamic addresses via SNMP

    Hello

    I am trying to access the table of dynamic addresses via SNMP, with a PowerConnect 6248 switch. I tried to follow the instructions [1], as other parts of the BRIDGE-MIB are ok on this switch.

    When snmpwalk'ing BRIDGE - MIB:dot1dTpFdbEntry, I have nothing, while, on the switch web interface there are entries in the table.

    Any idea?

    [1] http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801c9199.shtml


  • No access to the data in a database linked when calling procedures in the APEX 5

    Hello

    I use

    • APEX 5.0.3
    • APEX DB: Oracle DB 12 c
    • DB related: Oracle DB 11 g

    When you call procedures and packages of APEX-side on the related DB, I can't access the data with a "select...". "in the tables on the DB related.

    Is it because of the different versions of DB?

    Is there a general setting in my APEX 5.0.3 I need to access the data in the tables on the DB related?

    Any help appreciated.

    Thanks in advance.

    Concerning

    Norbert

    Hello

    Thanks for the reply.

    But at least we do the upgrade again.

    ... when editing a dblink and recompile the schema it all works.

    Concerning

    Norbert

  • How my new users access to the data in the database?

    Hello

    I created a database with new users who will need to access the database, but as soon as I connect to one of the new users can't access tables or any of the data that I had inserted previously.

    Any help would be greatly apprciated!

    Thank you

    Rory

    (Running Oracle 11 g)

    As connect you to the database by default, you can only access your objects or object that you access directly by prefixing its owner. In your case, not only you must give the user but also needs prefix synonym/owner access rights to access these objects. for example

    user that has (you) have following things:

    EMP (grant select on emp to UserB ;)

    Dept (grant select on dept to UserB ;)

    User B

    Select * from UserA.emp;

    Select * from UserA.dept;

  • Can't do multiple hosts access to the data of the other local host store

    Hello!

    I'm faced with a problem I have no idea how I can solve it. I have a cluster of ESXi 5.1.0 799733 with 3 guests and a shared iSCSI storage. I do vMotion well, as my VM files are stored in the storage. These 3 hosts are managed my vCenter 5.1.0.5300 build 947940.

    Now, I would have a few virtual machines on the local storage of the host cause some performance issues, and so I would like to make Storage vMotion. In addition, Storage vMotion is allowed to my cluster.

    I know that each host needs to access the storage time origin and target to make Storage vMotion. I also know that 5 VMFS is a cluster file system.  Search this documentation [1], it says that I must use in the web client of vSphere (I prefer to use vSphere client), the data store and click the "mount a store of data to some hosts. But there is no icon!

    I also tried clicking 'Add storage' on vSphere Client GUI, by selecting "VMFS", without success.

    Attached to this post is my cluster infrastructure. The DS_LOCAL_ * are storehouses of data space and DS_SAN_ * are SAN datastore.

    Where mess me things up? Help, tip or documentation pointing will be nice.

    Many thanks for any help

    Lucas

    [1] VMware vSphere 5.1

    You can not access local data warehouses of other armies. However, with vSphere VMware 5.1 introduced a new VMotion feature, which allows you to migrate virtual machines without shared storage "(hôte de changement et magasin de données»)." However, this feature is available on the Web Client.

    André

  • How to modify the data with dynamic TableView with dynamic columns in JAVAFX

    Today, it is the demo to display the data from the CSV to the custom class without doing DAT file on tableView in JavaFX 2.0. I call this TableView as dynamic TableView because the tableview automatically manages the columns and rows.
    My research on the editable on tableView, we have a custom of the class and apply it to tableView to show that this demo is > http://docs.oracle.com/javafx/2/ui_controls/table-view.htm

    But in this case I can't do that because we don't know how many example of column with the csv file or .dat file... I want to make editable on this tableView in this case add TextField in the TableCell. How do custom class (because you don't have how column...) and so to do custom class then what thedesign of a custom for this case class?

    Could you please help me?

    It's the demo of code to display your csv or dat file in TableView

    private void getDataDetailWithDynamic() {
      tblView
    .getItems().clear();
      tblView
    .getColumns().clear();
      tblView
    .setPlaceholder(new Label("Loading..."));
      
    // @Override



      
    try {
           
    File aFile = new File(txtFilePath.getText());
           
    InputStream is = new BufferedInputStream(new FileInputStream(aFile));
           
    Reader reader = new InputStreamReader(is, "UTF-8");

           
    BufferedReader in = new BufferedReader(reader);

           
    final String headerLine = in.readLine();
           
    final String[] headerValues = headerLine.split("\t");
           
    for (int column = 0; column < headerValues.length; column++) {
                 tblView
    .getColumns().add(
                 createColumn
    (column, headerValues[column]));
           
    }

           
    // Data:

           
    String dataLine;
           
    while ((dataLine = in.readLine()) != null) {
                
    final String[] dataValues = dataLine.split("\t");
                
    // Add additional columns if necessary:
                
    for (int columnIndex = tblView.getColumns().size(); columnIndex < dataValues.length; columnIndex++) {
                      tblView
    .getColumns().add(createColumn(columnIndex, ""));
                
    }
                
    // Add data to table:
                
    ObservableList<StringProperty> data = FXCollections.observableArrayList();
                
    for (String value : dataValues) {
                     data
    .add(new SimpleStringProperty(value));
                
    }
                 tblView
    .getItems().add(data);
           
    }
      
    } catch (Exception ex) {
           
    System.out.println("ex: " + ex.toString());
      
    }


      
    for(int i=0; i<tblView.getColumns().size(); i++) {
           
    TableColumn col = (TableColumn)tblView.getColumns().get(i);
           col
    .setPrefWidth(70);
      
    }
    }

    private TableColumn createColumn(
      
    final int columnIndex, String columnTitle) {
           
    TableColumn column = new TableColumn(DefaultVars.BLANK_CHARACTER);
           
    String title;
           
    if (columnTitle == null || columnTitle.trim().length() == 0) {
                title
    = "Column " + (columnIndex + 1);
           
    } else {
                title
    = columnTitle;
           
    }


           
    Callback<TableColumn, TableCell> cellFactory = new Callback<TableColumn, TableCell>() {
           
    @Override
           
    public TableCell call(TableColumn p) {

                
    System.out.println("event cell");
                
    EditingCellData cellExtend = new EditingCellData();
                
    return cellExtend;
           
    }
      
    };

      column
    .setText(title);
      column
    .setCellValueFactory(cellFactory);
      
    return column;
    }


    Thanks for your reading.

    See this thread: Re: dynamically create columns

    This example is not editable, but to do so, simply add something like

        column.setCellFactory(TextFieldTableCell.>forTableColumn());
    

    the createTableColumn (...) method.

    Either said by the way, where did you code that you pasted in your post? It looks like in my previous post.

    Post edited by: James_D

  • Access to the data after the managed service VOImpl in bean method call

    I use JDeveloper 11.1.2.4.

    I created a method to Interface customer and he calls you a managed bean.

    The method is exposed in the control of data and I have a links to it through links on the page.

    The method runs just a view of criteria for a row of data in the database.

    But, because the method does not have a return value, how could access the View object data.

    Here's the Service method and the method of the bean management;

    The service method: in PersonVOImpl.java - should result in 1 row:

    public void getPersonByCnViewCriteria (String cn)

    {

    ViewCriteria viewCriteria = this.getViewCriteria ("PersonVOCriteriaByCn");

    Reset a display criteria of values that may was resolved at design time

    viewCriteria.resetCriteria ();

    this.setCnBind (cn);

    this.applyViewCriteria (viewCriteria);

    this.executeQuery ();

    }

    Method in managed Bean: I have a linking operation method to access the Service method.


    It seems that the Service method is executed successfully.  But, how to access the data after the call?


    protected void getPersonByCn (String cn)

    {

    BindingContainer bindingContainer = this.getBindings ();

    OperationBinding operationBinding = bindingContainer.getOperationBinding("getPersonByCn");

    Map operationsParamsMap = operationBinding.getParamsMap ();

    operationsParamsMap.put (WorkFlowBean.PROPERTY_CN, NC);

    Object result = operationBinding.execute ();

    If (! operationBinding.getErrors () .isEmpty ())

    {

    }


        // How to access data after the call?

    }

    You should never use a class VOImpl or VORowImpl in a managed bean. If you have to use them, create Interfaces and use.

    I'm not too sure if it's good to return a view in a method object.

  • Accessibility of the data store

    I need determine if a given data store is accessed from ESX

    hosts.  I noticed that the MO data store has a property named

    accessible.  However, in my tests, even when I take the data store down

    (it was a test NFS data store and I just close the NFS host), the

    accessible property always return true.

    Does anyone know how to determine when / if a given data store is no longer accessible by an ESX host?

    Thank you very much in advance for your help.

    -Moby

    Did you call UpdsateViewData after you turned off the NFS server?

    $ds = Get-Datastore  | Get-View
    ....
    # NFS server powered off
    $ds.UpdateViewData()
    ....
    

    Note that in PowerCLI 4.1, you have access to the MO via the ExtensionData property.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Assign access to the data form

    Hello

    If a user is allowed to access a particular data form, is required to update the database by selecting the filter option of security in data base management?

    In fact, I gave a write access to a user to a data form, but it can not display it and get a msg of error about security filters.

    Thank you.

    Good enough (even though technically you don't need updating if only access to the planning of the forms, but it is always advisable to update the filters as might be to access data using other methods for example excellent addin)

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Access to the data of dehydration store

    Hi all

    Can access us the tables of data store of dehydration in basic SOA installation?
    If yes how we can access?

    Concerning
    PavanKumar.M

    I don't have the installer ready with me... but, remember vaguely... Go into your bpel/bin - > polsql.cmd... double click on that
    This will take you to the orabpel schema, and you can query its tables.
    The same applies to the tables of query oraesb \integration\esb\olite\bin.

Maybe you are looking for