Creating a Custom SQL Query

Hello Folks,
I am working in a project in Brazil and, we need develop the following load to Hyperion Planning:
We have the PeopleSoft ERP (MSSQL - relational database) as source.
Our target is Hyperion Planning.
The customer has all SQL queries statement written in Hyperion Application Link (HAL), and we need migrate all HAL projects to ODI. In short, I must apply this query as source object and load in Hyperion Planning.
Follow below the SQL query:
SELECT RTRIM(ID_CR)AS ID_CR,
RTRIM(DSC_CR)AS DSC_CR,
RTRIM(ID_PARENT)AS ID_PARENT,
'0' EXPENSES,
'1' INCOME,
'0'DRE,
RTRIM(STATUS)AS STATUS
from DIM_CR where tipo_cr = '1'
union
SELECT RTRIM(ID_CR)AS ID_CR,
RTRIM(DSC_CR)AS DSC_CR,
RTRIM(ID_PARENT)AS ID_PARENT,
'1' EXPENSES,
'0' INCOME,
'0' DRE,
RTRIM(STATUS)AS STATUS
from DIM_CR where tipo_cr = '0'
I have been written here that it is necessary develop a custom KM to apply a query in ODI. Is it true? Is There another way to solve this issue?
I have been learned a lot with you. I appreciate a lot your help.
Wallace Galvão,
Brazil

Hi,
Maybe I am wrong but I wouldn't of thought a procedure would be able to do what is trying to be achieved, with planning you can't just directly insert into and you need to use the IKM to load to it? I would be interested to know if it could easily be done using a procedure. I would of thought the best option to update the KM
Anyway looking at the query though I am sure it could be achieved without any changes.
It looks like it is pulling information from one table, which could be reversed and dragged as the source, a filter added on tipo_cr to return 1,0 values
Then on your staging area you could use some of the inbuilt functions such as CASEWHEN to manipulate the data.
e.g. when tipo_cr = 1 , expenses column = 1 else it would be 0
There is also the RTRIM function.
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • How can I use the Rownum/Customized SQL query in a Mapping?

    Hi,
    * I need to use a Rownum for populating one of the target field? How to create a mapping with Rownum?
    * How can I use an Dual table in OWB mapping?
    * Can I write Customized SQL query in OWB? How can I achieve this in a Mapping?
    Thanks in Advance
    Kishan

    Hi Niels,
    As I'm sure you know, the conundrum is that Reports doesn't know how many total pages there will be in the report until it is all done formatting, which is too late for your needs. So, one classical solution to this problem is to run the report twice, storing the total number of pages in the database using a format trigger, and throwing away the output from the first run when you don't know the total number of pages.
    Alternatively, you could define a report layout so that the number of pages in the output is completely predictable based upon, say, the number of rows in the main query. E.g., set a limit of one, two, ... rows per page, and then you'll know how many pages there will be simply because you can count the rows in a separate query.
    Hope this helps...
    regards,
    Stewart

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • Problem for create report by sql query under Protal!

    I'm trying create report by sql query method, however it came out the error:
    ORA-00918: column ambiguously defined (WWV-11230)
    Failed to parse as SENTRYDB - select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' ) as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid from pnames t1, people t3, groups t4 where t3.persongroup = t4.groupid and t1.personid = t3.personid order by rowid (WWV-08300)
    Error: Unable to execute query (WWV-10201)
    The query is :
    select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' )
    as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid
    from pnames t1, people t3, groups t4
    where t3.persongroup = t4.groupid
    and t1.personid = t3.personid
    I have no problem to run that query under sqlplus!

    Hi,
    I'm cuurently using the portal inside of 9iAs 1.0.2.2.2a. What version of that Portal? By the way, how can I find out the version of Portal that I using? And also can I display image inside of report which created by Portal? I tried statement:
    select
    '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg',
    owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' stu_pic,
    from stu
    However, it doesn't work. It came out error:
    Unable to describe SQL statement. Please correct it (WWV-13010)
    Invalid SQL statement: select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-13005)
    ORA-01001: invalid cursor (WWV-11230)
    ORA-00904: invalid column name (WWV-11230)
    Failed to parse as SENTRYDB - select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-08300)
    Do you know why?

  • Possible to execute custom SQL query?

    Is it possible to execute a custom SQL query and get back a collection of
    objects with Kodo JDO? Query expression languages like JDOQL are all very
    well (I actually think JDOQL is pretty messy), but sometimes when you've
    got a complex query (and you know you're using a RDBMS) it is best
    accomplished in a SQL statement. I see Kodo has extended JDOQL, which is
    good, but developing custom extensions seems to be limited to implementing
    kodo.jdbc.query.JDBCFilterListener where you can customise the where
    clause. What I want to be able to do is to specify the entire SQL string.
    I am looking into using Kodo JDO for my organisation, and being able to
    use custom SQL is something i would expect (and something we can do with
    our current O/R mapping product (TopLink)).
    Regards,
    Alex

    Patrick Linskey wrote:
    On Tue, 30 Sep 2003 10:57:13 +0000, Alex wrote:
    being able to use custom SQL is something i would expect
    We absolutely agree. Take a look at the samples/customSQL example in the
    Kodo distribution.
    -Patrick
    Patrick Linskey
    SolarMetric Inc.Hi Patrick,
    I have downloaded kodo-jdo-3.0.0RC1 for windows for evaluation, but there
    is no samples/customSQL directory.
    Alex.

  • Execute custom SQL query in OIM11g

    Hi,
    Can you please provide me some java code snippet to execute a custom sql query and also to get db connection to execute this query in OIM 11g. I am going to run this query in an adapter.
    Thanks a lot for ur help.
    Mike

    Hey Mike,
    Use the below sample code to get db connection and then to execute a query in OIM11g.
    String query = "SELECT UD_ADUSER_EMAIL FROM UD_ADUSER WHERE upper(UD_ADUSER_UID) like '%TESTU%'";
    Connection con = Platform.getOperationalDS().getConnection();
    PreparedStatement preparedStatement = con.prepareStatement(query);
    ResultSet resultSet = preparedStatement.executeQuery();
    while(resultSet.next())
    System.out.println("Output:"+resultSet.getString(1));
    }

  • Incorrectly read attributes with custom SQL query

    Hi folks,
    I'm trying to read in a random sampling of records from a table, so I tried:
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(Foo.class);
    q.addPartialAttribute("bar");
    q.setSQLString("select * from Foo sample(10)");
    q.useCursoredStream(100,100, new ValueReadQuery("select count(*) from Foo sample(10)"));
    This all worked fine, the Foos were retrieved, but after the first dozen or so, all the "bar" attributes were null, which they should not be. This only occurs when using a custom SQL string. I tried bringing back all the objects (i.e., without using setSQLString) and examining them and all the "bar"s were present. But when I use setSQLString the attributes don't get read correctly.
    Can anyone tell me what I'm doing wrong? Is there a better way to do it?
    Thanks,
    Bryn

    Okay, here's the actual code:
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(ActivityCenter.class);
    boolean useCustom = true;
    if (useCustom) {
    q.setSQLString("SELECT SetupDt, TerminationDt, ReinstateDt, IID, upDt, ID, " +
    "Stat, SubType, Acct FROM ACtr");
    q.useCursoredStream(100,100, new ValueReadQuery("select count(IID) from actr"));
    } else {
    q.useCursoredStream(100,100);
    session.logMessages();
    activityCenters = (CursoredStream) session.executeQuery(q);
    ActivityCenter ac = (ActivityCenter) activityCenters.read();
    if (ac.getAccount() == null) {
    System.err.println(ac.getID() + ": Oops!");
    } else {
    System.err.println(ac.getID() + ": Has account!");
    System.exit(0);
    So, everything about this program is the same - how the mapping is done, how things get initialized, everything. The only difference is whether I use a custom SQL query or not. Here's what it looks like when I run it both ways:
    First, custom:
    DatabaseSession(2433702)--Connection(393272)--SELECT SetupDt, TerminationDt, ReinstateDt, IID, upDt, ID, Stat, SubType, Acct FROM ACtr
    1.1: Oops!
    Now, without the custom SQL:
    DatabaseSession(393272)--Connection(7896086)--SELECT SetupDt, TerminationDt, ReinstateDt, IID, upDt, ID, Stat, SubType, Acct FROM ACtr
    DatabaseSession(393272)--Connection(7896086)--SELECT
    //bunch of fields from the Acct attribute...
    FROM Acct WHERE (IID= 'ffbe5c47f3ea762cfd50fbe9e6d6de6')
    1.1: Has account!
    Notice that the first query on Actr is identical in both cases. Also note there are no null Actr.acct fields in the database:
    SQL> select * from actr where actr.acct is null;
    no rows selected
    SQL>
    This is on Oracle 9i, with the thin jdbc driver.
    Also, I was curious that you asked if I was using partial attributes - when I try to add a partial attribute when using the custom SQL string, I get exceptions like this one:
    java.lang.ClassCastException: oracle.toplink.internal.queryframework.CallQueryMechanism
    at oracle.toplink.queryframework.ObjectLevelReadQuery.initializeDefaultBuilder(Unknown Source)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.getExpressionBuilder(Unknown Source)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.addPartialAttribute(Unknown Source)
    at jenkon.magellan.util.MLMulator.getActivityCenters(MLMulator.java:782)
    at jenkon.magellan.util.MLMulator.run(MLMulator.java:897)
    at jenkon.magellan.util.MLMulator.main(MLMulator.java:943)
    Thanks,
    Bryn

  • Parameter passing to custom SQL query using PL/SQL FUNCTION

    Hi
    In order to pass a parameter to the query in custom folder of a business area I created a function and mapped it to the Custome query using Discoverer Desktop. There is no error in mapping as the system does not throw any error. When I am inputting the Parameter for the input values everytime the query doesnot return any rows.
    Can anybody help in this regard

    Hi,
    I need to take the request Id as input from the user and then fetch only the data pertaining to that requet Id. As a lot of complex joins are involved I need to pass request id as parameter to the custome folder.
    The package i greated:
    CREATE OR REPLACE PACKAGE SETPARAM
    AS
    param1 varchar2(25);
    param2 varchar2(25);
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER ;
    FUNCTION GET_PARAM1 RETURN varchar2;
    END SETPARAM;
    CREATE OR REPLACE PACKAGE BODY SETPARAM AS
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER IS
    BEGIN
    fnd_client_info.set_org_context('138');
    param1 := p1;
    dbms_output.put_line(param1);
    RETURN 1;
    END;
    FUNCTION GET_PARAM1 RETURN varchar2 AS
    BEGIN
    RETURN param1;
    END;
    END SETPARAM;
    I registered the set_param1 function as a pl/sql function in discoverer admin.
    This function is called on the condition associated with the parameter in Discoverer Desktop when i run the report.
    In the custom folder query i have this piece in the where clause
    WHERE tnfo.request_id = NVL(APPS.SETPARAM.GET_PARAM1,7383588)
    And everytime i get the data pertaining to request id =7383588,
    Please suggest where i went wrong
    thanks
    Ashwini

  • Unable to use custom SQL query in report

    Hi all,
    I am newbie to OBIEE
    I try to write a customized sql in one of the report in OBIEE answers.
    No error is thrown when I click on "Set SQL" button.
    But, when I try to click on "Result" tab, I get the below error message,
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: count(AS_SALES_LEADS.STATUS_CODE by [ ] ). Please fix the metadata consistency warnings. (HY000)
    The same query I try running in Toad and it is not throwing any error, but running successfuly.
    Kindly help me on this.
    Regards,
    Shivakumar A

    Thank you very much for your time.
    Below is the query I used,
    SELECT saw_0."1", saw_0."2", saw_0."3"
    FROM (SELECT COUNT (c.status_code) "1", COUNT (a.status) "2",
    COUNT (c.accept_flag) "3"
    FROM table1 c,
    table2 g,
    table3 f,
    as_leads a
    WHERE f.sales_group_id = g.sales_group_id
    AND a.lead_id = c.sales_lead_id
    AND a.customer_id = f.customer_id) saw_0
    Result I get when run in Toad,
    Col1 Col2 Col3
    1234 43534 6787
    But, the same when I put in advanced sql tab, I get the below error message,
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: count(AS_SALES_LEADS.STATUS_CODE by [ ] ). Please fix the metadata consistency warnings. (HY000)
    Please do help me on this.
    Hope the above information is enough for getting an idea what I am stuck up with.
    Edited by: 961805 on 17 Oct, 2012 3:56 AM

  • Creating a dynamic SQL query builder class

    I have a jobs table where each row contains information about jobs run on a machine. I have a web view of this database which shows different information and queries for this information are built using the following fields:
    TYPE
    TITLE
    NODE
    STATUS (an array of 4 different possible statuses)
    TIMESTAMP
    GUID (will be used when a view of a specific job (row in the table) is requested, no other search criteria needed when this view is required.)
    All the criteria will be passed from the view layer into a search criteria object which is then passed to the DAO class which passes it to a BuildSQL class to use it to build the SQL.
    There are many different "views" of the data which will result in many different combinations of criteria being passed down to the data access layer. (for example a status of failed and a timestamp resulting in all the jobs run in the last 2 hours)
    As there are a number of different search criteria used in each query I'm having trouble designing the class to dynamically build the query. Are there any standard ways of doing this out there that could guide me?
    At the moment I'm seeing this class as being a large combination of if statements and not really being very dynamic.
    I was thinking maybe checking all the criteria to see if its null, if so ignore it straight away and then running through all the other criteria and appending one by one to the may SELECT which has already been created. Quite how i'd decided whether it would need an AND or OR before it I dont know.
    Are there any standard proven ways to approach this because i've done a search here and on google and not really come back with much, so any advice would be great. I've got to say I'm pretty new to java and don't really have many bright ideas here!

    Well my dear friend... I did something special for a business logic support to an web autocomplete component.
    The criteria building was based on a custom variable into the SQL statement:
    SELECT * FROM TABLE WHERE __MC__ AND (FIXED CRITERIA)
    Where:
    *FIXED CRITERIA: Is a fixed criteria that doesn't variate
    *__MC__: Is a "custom variable" defined for me to make the replacement.
    There are two main clases:
    *SQLBuilder: It has many logic to build SQL Statements
    *Multicriteria: It has the specific logic to insert into a SQL statement multiple criterias
    // The SQLBuilder class
    public class SQLBuilder {
        public static final String MC = "__MC__";
        static String buildMultiCriteria(String sql, Object[] params) throws Exception {
            for(int i=0; i<params.length; i++) {
                if(params[i] instanceof MultiCriteria) {
                    sql = sql.replaceFirst("__MC__",
                            ((MultiCriteria)params).getCriteria());
    params[i] = null;
    return sql;
    // The MultiCriteria class
    public class MultiCriteria {
    public static final int BEGINS = 0;
    public static final int ENDS = 1;
    public static final int CONTAINS = 2;
    private String criteria = null;
    public MultiCriteria(String[] fields, String value, int type) throws Exception {
    String[] tokens = value.split(" ");
    StringBuffer sb = new StringBuffer("(");
    for(int i=0; i<fields.length; i++) {
    for(int j=0; j<tokens.length; j++) {
    if(tokens[j].length()>0) {
         sb.append(fields[i].toUpperCase());
         sb.append(" LIKE '");
         sb.append(toType(tokens[j], type));
         sb.append("'");
         if(j<tokens.length-1) sb.append(" OR ");
    if(i<fields.length-1) sb.append(" OR ");
    sb.append(")");
    criteria = sb.toString();
    public String getCriteria() {
    return criteria;
    private final String toType(String value, int type) throws Exception {
    switch(type) {
         case BEGINS:
         value = value + "%";
         break;
         case ENDS:
         value = "%" + value;      
         break;
         case CONTAINS:
         value = "%" + value + "%";      
         break;
         default:
         throw new Exception("Undefined MutiCriteria type");
    return value;
    // I use the MultiCriteria this way
    // criteria is a string introduced in a html input text
    // The class splits the string by " " and ensemble multiple criterias
    // for the given fields permuting them with the tokens resulting of the
    // split
    MultiCriteria mc = new MultiCriteria(
    new String[] {"FIELD_01", "FIELD_02"},
         criteria,
         MultiCriteria.CONTAINS
    I think this idea could help you.
    Anything else, write me at [email protected]
    Best Regards,

  • Obtaining "rows selected" value after custom sql query in Database adaptor

    We are executing a custom query in a database adaptor. With other technologies (JDBC, etc.) the result of a query will not only produce a result set but a count of the number of rows selected. E.G. the script output of Oracle SQL Developer will print out something like:
    9999 rows selected
    at the end of the script output.
    I would like to obtain this value for a BPEL process. Of course, I could execute a 2nd query whose where clause is identical to the first, but selects count(*) instead. However, this is not only inefficient but (in rare circumstances in an active database) could be wrong.
    It is not obvious to this BPEL novice how to obtain the row selected value as well as the result set in one Invoke. Is this possible?

    This may not be the only solution - but it is how I have done it in the past.
    Following the invoke step of the adapter, use an assign/copy step to populate an integer BPEL variable using the count xpath function...
    <assign name="Initialize">
    <copy>
    <from expression="count(bpws:getVariableData('Invoke_Query_OutputVariable','MyTableQueryCollection','/ns3:MyTableQueryCollection/ns3:MyTableQuery'))"/>
    <to variable="NumberOfRecordsReturned"/>
    </copy>
    </assign>
    That should assign the number of records returned by the query.
    I hope that helps.
    Rod.
    Edited by: Rod Tunnels on Dec 15, 2009 1:16 PM

  • How to bind UI component to a view object which is created from a SQL query

    I am using JDeveloper 11.1.1.2.
    I created a method in my ApplicationModule to create an instance of ViewObject dynamically based on a "voCode" passed in :
    public ViewObject loadVO(String voCode) {
    ViewObject viewObject = findViewObject(voCode);
    if (viewObject == null) {
    viewObject = createViewObject(programCode);
    return viewObject;
    I created a Client interface for this method and refreshed the data control of the ApplicationModule.
    From the "Oracle JDeveloper 11g Handbook", I should be able to create a tree binding and a methodIterator executable for the "loadVO" method via the data control of the AM.
    I tried to add the binding manually to the page definition of my jspx page as I like to see if I can replace an existing binding with this new binding.
    I was not able to add the binding as the "Create Tree Binding" required both the "Root Data Source" and "Tree Level Rules" to be specified.
    I could specify the "Root Data Source" to point to the "loadVO" and corresponding parameter but not able to add any rule.
    When I clicked on the "+" icon to add rule, nothing happened that allowed me to specify the rule (if I know what rule I need to add).
    How should I bind the application module method "loadVO" so that it can be exposed in the Data Control to provide the data for a UI component like dynamic table?
    On the other hand, I could create the "methodIterator" first for the AM method "loadVO" but I wasn't able to create a tree binding to reference the "methodIterator".
    Is it possible to invoke the loadVO method with specific parameter value via the "methodIterator" from a bean method?
    Edited by: pyin_amec on Jan 25, 2010 3:57 PM
    I corrected the subject line and change my question to better reflect the problem I tried to solve.
    Edited by: pyin_amec on Jan 26, 2010 7:41 AM

    Hi,
    This worked for me .. I created a inputtext area where I can enter a query and execute ..
    Hope it helps..
    AM Impl
         public void createVoWithQuery( String pQuery )
              ViewObjectImpl vo = null;
              if( findViewObject( "DemoVo" ) != null )
                   findViewObject( "DemoVo" ).remove();
              vo = ( ViewObjectImpl )createViewObjectFromQueryStmt( "DemoVo", pQuery );
              //  vo.setKeyAttributeDefs( new int[]{0} );
              vo.executeQuery();
         @Override
         protected void prepareSession( Session session )
              super.prepareSession( session );
              if( findViewObject( "DemoVo" ) == null )
                   createViewObjectFromQueryStmt( "DemoVo", "Select 1 from dual" );
         }Page Def
    <executables>
        <variableIterator id="variables">
          <variable Type="java.lang.String" Name="createVoWithQuery_pQuery" IsQueriable="false"/>
        </variableIterator>
        <iterator Binds="DemoVo" RangeSize="25" DataControl="AppModuleDataControl"
                  id="ViewObj1Iterator" Refresh="deferred"/>
      </executables>
      <bindings>
        <tree IterBinding="ViewObj1Iterator" id="ViewObj1">
          <nodeDefinition Name="Dummy">
          </nodeDefinition>
        </tree>
        <methodAction id="createVoWithQuery" RequiresUpdateModel="true" Action="invokeMethod"
                      MethodName="createVoWithQuery" IsViewObjectMethod="false"
                      DataControl="AppModuleDataControl"
                      InstanceName="AppModuleDataControl.dataProvider">
          <NamedData NDName="pQuery" NDType="java.lang.String"
                     NDValue="${bindings.createVoWithQuery_pQuery}"/>
        </methodAction>
        <attributeValues IterBinding="variables" id="pQuery">
          <AttrNames>
            <Item Value="createVoWithQuery_pQuery"/>
          </AttrNames>
        </attributeValues>
      </bindings>page
    <af:panelStretchLayout id="psl1" startWidth="0" topHeight="100px" bottomHeight="0">
              <f:facet name="center">
                <af:table rows="#{bindings.ViewObj1.rangeSize}"
                          fetchSize="#{bindings.ViewObj1.rangeSize}"
                          emptyText="#{bindings.ViewObj1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          var="row" rowBandingInterval="0"
                          value="#{bindings.ViewObj1.collectionModel}"
                          selectedRowKeys="#{bindings.ViewObj1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.ViewObj1.collectionModel.makeCurrent}"
                          rowSelection="single" id="t1" partialTriggers="::cbEx">
                  <af:forEach items="#{bindings.ViewObj1Iterator.attributeDefs}" var="def">
                    <af:column headerText="#{def.name}" sortable="true" sortProperty="#{def.name}"
                               id="c1">
                      <af:outputText value="#{row[def.name]}" id="ot1"/>
                    </af:column>
                  </af:forEach>
                </af:table>
              </f:facet>
              <f:facet name="bottom"/>
              <f:facet name="top">
                <af:panelFormLayout id="pfl1">
                  <af:inputText value="#{bindings.pQuery.inputValue}"
                                label="#{bindings.pQuery.hints.label}"
                                required="#{bindings.pQuery.hints.mandatory}"
                                columns="60"
                                maximumLength="#{bindings.pQuery.hints.precision}"
                                shortDesc="#{bindings.pQuery.hints.tooltip}" id="it1" rows="2">
                    <f:validator binding="#{bindings.pQuery.validator}"/>
                  </af:inputText>
                  <af:commandButton actionListener="#{bindings.createVoWithQuery.execute}"
                                    text="ExecuteQuery"
                                    disabled="#{!bindings.createVoWithQuery.enabled}" id="cbEx"/>
                </af:panelFormLayout>
              </f:facet>
            </af:panelStretchLayout>

  • Basic question: Can OID map LDAP query to custom SQL query?

    Hi all,
    I have custom data in my Oracle Database and I wat to give them
    LDAP interface. Is it possible to use OID to achieve this or OID
    is for other purposes?
    To be more specific: I have schema MYSCHEMA and table
    MYSCHEMA.MYTABLE. Is it possible to configure OID to select from MYSCHEMA.MYTABLE for specific LDAP queries? And the same for update queries? Is there some OID manager console to map LDAP queries against Oracle tables and views?
    Thanx for any suggestions,
    Rob

    Rob,
    take a look at the Directory Integration Platform. We provide synchronization of data from an DB tables to OID.
    see "Synchronization with Relational Database Tables" http://download-west.oracle.com/docs/cd/B14099_14/idmanage.1012/b14085/odip_db.htm#i1042820
    another option could be to use the OID Plugin framework together with a PLSQL procedure to access the DB data
    http://download-west.oracle.com/docs/cd/B14099_14/idmanage.1012/b14087/svrplgin.htm#i741028
    regards,
    --Olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem creating an sql query with a parameter which is a list

    Hi,
    Im having a problem creating a certain SQL query.
    The query looks like this:
    SELECT gstock_id FROM germplasm_stock gps, germplasm gp WHERE gps.germplasm_id = gp.germplasm_id AND organism_id IN ($childList:VARCHAR).
    the organism_id field is of DECIMAL type.
    the parameter childList is actually a list of Id's, something like: 123,124,789
    and it is created dynamically by an other function, so I cant just put it there staticlly.
    I tried using the ARRAY type instead of VARCHAR, but that didn't work,
    anyone knows how can I give this query a parameter which is a list of numbers ?
    Thanks

    I have tried all the following options and the same issue occurs:
    EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
    With Parameter: 0, @ChangeVersion, ChangeVersion
    EXEC dbo.uspGetSiteChanges ?
    With Parameter: 0, @ChangeVersion, ChangeVersion
    In my first data flow I use the following and it works on two OLE DB Sources:
    EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
    With:
    In my second data flow task, I use the same command and parameter mappings and it fails, very strange.

  • Create Simple Printable SQL Reports in APEX 3.2 Without a Print Server

    Oracle Apex 3.2
    Oracle 11g
    OHS
    I thought I'd post an answer on how to get a printable SQL report in Oracle Apex without having to configure a print server. I'm sure that similar things have been posted in various other places, but I found the documentation for using custom row templates (to create a printable report) to be incomplete at best. For my needs, I was not looking for an awe inspiring report printout, but rather simple directory information printouts. For example, if you wanted a printable report to look like this:
    =================================
    CURRENT ACTIVE EMPLOYEES REPORT
    =================================
    First Name: Bob                  Employee ID: 0000000000
    Last Name: Swarts              Company Credit Card Number: 0000-0000-0000-0000
    Middle Initial: F                  Social Security Number: 000-00-0000
    First Name: Sue                  Employee ID: 1111111111
    Last Name: Johnson           Company Credit Card Number: 1111-1111-1111-1111
    Middle Initial: G                 Social Security Number: 111-11-1111
    etc.....In MS Access, doing this is very easy. From what I understand, this is also very easy to do this using PDF software with a print server. However, if you are like me, you don't want to waste time and money by obtaining and configuring a print server (even if it is free). However, never fear because you can create simple reports like this with relatively minimalistic effort; and you can do so without having to configure a print server.
    1.) Create a new page
    2.) Create a new sql query report region on the page
    3.) Make your query just as you would normally.
    For this example the query would be:
    select first_name, employee_id, last_name, company_credit_card_number, middle_initial, social_security_number from employee_table4.) Go to "Shared Components"
    5.) Under "User Interface" click on "Templates"
    6.) Click on the "Create" button
    7.) Select "Report"
    8.) Select "From Scratch"
    9.) For the "Template Class," choose one of the "custom" classes. For the "Template Type," choose "Named Column"
    10.) Click the "Create" button
    11.) Now that you created a custom row template, go back to "Shared Components" and then to "Templates"
    12.) Find your custom template and click on it
    CUSTOM TEMPLATE HOW TO
    1.) In the "Row Template 1" textbox, you are going to create some custom css that will display the data on the page. The css to make the report look like the report above would be:
    <div style = text-align: justify">
    <table>
    <tr>
    <td style = "width: 200px"><b>First Name: #1#</b></td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px"><b>Employee Id: #2#</b></td>
    <tr>
    <td style = "width: 200px">Last Name: #3#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Company Credit Card Number: #4#</td>
    <tr>
    <td style = "width: 200px">MI: #5#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Social Security Number: <b>#6#</b></td>
    </tr>
    </table>
    <p style = "page-break-after: always">----------------------------------------------------------------</p>
    </div>
    {code}
    As you probably figured out, the numbers between the two pound signs ("#") are substitution strings for the variables in your select query in the SQL report.  As you have also probably noticed, the "page-break-after: always" line will always make it so that only one report is shown on a page.  To fix this, we will need to use logic and row template 2.
    2.)  For the "Row Template 1 Condition," select "Use Based on PL/SQL Expression" from the select list.
    3.)  In the textbox for the row template 1 expression enter in the following:  {code}substr('#rownum#',-1) = 0 or substr('#rownum#',-1) = 5{code}
    ***** This condition will make sure that this template is applied when the last digit in the row number is either a "0" or a "5."  So, only 5 reports will be displayed per page.
    4.)  Now go down to "Row Template 2" and enter in the following in the textbox:
    {code}
    <div style = text-align: justify">
    <table>
    <tr>
    <td style = "width: 200px"><b>First Name: #1#</b></td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px"><b>Employee Id: #2#</b></td>
    <tr>
    <td style = "width: 200px">Last Name: #3#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Company Credit Card Number: #4#</td>
    <tr>
    <td style = "width: 200px">MI: #5#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Social Security Number: <b>#6#</b></td>
    </tr>
    </table>
    <p>----------------------------------------------------------------</p>
    </div>look familiar? that is because it exactly the same code as above, except without the page-break-after piece.
    5.) For the "Row Template 2 Condition," select "Use Based on PL/SQL Expression" from the select list.
    6.) In the textbox for the row template 2 expression enter in the following: substr('#rownum#',-1) != 0 or substr('#rownum#',-1) != 5***** This condition will make sure that this template is applied when the last digit in the row number IS NOT a "0" or a "5."
    7.) Scroll down to column headings and enter this in the textbox for the "Column Heading Template": OMIT
    8.) Click the "Apply Changes" button
    9.) Now go back to your application and the page you want to apply the custom report to
    10.) On the report, click on the report tab
    11.) Scroll down to "Layout and Pagination"
    12.) Click on the "Report Template" select list
    13.) Select your custom template
    14.) Click the "Apply Changes" button and run the page
    Try printing the report, if it does not print correctly, try it in Opera, Safari, Internet Explorer, Firefox, and Google Chrome. Please note that it is my understanding that only Firefox does not understand the css "page-break-after: always"
    If needed, add some css to the page to hide tabs and other items when you print.
    ~Andrew Schulltz

    DOH. Too much copy/paste.
    In my code, I was setting an application variable to contain the email address I was retrieving from AD. Once commented out, it worked fine.
              IF l_attr_name = 'mail' THEN
                 APEX_UTIL.SET_SESSION_STATE('F111_USER_EMAIL',l_vals(i));
              END IF;

Maybe you are looking for

  • Safari not working after IOS 8 upgrade

    After upgrade on iphone4s safari no longer works. The app will return to home screen.

  • Pa30 create external url link ( mass opload

    Has anyone been able to upload multiple attachments from a spread sheet to this transaction. Obviously using the function upload. I think the function module that I will need to use is called BDS_BUSINESS_DOCUMENT_CREA_URL. I have passed the followin

  • Is it possible to order a Calendar or prints from a saved pdf file?

    I spend an entire night making a calendar a few weeks ago on my friends mac so I had to delete the main folder in iPhoto. I exported it as a pdf hoping I'd be able to sort of print it out into a calendar later. Is this possible? I exported the calend

  • OrderedList

    Hi guys I need your help.I have to write java class OrderedList which I will be able to insert string elements and at the same time sorting them in in alphabetical order.I want the insert method to do all this for me.How do I do it? This is how I wro

  • ORACLE olap - dimension with huge number of members.

    Hi Experts, I have modeling a ORACLE OLAP cube with 10 dimensions. I have one of the dimensions which have huge leaf members...(probably 1 billion).. How many dimension members i can have for one dimension. Is there any limitation to the dimension me