PL/SQL Table use in report region query

Hello,
I have a package function which return pl/sql table. I want to create a report region based on this pl/sql table. Is it possible to do this kind of report in HTMLDB?
Please guide me in this area.
Thanks
HA

The htmldb_collections API (apec_collections in 2.2) is a very useful method for rendering reports and one I have used extensivly in the past.
Once created and populated you can reference your collection as if it were a SQL table i.e.
Select c001, c002, c003
from htmldb_collections
where collection_name = 'MY_COLLECTION';
You can absolutly base an Apex Report region on collections. Just treat them as another table that you can select from, join to others etc.
In order to utilise this you must do the following:
1) Create your collection:
note that collections only persist for the duration of your session and you can only see the data you inserted into the collection. Also I would create this collection as the Database user who owns the Apex Workspace
htmldb_collection.create_or_truncate_collection ('MY_COLLECTION');
2) Populate your collection:
In your case I would set a loop construct that parses through your pl/sql table and assign all values as described below. I assumed that my_plsql_tab has 3 columns called Val1, Val2, Val3
FOR x IN 1..my_plsql_tab.count
LOOP
htmldb_collection.add_member (p_collection_name => 'MY_COLLECTION',
p_c001 => my_plsql_tab(x).val1,
p_c002 => my_plsql_tab(x).val2,
p_c003 => my_plsql_tab(x).val3
END LOOP;
Note that you can have upto 60 elements in your collection.
3) Access your collection:
Select c001, c002, c003
from htmldb_collections
where collection_name = 'MY_COLLECTION';
This quesry can then form the source of your sql report region.
Hope all that helps
Duncan

Similar Messages

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Calculate the sum of values in excel file and import it to SQL table using SSIS

    Hi,
    Can some one help me how to do auto sum of columns in SQL table  using SSIS
    in SQL table the HRA , PF and Basic should not come, Only it should appear in basic pay as the sum of HRA , PF and Basic...

    RSingh, Thanks for the use
    of derived column.
    Instead of using record set i used  OLE DB destination
    its working Fine...
    but now the issue is if i put a new records in excel file its replicating in SQL table 
    How to get only the changed values in excel to SQL table.

  • How to get the SQL Statement of a report region?

    For example: The SQL of report region such as "SELECT A,B,C FROM T1 WHERE A = :P10_A".
    I hope to get the converted statement (the variable has been replaced), like this:
    :P10_A = 'TOM', SQL: "SELECT A,B,C FROM T1 WHERE A = 'TOM'".
    THX.

    I agree with John with the usual caveat about using bind variables.
    In other words, you should use
    SELECT A,B,C FROM T1 WHERE A = :P10_Ainstead of SELECT A,B,C FROM T1 WHERE A = 'foo'so that the shared pool doesn't get clutterred with copies of the same (sharable) SQL.
    Even if you use the "PL/SQL function returning a SQL query", be sure to use bind variables in your SQL and not "glue in" session state by concatenating it into the query.
    Thanks.

  • Can we have one submit button for mutliple report regions querying same tbl

    Hello,
    I have a normal multiple report regions in a page with some editable in those regions, these report regions are querying the same table. Now, Is it possible to have one submit button for all the report regions to update the underlying table data?
    Can anyone please help me out with this one.
    thanks,
    Orton

    First you'll almost certainly need to roll your own - the built-in stuff is fairly basic and more than likely won't help.
    It sounds like your process flow should be something like:
    1) Person clicks button.
    2) You do a select for update in the process to get the loan id and put it in the person's queue. At this point you may want to flag that column as having been assigned so it can't be assigned again.
    3) You then forward them to the form to enter data. Personally I would create my own items and processses and forgo the built-in form stuff but you may be able to use the Automated Row Fetch. If you do your own, you just reference the objects like:
    insert into table
    values(:P1_1, :P1_2, :P1_3)Edit - Another way would be to use a regular form and insert Stop/Start Tables - so it can look like a different section, but it really is just a label. Thats another option.

  • Tables used in a SAP Query

    Hi,
    Can anyone tell me in which table the tables used in a query will store?
    In general we create a Query by joining tables and I want to know in which table we can find all the tables used in that query?
    Help me in this regard...
    Thanks
    Srini.

    Hi Murali,
    let me clear my requirement....
    Suppose I created a query with name 'TEST' and I used the tables 'EKPO and EKKO'  in that query...
    Now I want to create report in which the query name is the input field ..and if I input the query name as 'TEST'...the output should show the table names as 'EKPO and EKKO'...
    Thanks
    Srini

  • Regarding hierarchy creation from sql tables using db / ud connect

    bw version 3.0 upgrading to 7.0
    sql version 2005.
    we had built a sql data mart which is being accesses by a number of reporting tools. BI is one of the systems connected to it. My requirement is to upload hierarchies like customer from the sql data mart in to BW.
    The sql tables are in a denormalized format like this,
    EMPLOYEE_ID LAST_NAME                 MANAGER_ID      LEVEL
            101 Kochhar                          100                             1
            108 Greenberg                        101                            2
            109 Faviet                           108                                3
    They say that all third party reporting tools will recognize the above format and it universal. <b>I wanted to know is there any setting in bw that will allow extraction of hierarchies from the above table format ? if not I can only think of arranging data in the format of BW transfer structure, similar to flat file load.</b>
    I want to know can I upload hierarchies from sql tables or should I create flat files from tables ?
    Inputs will be awarded points.
    Message was edited by:
            aravind sam

    generate datasource? see if this can help..
    RSA1-> SOURCE SYSTEM-> SELECT YOUR SOURCE SYSTEM-> RIGHT CLICK-> GENERATE SOURCE SYSTEM.
    Also check:
    DB connect ORACLE - table name not found
    Re: Bw With ORacle
    Datasource in DB Connect
    and OSS Notes: 518241
    assign points if useful ***
    Thanks,
    Raj

  • Writing to a table using Crystal Reports

    I know there must be a way to write to a table after Crystal Reports collects the data.
    Can someone kindly go over the steps in doing so?  I'm using SQL Server.  Let's assume the data returned is one row.
    Thanks in advance,
    Zack H.

    Hi Zack,
    Use the export option and then chose ODBC. CR will create the table based on the fields in the report.
    Thank you
    Don

  • Table used in report painter

    Hi,
    How to check what table is really used in a certain report painter.
    For my case, I want to a report 1KSL-001 under 1VK library, and I can see this 1VK library is using table "CCSS", but CCSS acctually is not a table, its just a structure.
    So, how to use what tables are used while running report 1KSL-001?
    Thanks.
    Cheers,
    Bernard Gunawan

    Yes, but how do you know and where to check that this report is a collection of fields of those tables?
    Could you please tell me what transaction code to check, and guide to what table behind a report painter?
    Bernard

  • How can I read a file with ASCII Special Character into a SQL table using SSIS 2008?

    I've tried everything to read this file and am getting no where.   Help how can I read this file and load a SQL table?
    RS - AscII - 30  (Record Separator)
    GS - AscII - 29 (Group Separator)
    Thank you for your assistance - Covi
    Mark Covian

    We can use script component as source/transformation to read the text file and assign the contains to a string. Split the string by chr(30)  i.e RS and finally stored into an array or write to the output buffer of the script component.
    For example on how to use script component refer this link
    http://social.technet.microsoft.com/Forums/en-US/6ff2007d-d246-4107-b77c-624781baab38/how-to-use-substring-in-derived-column-in-ssis?forum=sqlintegrationservices
    Regards, RSingh

  • Error while connecting to external SQL table using BCS identity in SharePoint 2010

    Hi all,
    I am working on SharePoint Foundation 2010. I have a stand alone setup. Now I am trying to connect to a SQL table in another server. I have used SharePoint Designer to connect using BCS. I have selected "BCS Identity" for authenticating with SQL
    in the external content type. then I created a list with this external content type.
    I get the following error upon opening the external list.
    Login failed for user 'INYKGW\sp_farm'.
    I am confused. how do I solve this error.
    any help is greatly appreciated.
    Thanks.

    Hi letShare ,
    Whether the  account 'INYKGW\sp_farm' is current user account or a service managed account?
    Could you  please  provide detail error message of ULS log  to determine the exact cause of the error.
    For SharePoint 2010, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
    Also please have a look at  the blog :
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=82
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to add hash table values to SQL Table using Powershell

    Hi,
    I have sharepoint list with four(column1, column2, column3,column4)columns.I am reading the list column values and adding to hashtable. Now I want to add values from hastable to SQL table with four(column1, column2, colum3,column4)columns using powershell.
    I have written the following script for single column but I would like to know how to add values for multiple columns.
                if(($key -eq "Column1") )
                   $SqlQuery = "INSERT INTO [TableName] ([Column1]) VALUES ('" + $HashTable.Item($key) +"')"
                   #Set new object to connect to sql database
                   $connection = new-object system.data.sqlclient.sqlconnection
                   $Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
              $connection #List connection information 
                   $connection.open() #Open Connection
                 $Cmd = New-Object System.Data.SqlClient.SqlCommand
                 $Cmd.CommandText = $SqlQuery
                   $Cmd.Connection = $connection
                  $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
                  $SqlAdapter.SelectCommand = $SqlCmd
                  $DataSet = New-Object System.Data.DataSet
                  $SqlAdapter.Fill($DataSet)
                  $DataSet.Tables[0]
                  $connection.Close()
    Can anybody please help me out to accomplish the task? Any help would be greatly appreciated.
    AA.

    Hi AOk2013,
    Not knowledgable on PowercShell, based on my understanding on HashTable in Java, Some modification you can make in your code to achieve your requirement.
    If the Keys in HashTable are "Column1","Column2","Column3","Column4", you can reference below.
    if(($key -eq "Column1") ) #what is the purposed of this if ?
    #$SqlQuery = "INSERT INTO [TableName] ([Term]) VALUES ('" + $HashTable.Item($key) +"')"
    #specify the real column names in the table
    $SqlQuery = "INSERT INTO [TableName] ([ColumnA],[ColumnB],[ColumnC],[ColumnD]) VALUES ('" + $HashTable.Item("Column1") +"','"+ $HashTable.Item("Column2") +"','"+$HashTable.Item("Column3") +"','"+$HashTable.Item("Column4") +"')"
    #Set new object to connect to sql database
    $connection = new-object system.data.sqlclient.sqlconnection
    $Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
    $connection #List connection information
    $connection.open() #Open Connection
    $Cmd = New-Object System.Data.SqlClient.SqlCommand
    $Cmd.CommandText = $SqlQuery
    $Cmd.Connection = $connection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $DataSet.Tables[0]
    $connection.Close()
    Since your question is regarding PowerShell, I would suggest you post it in a dedicated
    PowerShell Forum. It is more appropriate and more experts will assist you.
    If you have any feedback on our support, you can click
    here.
    Eric Zhang
    TechNet Community Support

  • Select list with submit issue when they are referred in report region query

    I have a page with a reporting region. Same region also has 3 different list items and depending on the value selected in each item, the report is refreshed. All the 3 list items are "Select list submit with submit"
    Out of 3 items, 2 (say item2 and item3) are populated through dynamic LOV using the value in item1.
    Additionally, when I select a default "ALL" value in in item1, I ignore values in item2 and item3.
    With this background, I am a following issue:
    1. I select a value other than Default value in item1 which filters the report.
    2. Then I select some value in item2 which further shrinks the reports.
    3. Now if I go back to item1 and select the default "All" value, the report is not refreshed with the new values of item1, item2 and item3. But it still shows the report based on value of item2 that I selected in step2.
    How do I set the value of item2/item3 to null if value of item1 is default which is "All"
    Any word of advise will be a great help!
    Thanks,
    Girish

    Hi,
    Make two computations each with the computation text NULL; or
    Make one process with code like:
    BEGIN
    :P1_ITEM2 := NULL;
    :P1_ITEM3 := NULL;
    END;With the condition "Value of Item in Expression 1 = Expression 2"
    Expression 1: P1_ITEM1
    Expression 2: ALL
    (or whatever the return value of ALL is...remember that this is case sensitive)
    Mike

  • Submitt request to SQL table using C# WPF Application

    I would like to submit request from WPF application to SQL table. My source is SharePoint list.
    I am using Visual Studio 2008 for getting the Data from SharePoint List.
    At the bottom I have Submit button which I want to use for inserting data into SQL table.
    Below code is working fine for getting the data from SharePoint list. cmdGetRequests Button is working fine
    I am new in programming any help be appreciated.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using RequestsApp.WingtipSite;
    using System.Data.SqlClient;
    namespace RequestsApp
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class
    Window1 : Window
    public Window1()
                InitializeComponent();
    private void cmdGetRequests_Click(object sender,
    RoutedEventArgs e)
    InformationGatewayDataContext dc =
    new InformationGatewayDataContext(
    new Uri("https://organization.xx./_vti_bin/ListData.svc"));
                dc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    var source = dc.Requests;
                listBox1.Items.Clear();
    foreach (var dev
    in source)
    string devName = dev.ID +
    " " + dev.FT + " " + dev.TX +
    " " + dev.EG +
    " " + dev.CompanyName + " " + dev.EmailAddr +
    " " + dev.Flag +
    " " + dev.StatusDate + " " + dev.Date +
    " " + dev.Priority +
    " " + dev.Source;
                    listBox1.Items.Add(devName);
    private void cmdSendRequests_Click(object sender,
    RoutedEventArgs e)
    simam

    Thank you for the giving me right direction. I am able to get the list from SharePoint list into WPF application and submit data to SQL table.
    Now I need to have Delete button which will delete the SharePoint list data. and then exit the application.
    my Delete button is not working , I am using below code for deleting the list data
    private void cmdDeleteRequests_Click(object sender,
    RoutedEventArgs e)
    InformationGatewayDataContext dc =
    new InformationGatewayDataContext(
    new Uri("https://organization.xx./_vti_bin/ListData.svc"));
                dc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    var source = dc.Requests;
                listBox1.Items.Clear();
    foreach (var dev
    in source)
    string devName = dev.ID +
    " " + dev.FT + " " + dev.TX +
    " " + dev.EG + " " + dev.CompanyName +
    " " + dev.EmailAddr + " " + dev.Flag +
    " " + dev.StatusDate + " " + dev.Date +
    " " + dev.Priority +
    " " + dev.Source;
                    listBox1.Items.Add(devName);
    simam

  • Creating reports for user tables using XL reporter

    Hi all
    i wish to create  a report based on user tables using the XL reporter.
    question is: is it possible? and if so how can it be done?
    appreciate the help
    Yoav

    Hi Yoav,
    XL Reporter cannot pull data from UDTs. However, you can use an Excel template when creating your XL Reporter report and then embed VBA code in the template to pull the UDT data in to the report after the XL Reporter has finished generating the report. It all depends on how you need to combine the UDT data with other SBO data. If you are interested in a report based entirely on UDT data then it would be simpler just to write the report using VBA in Excel (or Crystal).
    Kind Regards,
    Owen

Maybe you are looking for

  • Album artwork shows up in itunes but not on the ipod...

    i just realized when i put some new songs on my ipod that not the album artwork werent showing up, so i followed some directions i found in some other discussion threads, like unchecking the display artwork button and checking it again. But instead o

  • Enable access for assistive devices in Mavericks-how?

    How is "access for assistive devices" enabled in OS 10.9.3?  I've looked for it just about everywhere in System Preferences.  A third-party utility that I use needs it to work fully-and says at startup that it is not switched on.

  • Cannot cancel POs

    Hi All, We get the error message *"Please undo the changes to the current document in the current revision before taking the cancel action"* whne we try the cancel a purchase order. We are on R 12.1.3 In 11i we were able to cancel POs without this er

  • Script to find the " List of objects to be pinned in the shared pool"

    hi all, please suggest me any script is there to find the recommended objects to be pinned in to shared pool. Regards, Vamsi.

  • Problem in connecting to efashion in web rich client

    Hi Gurus, I have a problem when connecing to efashion universe in web rich client. following is the error message ava.lang.NullPointerException: No business layer sent back from server at com.sap.sl.sdk.parser.xml.datasource.DataSourceParser.parse(Da