Inserting the Brio Query Data into EIS OLAP Model  tables directly

Dear Experts,
Can someone please suggest how we can export data (result set records) from bqy files' queries into an EIS server's OLAP Model's tables?
Right now I have a cube on Essbase server getting the data from excel sheets which store the data from the execution of .bqy files.
Use of file system (excel sheets) has not been liked by my business users so now I need to avoid storing the data from brio queries into excel sheets for loading into the Essbase cube. This I am required to achieve using EIS/AIS so that the data from brio queries(.bqy files) can be directly inserted into Essbase cube with the help of (i.e. via) EIS/AIS.
Any quick help would boost the life of this project of mine.
Thank you,
Vikas Jain

user12072290 wrote:
Dear Experts,
Can someone please suggest how we can export data (result set records) from bqy files' queries into an EIS server's OLAP Model's tables?
Right now I have a cube on Essbase server getting the data from excel sheets which store the data from the execution of .bqy files.
Use of <A class=bodylinkwhite href="http://www.software-to-convert.com/h264-conversion-software/h264-to-quicktime-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>file</FONT></A> system (excel sheets) has not been liked by my business users so now I need to avoid storing the data from brio queries into excel sheets for loading into the Essbase cube. This I am required to achieve using EIS/AIS so that the data from brio queries(.bqy files) can be directly inserted into Essbase cube with the help of (i.e. via) EIS/AIS.
Any quick help would boost the life of this project of mine.
Thank you,
Vikas JainHave you got the answer? Would you pls post it here? 

Similar Messages

  • Insert the MDX Query Data into SSMS Table

    Hi, I'm using below query frequently on SSAS .
    select * from $system.discover_commands
    I want that when this query executed & If any output returns , then that output should be inserted into SSMS
    Table(OLTP DB) .

    Hello,
    You can use a linked server to SSAS to run queries from SQL Server against SSAS cubes and to insert the result into a relational table.
    See e.g.:
    Passing Queries from SQL Server to a Linked Analysis Server
    Querying SSAS with SQL
    Creating a Linked Server for Analysis Services
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • Custom PL/SQL API that inserts the data into a custom interface table.

    We are developing a custom Web ADI integrator for importing suppliers into Oracle.
    The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
    Defined the 'Document Row' import rule and added the rows that would identify the unique record.
    Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
    The source of this parameter is import.vendor_name
    We have also defined an Error lookup.
    After the above setup is completed, we invoke the create document and click on Oracle->Upload.
    The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'

    The same issue.
    Need help.
    Also checked bne.log, no additional information.
    <bne:document xmlns:bne="http://www.oracle.com/bne">
    <bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
    <bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
    <bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
    bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
    bne:action="" bne:source="BneAPIImporter" >
    <bne:context bne:collection="collection_1" />
    </bne:message><bne:message bne:type="STATUS"
    bne:text="No rows uploaded" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message>
    <bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message></bne:document>

  • I want to insert more than 4k data into the MySql

    hi there..
    i willing to support mysql.
    but there is one thing unsolved..
    i wanna insert more than 4k data into the mysql ..
    but i can't..
    does anyone know about this problem..
    i really appreciate for your advice in advance...
    thanz for reading...

    <PRE>
    hi there..
    first of all.. thanz 4 ur replies..
    i m using mysql 3.x
    and using mysql-connector-java-3.1.0-alpha
    source code is one of the sample apps..
    if u download jconnector3.1.0-alpha. u can see TestBlog.java file on 'testsuite/simple/'
    i changed db url, user, passwd atc..
    then, i execute TestBlob..
    can c following error message
    G:\MySql\mysql-connector-java-3.1.0-alpha\mysql-connector-java-3.1.0-alpha>java
    testsuite.simple.BlobTest
    Loading JDBC driver 'com.mysql.jdbc.Driver'
    Done.
    Establishing connection to database 'jdbc:mysql://xxx.xxx.xxx.xxx/devel'
    is else
    userid:'userid'
    passwd:'password'
    Done.
    error...
    java.sql.SQLException: Communication link failure: com.mysql.jdbc.PacketTooBigEx
    ception
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1079)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:1876)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
    va:1590)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1304)
    at testsuite.simple.BlobTest.testByteStreamInsert(BlobTest.java:114)
    at testsuite.simple.BlobTest.setUp(BlobTest.java:82)
    at junit.framework.TestCase.runBare(TestCase.java:125)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestCase.run(TestCase.java:111)
    at testsuite.simple.BlobTest.main(BlobTest.java:68)
    Loading JDBC driver 'com.mysql.jdbc.Driver'
    Done.
    Establishing connection to database 'jdbc:mysql://xxx.xxx.xxx.xxx/devel'
    is else
    userid:'userid'
    passwd:'password'
    Done.
    error...
    java.sql.SQLException: Communication link failure: com.mysql.jdbc.PacketTooBigEx
    ception
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1079)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:1876)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
    va:1590)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1304)
    at testsuite.simple.BlobTest.testByteStreamInsert(BlobTest.java:114)
    at testsuite.simple.BlobTest.setUp(BlobTest.java:82)
    at junit.framework.TestCase.runBare(TestCase.java:125)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestCase.run(TestCase.java:111)
    at testsuite.simple.BlobTest.main(BlobTest.java:69)
    at 68, 69 line of BlogTest.java
    public static void main(String[] args) {
    new BlobTest("testBytesInsert").run(); <--- 68 line
    new BlobTest("testByteStreamInsert").run(); <--- 69 line
    i need ur help..
    appreciate for your advices in advance..
    thanz
    </PRE>

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • [solved] inserting the same rows again into that table

    i have a table with some rows now i want to insert the same rows again into that table
    please tell me how to do it?
    not using export please only sql query please
    Message was edited by:
    littlemaster

    i m expecting that u commented on me (may be i m wrong). Only once, which we had already dealt with further up. My comment was continuing along another 'off topic' re: code graffitti. Sorry I you felt I was continuing to get at you.
    (If you look at the 'In Response to' part of ant post you can see which post any p[ost is intended to reply to)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • XEM - Unable to load the initial data or the variances(delta) data into sys

    I am installing xEM 2.0 SP 10 (SAP xApp Emissions Management) in a windows environment with SQL 5000.  I installed xEM on NW 2004, usage types AS Java and EP 6.
    I am attempting to load the initial data or the variances (delta) data into the system.  Instruction is on page 15 in the install guide.
    I am supposed to enter the following in the command line:
    java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=[JDBC Driver];[JDBCUrl];[User];[Password]
    Example command for import into SQL Server:
    java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddtek.jdbc.sqlserver.SQLServerDriver; jdbc:datadirect:sqlserver://vma03:1433;SAPC11DB;password
    The customer I am with is running the xEM database on a different instance.  This is where I run into a problem.  I am not sure how to specify the instance in the script.  This is what  I have attempted so far:
    C:\>cd temp\load
    C:\Temp\load>java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddte
    k.jdbc.sqlserver.SQLServerDriver;jdbc:datadirect:sqlserver://PRODSQL43:SQL3:1534;SAPPEMDB;password
    java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:datadirect:sqlserver:/
    /PRODSQL43:SQL3:1534 as user SAPPEMDB (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Unable to connect.  Inva
    lid URL.): [DataDirect][SQLServer JDBC Driver]Unable to connect.  Invalid URL.
            at com.sap.sdm.util.dbaccess.DBTask.dbImport(DBTask.java:356)
            at com.sap.sdm.util.dbaccess.SapTransTask.perform_import(SapTransTask.java:293)
            at com.sap.sdm.util.dbaccess.SapTransTask.execute(SapTransTask.java:51)
            at com.sap.sdm.util.dbaccess.SapTrans.main(SapTrans.java:21)
    import aborted with java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:da
    tadirect:sqlserver://PRODSQL43:SQL3:1534 as user SAPPEMDB (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Unab
    le to connect.  Invalid URL.): [DataDirect][SQLServer JDBC Driver]Unable to connect.  Invalid URL.
    C:\Temp\load>java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddte
    k.jdbc.sqlserver.SQLServerDriver;jdbc:datadirect:sqlserver://PRODSQL43;SQL3:1534;SAPPEMDB;password
    java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:datadirect:sqlserver:/
    /PRODSQL43 as user SQL3:1534 (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Error establishing socket. Connec
    tion refused: connect): [DataDirect][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
            at com.sap.sdm.util.dbaccess.DBTask.dbImport(DBTask.java:356)
            at com.sap.sdm.util.dbaccess.SapTransTask.perform_import(SapTransTask.java:293)
            at com.sap.sdm.util.dbaccess.SapTransTask.execute(SapTransTask.java:51)
            at com.sap.sdm.util.dbaccess.SapTrans.main(SapTrans.java:21)
    import aborted with java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:da
    tadirect:sqlserver://PRODSQL43 as user SQL3:1534 (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Error establi
    shing socket. Connection refused: connect): [DataDirect][SQLServer JDBC Driver]Error establishing socket. Connection ref
    used: connect
    C:\Temp\load>java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddte
    k.jdbc.sqlserver.SQLServerDriver;jdbc:datadirect:sqlserver://PRODSQL43:1534;SQL3;SAPPEMDB;password
    java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:datadirect:sqlserver:/
    /PRODSQL43:1534 as user SQL3 (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver][SQLServer]Login failed for user
    'SQL3'.): [DataDirect][SQLServer JDBC Driver][SQLServer]Login failed for user 'SQL3'.
            at com.sap.sdm.util.dbaccess.DBTask.dbImport(DBTask.java:356)
            at com.sap.sdm.util.dbaccess.SapTransTask.perform_import(SapTransTask.java:293)
            at com.sap.sdm.util.dbaccess.SapTransTask.execute(SapTransTask.java:51)
            at com.sap.sdm.util.dbaccess.SapTrans.main(SapTrans.java:21)
    import aborted with java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:da
    tadirect:sqlserver://PRODSQL43:1534 as user SQL3 (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver][SQLServer]Lo
    gin failed for user 'SQL3'.): [DataDirect][SQLServer JDBC Driver][SQLServer]Login failed for user 'SQL3'.
    C:\Temp\load>java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddte
    k.jdbc.sqlserver.SQLServerDriver;jdbc:datadirect:sqlserver://PRODSQL43:1534:SQL3;SAPPEMDB;password
    java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:datadirect:sqlserver:/
    /PRODSQL43:1534:SQL3 as user SAPPEMDB (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Unable to connect.  Inva
    lid URL.): [DataDirect][SQLServer JDBC Driver]Unable to connect.  Invalid URL.
            at com.sap.sdm.util.dbaccess.DBTask.dbImport(DBTask.java:356)
            at com.sap.sdm.util.dbaccess.SapTransTask.perform_import(SapTransTask.java:293)
            at com.sap.sdm.util.dbaccess.SapTransTask.execute(SapTransTask.java:51)
            at com.sap.sdm.util.dbaccess.SapTrans.main(SapTrans.java:21)
    import aborted with java.lang.Exception: ERROR: Cannot connect to the database:ERROR: Connect failed to database jdbc:da
    tadirect:sqlserver://PRODSQL43:1534:SQL3 as user SAPPEMDB (java.sql.SQLException/[DataDirect][SQLServer JDBC Driver]Unab
    le to connect.  Invalid URL.): [DataDirect][SQLServer JDBC Driver]Unable to connect.  Invalid URL.
    C:\Temp\load>
    My last attempt was a command using colons and semicolons with the following results.  The closest (there was a significant delay before the error or failure) appears to have been //PRODSQL43;SQL3:1534; (second attempt).  The error listed from this attempt is   "Error establishing socket. Connection refused: connect".
    I also checked the default database that user SAPPEMDB has in place and it is assign the correct database.
    Please help.
    Message was edited by: Owner
            Mike Smayrabunya

    Hey,
    It looks like one of the following:
    1. The DB is down,
    2. The user SAPPEMDB does not have the right authorization.
    3. The password of the user SAPPEMDB is not password
    4. The syntax is incorrect
    in order to find what is the problem,
    please:
    1. Login in the the DB PRODSQL43:1534 with the user "SAPPEMDB" and the password "password",
    this will eliminate the options 1 - DB down, 2 -SAPPEMDB does not have authorization and 3 - password of the user SAPPEMDB is not password.
    2. If the login failed, than please run sql trace with security elements (in the client there is a tool called "SQL Profiler"
    3. If the login is correct, than you check the syntax of the command:
    "java -Djava.ext.dirs=. -jar SAPtrans.jar import logfile=import.log datafile=init.dat connectstring=com.ddtek.jdbc.sqlserver.SQLServerDriver; jdbc:datadirect:sqlserver://vma03:1433;SAPC11DB;password"
    According to the error message "Error establishing socket. Connection refused"
    it looks like The DB is down or syntax is incorrect.

  • How to insert the image or logo into the table as a field in webdynpro abap

    Hi Friends,
    Please tell me how to insert the image or logo into the table as a field in webdynpro abap.........

    Hi Alagappan ,
          In your view layout you take table UI element and then you bind it with some context nodes.
    The attributes of your nodes comes as a field.
    Now in these fields you can set various properties and image is one of them.
    Go to ->
    1. View Layout -> Right Click on ROOTUIELEMENTCONTAINER -> INSERT ELEMENT -> TABLE
    2. Right click on table -> Create Binding.
       Here you have to bind it with the appropriate context node.
    You will get two properties here
    a- Standard Cell Editor :- ( make it image )
    b- Standard properties :- ( If required set image properties ).
    3. If you want put image from out side then import it as a mime object and set the source of your table field ( used as a image )
    also have a look :-
    [Image Properties|http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm]
    Hope this will solve your problem.
    Reply if any case of any issue.
    Thanks & Regards,
    Monishankar C

  • How to transfer the Legacy Transaction Data into SAP R/3

    Hi Experts,
    I  have  issue with legacy transaction data transfer  to R/3 system. My clients want to see  last 3 years legacy transaction data into SAP R/3 system.  But I am not sure whether it is possible or not.
    Please let  me know any possibilities to transfer the legacy tansaction data into SAP.
    Please help me out from this issue.
    Advanced Thanks,
    Chandra

    Hi Sunitha,
    Here legacy sytem is MRP for Retail Sales.
    And format is excel. Since three years data available in
    existing system.
    Please let me know if any further information required.
    Regards,
    Chandra

  • I tried to activate my iphone. i inserted the my sim card into the iphone and when i connect my iphone to my pc to activate it itunes did not recognize it.  please help me.

    i tried to activate my iphone. i inserted the my sim card into the iphone and when i connect my iphone to my pc to activate it itunes did not recognize it.  please help me.

    are you sure thet the sim card is the sim card from the right service provider ? When and where did you bought it ?

  • EIS - OLAP Model - Dimension Joins

    Hi,
    I know the in EIS OLAP model we need to build a logical STAR schema between dimensions and fact tables with some join condition. Now, can you tell me how the join works while building the dimensions? Do EIS really bother about the joins between dimension and fact tables? My understanding is, EIS will load all the members present in the dimension table irrespctive of join clause.
    Pls shed some light on this!
    Thanks!

    You can join tables together with a "bad" JOIN. Your outlines will still build and probably look fine, however, this is what I tend to think of as a "dirty" EIS model. You will run into issues if you try and load data through EIS but you can probably get the outline to build how you want it. I highly recommend that you try and do things the "right" way as it will pay off in the future, but if you have to get it done some other way.... well, I've seen worse. :)

  • Javascript Question - How to Insert a Dynamic/Current Date into the Footer of a Scanned Document

    Hi!
    I am looking for help in finding a Javascript that would allow the insertion of a dynamic/current date into the footer of a scanned document at the time the document is printed.
    I am currently using Adobe Acrobat Professional 8.0 at my work and there has arisen a need to have a dynamic/current date in the footer on scanned documents when they are printed out on different days by different people.
    I am new to the Forum and I am also very new to Javascript and what this entails.
    Thank you in advance for your help and input!
    Tracy

    this.addWatermarkFromText({
    cText: util.printd("mmmm dd, yyyy", new Date()),
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.bottom,
    nHorizValue: -72, nVertValue: 72
    Will insert the current Monday/Day/Year as a text watermark at the bottom of every page of a document, 1 inch up and 1 inch in from the right corner.

  • Inserting the Comma Separated Strings into Table

    Hi Seniors,
    i had two string and i want to insert the records in the Table COMMENT . In this way.
    would u please give some programe to insert the records.
    The Data and the Table
    ( 901,902,903,904 )
    ( 'hai','nice','good & mail is [email protected] ','excellent and the phone 011-235323' )
    comm_id loc_id company_name comments
    1      10 901      Hai
    2      10 902      nice
    3 10      903      good & mail is [email protected]
    4      10 904      excellent and the phone 011-235323
    Thanks
    Seenu

    Hi, Seenu,
    In Oracle 10 (and up) you can easily split a comma-delimited list using REGEXP_SUBSTR.
    INSTR and SUBSTR can do the same thing in any version, but it's more complicated.
    See the general instructions below:
    /*     How to Split a Delimited String
    This shows how to take a single row with a delimited string, such as
         Animal     amoeba,bat,cedusa,dodo
    and transform it into multiple rows:
         Animal     1     amoeba
         Animal     2     bat
         Animal     3     cedusa
         Animal     4     dodo
    PROMPT     ==========  -1. sep_char parameter  ==========
    VARIABLE     sep_char     VARCHAR2 (10)
    EXECUTE     :sep_char := ',';
    SELECT     :sep_char     AS sep_char
    FROM     dual;
    PROMPT     ==========  0. string_test table  ==========
    DROP TABLE     string_test;
    CREATE TABLE     string_test
    (     grp_name     VARCHAR2 (10)
    ,     list_txt     VARCHAR2 (50)
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Animal',     'amoeba,bat,cedusa,dodo');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Date',     '15-Oct-1582,16-Oct-2008');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Nothing',     NULL);
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Place',     'New York');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Skip',     'Hop,,Jump');
    SELECT     *
    FROM     string_test
    ORDER BY     grp_name;
    PROMPT     ==========  Q1.  Oracle 11 Query  ==========
    WITH     cntr     AS          -- Requires Oracle 9
    (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
         SELECT     LEVEL     AS n     -- Requires Oracle 9
         FROM     dual
         CONNECT BY     LEVEL     <= 1 +     (
                             SELECT     MAX ( REGEXP_COUNT (list_txt, :sep_char) )     -- Requires Oracle 11
                             FROM     string_test
    )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
    SELECT     grp_name
    ,     n
    ,     REGEXP_SUBSTR     ( list_txt     -- Requires Oracle 10
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     AS item_txt
    FROM     string_test
    JOIN     cntr                                   -- Requires Oracle 9
    ON     n     <= 1 + REGEXP_COUNT (list_txt, :sep_char)     -- Requires Oracle 11
    ORDER BY     grp_name
    ,          n;
    /*     Notes:
         REGEXP_SUBSTR (s, '[^,]+', 1, n)
    returns the n-th item in a comma-delimited list s.
    If there are fewer than n items, it returns NULL.
    One or more consecutive characters other than comma make an item, so
    'Hop,,Jump' has two items, the second one being 'Jump'.
    The sub-query cntr produces a list of integers 1, 2, 3, ..., w
    where w is the worst-case (the largest number of items in any list).
    This actually counts separators, not items, (e.g., it counts both
    commas in 'Hop,,Jump', even though), so the w it produces may be
    larger than is really necessary.  No real harm is done.
    PROMPT     ==========  Q2. Possible Problems Fixed  ==========
    WITH     cntr     AS
    (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 1 +     (
                             SELECT     MAX ( REGEXP_COUNT (list_txt, :sep_char) )
                             FROM     string_test
    )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
    SELECT     grp_name
    ,     n
    ,     REGEXP_SUBSTR     ( list_txt
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     AS item_txt
    FROM     string_test
    JOIN     cntr          ON n     <= 1 + NVL     ( REGEXP_COUNT (list_txt, :sep_char)     -- Problem (1)
                                  , 0
    WHERE     REGEXP_SUBSTR     ( list_txt     -- Problem (2)
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     IS NOT NULL
    OR     list_txt     IS NULL          -- Problems (1) and (2) together
    ORDER BY     grp_name
    ,          n;
         (Possible) Problems and Fixes
    (1) If list_txt IS NULL, then REGEXP_COUNT (list_txt, :sep_char)
         returns NULL, the join condition fails, and the output
         contains nothing corresponding to the row from string_test.
         If you want a NULL item to appear in the results, use
         NVL to make sure the expression returns 0 instead of NULL.
    (2) If list_txt contains multiple consecutive sep_chars (or if it
         begins or ends with sep_char, then the original query
         will return NULL items.  To suppress these, add a WHERE
         clause to test that the item_txt to be displayed IS NOT NULL.
    PROMPT     ==========  Q3. Oracle 8.1 Query  ===========
    SELECT     grp_name
    ,     n
    ,     SUBSTR     ( list_txt
              , begin_pos
              , end_pos - begin_pos
              )     AS item_txt
    FROM     (     -- Begin sub-query to compute begin_pos and end_pos
         SELECT     grp_name
         ,     n
         ,     list_txt
         ,     INSTR     ( :sep_char || list_txt
                   , :sep_char
                   , 1
                   , n
                   )     AS begin_pos
         ,     INSTR     ( list_txt || :sep_char
                   , :sep_char
                   , 1
                   , n
                   )     AS end_pos
         FROM     string_test
         ,     (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
              SELECT     ROWNUM     AS n
              FROM     all_objects
              WHERE     ROWNUM     <= 1 +     (
                             SELECT     MAX     ( LENGTH (list_txt)
                                       - LENGTH (REPLACE (list_txt, :sep_char))
                             FROM     string_test
              )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
              cntr
         WHERE     n     <= 1 +     ( LENGTH (list_txt)
                        - LENGTH (REPLACE (list_txt, :sep_char))
         )     -- End sub-query to compute begin_pos and end_pos
    ORDER BY     grp_name
    ,          n;
    /*     Version-Dependent Features and Work-Arounds
    The code above, Q3, runs in Oracle 8.1.
    The following changes were made to Q1:
    (11) REGEXP_COUNT was introduced in Oracle 11.
         In earlier versions, to find the number of sep_chars in list_txt,
         see how much the LENGTH changes when sep_chars are removed.
    (10) REGEXP_SUBSTR was introduced in Oracle 10.
         In earlier versions, use INSTR to find where the sep_chars are,
         and use SUBSTR to get the sub-strings between them.
         (Using this technique, 'Hop,,Jump' still contains three items,
         but now item 2 IS NULL and item 3 is 'Jump'.)
    (9.a) The WITH-clause was introduced in Oracle 9
         In earlier versions, use in-line views.
    (9.b) "CONNECT BY LEVEL < constant" doesn't work in Oracle 8.
         Use ROWNUM from any sufficiently large table or view instead.
    (9.c) ANSII join notation (JOIN table_name ON ...) was introduced in Oracle 9
         In earlier versions, join condition go in a WHERE-clause.
    */

  • Frm-41380 error - cannot set the blocks query data source

    Fairly new forms so bare with me. I am creating a form based on one table. This table has one column that is a nested table.
    table name: szrtime
    table columns: szrtime_code, szrtime_styp_list
    szrtime_styp_list is a table of varchar2(1).
    main block is szvtime_block
    the block that contains the nested table is szvtime_styp_block
    I read that I could use a WHEN_NEW_RECORD_INSTANCE trigger on the main block to display the related nested table. I have tried the folllowing:
    Declare
    select_stmt Varchar2(512) ;
    Begin
    If :szvtime_block.szvtime_code Is not null Then
         select_stmt := '(SELECT column_value FROM TABLE ( SELECT szrtime_styp_list FROM szrtime WHERE szrtime_code = ''' || :SZVTIME_BLOCK.SZVTIME_CODE || '''))';
         Go_Block('SZVTIME_STYP_BLOCK' );
         Clear_Block ;
         message('select_stmt = '||select_stmt);
    Set_Block_Property( 'SZVTIME_STYP_BLOCK', QUERY_DATA_SOURCE_NAME, select_stmt ) ;
    Execute_Query ;
    Go_Block('SZVTIME_BLOCK') ;
    Else
    Go_Block('SZVTIME_STYP_BLOCK' );
    Clear_Block ;
    Go_Block('SZVTIME_BLOCK') ;
    End if ;
    End ;
    The result is the frm-41380 error.
    I have tried change the query data source type on the nested table block to Table or From-clause but did not help. The select statement that is valid and returns the correct result in Toad.
    Any suggestions on what to look for? Thank you.
    Todd

    > But what is giving me pause is that the user will be updating, deleting, and inserting
    into this table and, of course, the nested table column.
    It would give me pause, too. I've never used nested tables, so I poked around in Forms on-line help. In Forms 6i, it specifically states that Forms does not support the Nested Table structure.
    In Forms 10g help, it describes Nested Table structures, but says NOTHING about how a form would handle it. And that implies to me that it is still not supported. So good luck.
    In addition to creating the view, you may need to provide your own nested table updating procedures via a package on the server which your form can call. I know Forms supports passing pl/sql tables ("indexed by binary_integer"), so you could pass your nested table back and forth between the package and the form in that format.

Maybe you are looking for