Dynamic SQL in non oracle Data Template

Hi All
I am currently working on a project with BI Publisher and we are developing on an OBIEE data source using data templates.
Does anyone know how to handle dynamic sql &Lexicals when your only data source is OBIEE.
I have found some code in the help which doesn't seem to work.
{$ if ${P_COUNTRY} = '*,*' $}
WHERE "Customers"."Country" in (&P_COUNTRY)
{$ elsif ${P_COUNTRY} = '*' $}
WHERE "Customers"."Country" = :P_COUNTRY
{$ else $}
{$ endif $}
Thanks
Andy

Hi Andy,
If you are using Answers as data source, Dynamic query is not possible.

Similar Messages

  • Can you use SQL Developer against non Oracle data bases?

    If so, then how do you define the connection for non Oracle data bases?

    Look, SQL Developer has got to be a 'gateway' into Oracle DBs from other databases. JDBC allows simple introspection and execution of SQL commands. So the 'explain' button won't be available, or some of the DDL stuff, big deal! Let them get a taste of what they are missing by not having an Oracle database.
    If we can get non-Oracle developers (especially MS SQL Server) to use SQL Developer it will expose them to the superiority of the Oracle DB server.
    If they have heterogenous services installed they are already an Oracle customer -- we have little additional DB server sale opportunity there. SQL Developer is a really sweet tool and it could be a real draw into the DB server sales.
    SQL Developer must be easily usable by non-Oracle customers in order to help us sell the DB server to them!

  • Mapping deploy for Non-Oracle Data Source hangs

    Hi All,
    I am trying to deploy mapping for Non-Oracle Data Source and it hangs.
    Oracle version is 10.2.0.3 and OWB version is 10.2.0.1.3.1
    It would be really appreciated if you can help.
    Thanks!
    PS.

    That helpes quite a bit. I still can't get the app to retrieve data, but I am getting a more useful message in the log:
    [Error in allocating a connection. Cause: Connection could not be allocated because: ORA-01017: invalid username/password; logon denied]
    As you suggested, I removed the <default-resource-principal> stuff from sun-web.xml and modified it to match your example. Additionally, I changed the <res-ref-name> in web.xml from "jdbc/jdbc-simple" to "jdbc/oracle-dev".
    The Connection Pool "Ping" from the Admin Console is successful with the user and password I have set in the parameters. (it fails if I change them, so I am pretty sure that is set up correctly) Is there another place I should check for user/pass information? Do I need to do anything to the samples/database.properties file?
    By the way, this is the 4th quarter 2004 release of app server. Would it be beneficial to move to the Q1 2005 beta?
    Many thanks for your help so far...

  • Can SQL*Plus connect via ODBC to NON-Oracle data source?????

    I am struggling to understand something. I downloaded Oracle instance client, SQL*Plus and ODBC components with the hopes of being able to connect via SQL*Plus to a non-Oracle/ODBC compliant database.
    Is this possible? Or is SQL*Plus ability to connect via ODBC only to an Oracle data source??
    Thanks...

    sqlplus only connects to oracle. you can use the odbc driver from instant client to allow other applications to access oracle via odbc (e.g. excel). if you need to connect to non-oracle odbc database (ms-access, foxpro, etc.) you need odbc driver for those sources.
    you can use sqldeveloper to connect to oracle and non-oracle databases. check otn product info for sqldeveloper for more details.

  • Try to use dynamic sql connection for additioal data for xml publisher

    I understand that the xml publisher is using template to merger the xml data output (say from Oracle report).
    We have some Oracle seeded report and do not wish to modify these report, but we do need to add additional data to these reports. In the past, the tool we used has the capability to make dynamic sql calls to get these additional data. Can this be achieved in xml publisher?
    I did noticed that the template builder has two options for upload data source: from a data file or from a sql connection, but seems they can not be used together. Not much document I can find for this. Thank you in advance for your help.
    Frank

    Hi All,
    Sandeep: if u have the solution pls send to my email id [email protected]
    ill really appriciate u r response.
    I have the same requirement to develop AR Invoice Report in XML publisher, actually it was developed using Optio Layout.my issue is the actual AR Invoice RDF contains 20 records and it showing the 20 recodes when we run that program (concurrent program output) after that while printing this report uisng the OPTIO layout (The Optio system is fetching some more records (10 records)) it printing total 30 records. i mean here the OPTIO is handling some pl/sql code i guess..
    so now how we can handle this requirement using XMLP.I am using RTF Templates with 5.6.2 v. Is it possible to do the same manner how the OPTIO was doing. Is this possible with any other Templates ?. or we need to customize the RDF itself ? .but I know that I can go ahead and modify the existing out-of-the-box report, but I do not want to do that. I do not have control over the XML that is generated since the XML is generated when the report is run. Is there any way to retrieve the extra information AFTER the xml has been generated and BEFORE the template is applied ?
    Thanks,
    Rad

  • Can I change the SQL Datatype for Oracle Date?

    xMII 11.5 maps Oracle's Date type to its SQL type code 91 (Date).  When used in a display template, this xMII type displays only the date component (for example, "5/5/2007"), but in Oracle it holds the date and time.  In Java, the java.sql.Date type also holds the time component.  To get xMII to display a date/time (for example, "5/5/2007 11:23:59") you must have a SQL type code of 93 (Timestamp).
    Is there any way to get my xMII widgets to show the date and time components of an Oracle Date?  Is there a mapping of some kind that tells xMII which database SQL types map to which xMII SQL type codes?
    -tim

    In Aqua Data Studio:
    SELECT CREATED_DATE_TIME, MESSAGE FROM COLLABORATION_LOG
    where CREATED_DATE_TIME > to_date('01/01/07','mm/dd/yy') and site='DEM1'
    order by CREATED_DATE_TIME DESC
    GO
    results:
    CREATED_DATE_TIME   MESSAGE                                                                        
    5/3/2007 8:30:25 PM   (403)Access Forbidden                                                          
    5/3/2007 8:30:25 PM   (403)Access Forbidden                                                          
    5/3/2007 8:30:25 PM   (403)Access Forbidden   
    If I put the exact same SQL (without the "GO" at the end which is an Aqua Data Studio keyword) into a Fixed SQL Query in xMII and click "Test" and choose html format I get:
    CREATED_DATE_TIME MESSAGE
    05/03/2007 00:00:00 (403)Access Forbidden
    05/03/2007 00:00:00 (403)Access Forbidden
    05/03/2007 00:00:00 (403)Access Forbidden
    The time component is reported as "00:00:00" in xMII which is not the desired result.  I want xMII to see that column as a Timestamp which should read and sore both the date and time components in xMII.
    -tim

  • Access non-Oracle data base from Oracle Data base?

    Hi,
    I have a system using Oracle data base but i have to query some data in
    Access data base called TA_2008.mdb for specific table called FPTrans
    My oracle database SID=Ahmed10g my schema is attend/attend.
    I have tried to use the Heterogenous Services Generic Connectivity Agents .
    I think i have to build the ODBC driver for Access database not for oracle and specify the Access DB name
    But i built the driver for oracle.
    Please clear the steps for me and correct me if i am wrong .......................
    1. Create ODBC driver [microsoft ODBC for Oracle] as File Data Source Name =attendoraclefds
    user : attend
    password : attend
    Server :ahmed10g
    2. create intilization Parameter file in the path D:\oracle10gDB\product\10.2.0\db_1\hs\admin
    called : initATTENDORACLEFDS.ora
    CONTAINS PARAMETERS:
    HS_FDS_CONNECT_INFO=FILEDSN=attendoraclefds
    HS_FDS_TRACE_LEVEL=ON
    3. Edit TNSname.ora file :
    attendoraclefds =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = awahaishi_lptp.sepocye.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = attendoraclefds)
    (HS = OK)
    4. Edit Listener.ora file :
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (PROGRAM = extproc)
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle10gDB\product\10.2.0\db_1)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = attendoraclefds)
    (ORACLE_HOME = D:\oracle10gDB\product\10.2.0\db_1)
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = awahaishi_lptp.sepocye.com)(PORT = 1521))
    5. Restart the listener
    6. create the data base link:
    CREATE DATABASE LINK accessDB
    CONNECT TO attend IDENTIFIED BY attend
    USING 'attendoraclefds';
    select * from EMP_JOBS@accessDB;
    Error occures say :
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    ORA-28541: Error in HS init file on line 9.
    ORA-02063: preceding 2 lines from AAL
    Edited by: StillYoung on Mar 18, 2009 1:10 AM

    Please see if the following link is helpful:
    a question about transparent gateway,sb help me plz!!

  • Dynamic SQL report  on Oracle apex4.0

    Hi Everyone,
    I have two reports in one page.One is the Interactive and other is Sql report. Based on the selection of the row(using checkbox) in the interactive report, the sql report has to display the selected columns.
    Note :The report has to be loaded whenever a row is selected and without submitting a button
    Can anyone please suggest?
    I am using oracle Apex4.0
    Regards
    Raj

    I believe you store the values in the checkboxes. For example, your Interactive Report query looks like:
    SELECT '<input type=checkbox value='||OBJID||' />' AS CHECKBOX, T.*
    FROM SOME_TABLE T
    and in "Report Atributes" the CHECKBOX is displayed as "Standard Report Column".
    *1.Create a hidden check list input field.*
    It will store a list values of selected checkboxes. make it long enough, eg. 1000.
    Let's say the input name is: P000_X_CHECK_LIST
    *2. Create Dynamic Action*
    This dynamic action is supposed to fill in the P000_X_CHECK_LIST with a list of values, separated by ":" character.
    These values will be an input for the SQL report.
    Name: Update Check List
    Event: Change
    Selection Type: jQuery Selector
    jQuery Selector: input:checkbox
    Action: Set Value
    Set Type: JavaScript Expression
    function check_list() {
    var n = "";
    $(":checked").each( function () {
    n = n + (n === "" ? "" : ":") + $(this).val();
    return n;
    check_list();
    Selection Type: Item(s) - P000_X_CHECK_LIST
    *3. Adjust the "SQL report" query with this magic formula*
    AND SEARCHED_ITEM IN (
    SELECT item
    FROM (SELECT REGEXP_SUBSTR (str, '[^:]+', 1, LEVEL) item
    FROM (SELECT :P000_X_CHECK_LIST str
    FROM DUAL)
    CONNECT BY LEVEL <= length (regexp_replace (str, '[^:]+')) + 1)
    for example:
    SELECT O.*
    FROM SOME_OTHER_TABLE O
    WHERE SEARCHED_ITEM IN (
    SELECT item
    FROM (SELECT REGEXP_SUBSTR (str, '[^:]+', 1, LEVEL) item
    FROM (SELECT *:P000_X_CHECK_LIST* str
    FROM DUAL)
    CONNECT BY LEVEL <= length (regexp_replace (str, '[^:]+')) + 1)
    *4. Adjust the Dynamic Action:*
    Advanced: Event Scope: "live"
    *5. Add one more True action to the Dynamic Action:*
    Action: Refresh
    Selection type: Region
    Region: The region of the "SQL report".
    Volia!
    Best regards,
    Krzysztof

  • Regarding Native SQL to access Oracle Data from SAP

    Dear Gurus,
    This query is regarding Native SQL.
    Our database is Oracle and the client's database is also Oracle.
    To access the data directly from the client's database(Oracle), can I use Native SQL commands?
    Is there any disadvantage to use Native SQL?
    If Native SQL can be used, can any one send me the code to access the data from Oracle?
    Points will be rewarded.
    Thanks & Regards,
    Neeraj K.

    The problem is always data integrity. Doing things this way you are bypassing any business logic. So for example if you are connecting to a SAP Oracle database. SAP will not support your SAP system as you are doing direct updates to the database. I would suppose that this would be the same for any other product using the Oracle database. If you are only reading data from the database then it should be fine. I would however always using API's to access/update data.
    Regards

  • Oracle to Non-oracle data transfer

    Does anyone know about how to get the data on the oracle database to the Teradata platform for reporting purposes?
    I know about streams/mgw/IBM MQ setup but it has performance issues. So i need an alternative for it.
    Please suggest if you know any such tool or functionality.
    Regards,
    Ankit

    I think its better to post this topic in this forums
    http://forums.teradata.com
    Here is link for same question
    http://forums.teradata.com/forum/third-party-software/oracle-to-teradata-database-migration-tool

  • Pl/sql procedure in XML Data Template.

    Hi
    I have a procedure , which is returning a ref cursor , i need to use this ref cursor in xml data templete . how we will write this data templete.
    Also how to call the procedure in data templete.
    Please guide me.
    SS

    If it's function you can call it direct, Procedure all you need to do is to wrap the procedure around a function and call that function which return the ref cursor
    For example :
    I have getdept procedure which has OUT ref cursor, I will wrap this with
    get_dept function which return the ref Cursor then
    <sqlStatement name="Q1">
    <![CDATA[SELECT get_dept(:p1,:p2,....) dept from dual]]>
    </sqlStatement>

  • Dynamic style with non spatial data?

    Hi all,
    Here is the situation : I have two spatial tables with attributes.
    Each row in the first one will be affected to a row or several rows in the second using a third table that links the primary keys of both tables. (the third table is actually a temporary table loaded from an xml file)
    I would like to represent that on the map using a dynamic style. My column on which is based the affectation is varchar2 column. So I can't use numeric buckets.
    Is it possible to do that? And how?
    Thank you for your help.
    Max

    Hi Max,
    for varchar2 columns you can use Collection bucket styles where the values can numbers of strings. Post the general sturcture of each table (the attributes), and how you would like to link them. You may be able to define a view linking the tables, and then use one attribute of the view for the collection style.
    Joao

  • Dynamic sql generation using meta data

    I am trying to generate a sql statement, which should select all the columns of a table. (120 columns around.) I dont want to write like select * from tablename
    so I am trying to wrtie liek this, but I am having hard time.
    select 'select '||column_name||',' from user_tab_columns where table_name='MBR_RPT_CONT'
    I like output select col1,col2,col3,col5,col6 from MBR_RPT_CONT;
    Can you help me?

    In 11gR2 e.g.:
    SQL> select 'select ' || listagg (column_name, ',') within group (order by 1) || ' from ' || table_name sel_stm
      from cols
    where table_name = 'DEPT'
    group by table_name
    SEL_STM                                                                        
    select DEPTNO,DNAME,LOC from DEPT 

  • Different LOV behavior between SQL query data model and data template

    I have noticed different behavior when using parameters linked to list of values (LOV) of type menu with the multiple selection option enabled and a SQL query data model vs a data template. Here's the example because that first sentence was probably really confusing.
    SQL Query:
    select
    plmc.MonthCode, plmc.ModalityDim, plmc.ModalityName,plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(:modalityDim,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (:modalityDim)
    then 1
    else 0
    end
    end
    Putting BI Publisher into debug mode, defining a data model of type SQL Query, defining a parameter called :modalityDim linked to a LOV that allows multiple selections, and selecting a couple of values from the LOV the output of the prepared statement is:
    [081607_122647956][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?,?)
    then 1
    else 0
    end
    end
    [081607_122647956][][STATEMENT] 1:6
    [081607_122647956][][STATEMENT] 2:7
    [081607_122647956][][STATEMENT] 3:6
    [081607_122647956][][STATEMENT] 4:7
    [081607_122654713][][EVENT] Data Generation Completed...
    [081607_122654713][][EVENT] Total Data Generation Time 7.0 seconds
    Note how the bind variable :modalityDim was changed into two parameters in the prepared statement.
    When I use this same SQL Query in a data template the output is:
    [081607_012113018][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?)
    then 1
    else 0
    end
    end
    [081607_012113018][][STATEMENT] 1:'6','7'
    [081607_012113018][][STATEMENT] 2:'6','7'
    [081607_012113574][][EXCEPTION] java.sql.SQLException: Syntax error converting the nvarchar value ''6','7'' to a column of data type int.
    Note the exception because it is trying to convert the multiple parameter values.
    Am I doing something completely wrong here? I really need to use a data template because I will need to link a couple of queries together from different database vendors.
    -mark

    This is for 10.1.3.4 - because in 11g every SQL query is automatially part of a data model.
    In 10g SQL query is for simple unrelated SQL queries.
    If you need to use advance features such as:
    a) multiple SQL queries that are joined in master-detail relation ships
    b) before/after report triggers
    Then you will need to use the data template, which is an XML description
    of the queries, links, and PL/SQL calls.
    hope that helps,
    Klaus

  • Multiple SQL Statements in Data Template

    If I have more than 1 sql statements in a data template, how can I target them directly? I would like to link directly to a report and don't want to use the default sql statement.

    Sorry, could you please elaborate further.

Maybe you are looking for

  • Safari will not open on iPad 2

    Safari will not open on iPad 2.  I've rebooted the cable modem. Other iPad 2 and iPhones work properly.

  • Problems with USB port and connecting ipod?

    So I recently got a Macbook Pro Retina and I'm having some trouble with my USB ports especially when syncing my ipod is involved. For some reason, the ipod has trouble connecting and it fluctuates from connecting to not connecting and sometimes, the

  • Trouble connecting Powermac G5 to Dell monitor

    I recently aquired a G5(June 2004 model)and I am trying to connect my Dell monitor(model S2009W)to it. The monitor has both VGA and DVI inputs. I have tried connecting with a DVI cable and also a DVI-VGA adapter. Neither has worked. The monitor says

  • Unable to pass flashvars in application url in Flex 4.5.

    I am creating an application in which I have to pass variable in application URL like http://localhost/Test/test.html?name=testUser It works fine in flex 3.5 and can be read using Application.application.parameters['name']. But with flex 4.5 it is no

  • Getting error when record type is used

    Hi Experts, Getting error when using record type as in parameter. PLS-00306: wrong number or types of arguments in call to 'SAL_UPDATE_PROC' PLS-00302: component 'ENAME' must be declared PLS-00302: component 'SAL' must be declared CREATE OR REPLACE P