How to use databank values in utilities.getSQLService() statements?

Hi,
I have configured conections.csv file containing fields
Connection,Hostname,Port,Service_name,DB_User_Name,DB_Password
and used the following statements to connect to the database:
          getDatabank("connections").getNextDatabankRecord();
          utilities.getSQLService().define("{{connections.Connection}}",
                    "oracle.jdbc.driver.OracleDriver",
                    "jdbc:oracle:thin:@{{connections.Hostname}}:{{connections.Port}}/{{connections.Service_name}}",
                    "{{connections.DB_User_Name}}",
                    "{{connections.DB_Password}}");
          utilities.getSQLService().connect("{{connections.Connection}}");
Unfortunately this did not work.
Is it possible to use databank values to parametrize connection to the database?
Thanks,
Maija

Hi Alex,
These 2 options worked OK
--- Option 1: using variables ---
     public String v_env, v_host, v_port, v_srv, v_usr, v_pwd;
     public void initialize() throws Exception {
          getDatabank("connections").getNextDatabankRecord();
          v_env = eval("{{db.connections.Environment}}");
          v_host = eval("{{db.connections.Hostname}}");
          v_port = eval("{{db.connections.Port}}");
          v_srv = eval("{{db.connections.Service_name}}");
          v_usr = eval("{{db.connections.DB_User_Name}}");
          v_pwd = eval("{{db.connections.DB_Password}}");
          utilities.getSQLService().define(v_env,
               "oracle.jdbc.driver.OracleDriver",
               "jdbc:oracle:thin:@" + v_host + ":" + v_port + "/" + v_srv,
               v_usr,
               v_pwd);
          utilities.getSQLService().connect(v_env);
*--- Option 2: using eval("{{db.connections.<data_field>}}" ---*
          utilities.getSQLService().define(eval("{{db.connections.Environment}}"),
                    "oracle.jdbc.driver.OracleDriver",
                    "jdbc:oracle:thin:@" + eval("{{db.connections.Hostname}}") + ":" + eval("{{db.connections.Port}}") + "/" + eval("{{db.connections.Service_name}}"),
                    eval("{{db.connections.DB_User_Name}}"),
                    eval("{{db.connections.DB_Password}}"));
          utilities.getSQLService().connect(eval("{{db.connections.Environment}}"));
Thanks for prompt help! :)
Regards,
Maija

Similar Messages

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM

  • How to use Special value set with Column clause to display addtional column

    hi
    can anyone tell me
    How to use Special value set with Column clause to display addtional column
    how can i use FND POPID and with COLUMN clause ?

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • How to use hashtable values

    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).

    I'm not clear what exactly are you looking for? Is it just the printing/reading of values in hashtable or some interaction of those values with beans?
    --Shiv                                                                                                                                                                                                                                                                                                                               

  • Reposting:urgent....how to use hashtable values

    Hi
    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).
    is it <hashtable>.get(object name);
    if it is what should be my object name...is it VO attribute of LOV???or the Id in that lov page??
    please help me out..
    Regards
    Sandeep.G

    if(pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    if (lovResults != null)
    value = (String) lovResults.get("<Lov Item Name>");
    }

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

  • How to use a value taken in a variable as a table name in a query?

    I am fetching a value in a variable as:
    <select application_short_name into l_appl_nm from fnd_application where application_id=:p_appl_id>
    Now I need to use the value fetched in variable "l_appl_nm" as a table partition name in next query.
    Can anyone please guide me on this concept.
    Expecting replies asap !!

    I am fetching a value in a variable as:
    <select application_short_name into l_appl_nm from fnd_application where application_id=:p_appl_id>
    Now I need to use the value fetched in variable "l_appl_nm" as a table partition name in next query.
    Wrong.
    This is NOT how partition pruning should be applied.
    Expecting replies asap !!
    In that case, the forum members who provide their experience and knowledge for free, expects you to PAY for that.
    You want make demands on this volunteer forum? Then by the same token, payment demands can be made on you.
    So.. are you going to pay up?

  • How to use return value from TestComplete ( using COM) as a variable in the conditional statement (e.g. while loop) in TestStand

    Hi,
    I have setup a COM interface for TestStand(TS) to run certain scripts in TestComplete (TC).  Normally, when TestComplete finishes executing the script, it returns a 0 or 1 to denote pass/fail in the TestStand step (e.g String value test step).  This worked fine.
    However, now I need TestComplete to return a vaule( e.g 32) to TS, and TS need to evalue this value in a while statement. So if TC return value is 32, I'd have some statement in TS ike :                                                                                                 
    While (return value != 30)
    Do something..
    Thanks,
    Solved!
    Go to Solution.

    There are a hundred ways to implement what you are asking.  The hard part is deciding which one would be the best for you.
    What adapter are you using to communicate with TestComplete?  ActiveX?  Is TestComplete running asynchronously (in parallel)?  If so then how is the data getting back to TestStand?
    So here are some options:
    1. You can use the While Step type.  It's in the Flow Control folder in your Step Types pallette.  Look in your examples under UsingFlowControlSteps.seq in the SequenceFlow
    2. You can loop on a step and have the termination for the loop be (return value == 30).  Look in the Step Properties under Looping.  Also in the TestStand help
    3. You could do Post Actions based on a condition and have it jump to another step.  Read about it in the TestStand Reference Manual.
    4. You could use a GoTo step.  I don't really recommend this one.  It makes code hard to maintain.  Also an example in SequenceFlow called gotobeep.seq.
    Hopefully this gets you thinking.  Let me know if you have specific questions about any of these methods.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to use rounded values in BEx Formulas

    Hello,
    I have the following question. Is it possible to use rounded values up to a certain # of decimal points in BEx Formulas?
    I have the following problem.
    Consider this:
    keyfigure val 1 = 0.416666667
    keyfigure val 2 = 72
    val 3 (BEx Formula)  = val 2 / val 1 = 172.799999862
    However, what I need to do is this.
    val 1 & val 3 should rounded up to 2 decimal points. So, I really need the report to show this:
    val1 = 0.42
    val2 - 72
    val 3 = val 2 /val 1 = 171.43
    I changed the number of decimal places on val 1 and val3 to be 0.00. However, it appears that these rounded values are not taken into account in  the Formulas, as if the OLAP still uses the original values from the backend with 9 decimal points. So, no matter how many decimal points I use on the Display tab for a key figure, my val3 or result of my formula is always taking into account the 9 digit decimal values, not rounded values that I want. So in the example above, my val 3 comes to 172.80, which it should be 171.43 instead of you use the rounded values in the calculation.
    Please let me know if there is any workaround where I could force my BEx Formula to utilize the rounded values and not actual values from the backend DSO. Or any other solution.
    Thank you

    If you create a Formula in BEx Query Designer like the one below, it works:
    val3 = val2 / ( TRUNC ( ( val1 * 100 + 0.5 ) ) / 100 )
    The TRUNC function (among other things) actually ensures that your formula takes into account the rounded values that you want.

  • After hiding an item, its value cannot be used in a query. How to use the value of a hidden item.

    Hi,
    I have a shuttle. I am using its value in a query by using sql collection array. My requirement is that I need to hide that shuttle. But when I hide the shuttle, its value is not retrived by the query.
    Please give some idea how to get this functionality.
    Thanks,
    chandru

    ChandraBhanu wrote:
    Its a shuttle. so how to create an application item of shuttle type?
    pls give some idea.
    You don't create an application item of shuttle type.  Application items only hold one value, and I thought since you were using a value in a query that you were only using one.  In the case of multiple values my idea to use a page/application item will not work

  • How to use 'REQUEST' value on PL/SQL

    Hi All,
    I have assigned 'SEARCH' as button request to search button. I want to use this value in PL/SQL some thing like
    IF REQUEST='SEARCH' THEN
    --do something
    ELSE
    --do something else
    END IF;
    Can any one suggest how to access the 'REQUEST' value?
    Thanks in advance.
    Regards,
    Hari

    Hi rchalton!
    Sorry for that. Here is an english document which also shows an example of how to use v('REQUEST') or :REQUEST.
    [http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm]
    regards
    Edited by: Florian W. on 06.04.2009 15:35
    I've also tried to translate this link from german into english with google and it worked very good.

  • How to use DFF value in BG_ABSENCE_DURATION Fast formula

    Hi All,
    I would like to know how can we use DFF values in BG_ABSENCE_DURATION fast formula.
    Can we pass them as input values?
    Also, when we use them as DATABASE ITEMS how does Fast Formula identifies them.
    For example I have created a DFF value HALF_DAY that can take either "YES" nor "NO".
    I tried to use that as input value but that didnt work, not sure if it is possible at all or not.
    I also tried to use that as Data Base ITEM, as follows:-
    IF (ABSENCES_HALF_DAY WAS DEFAULTED ) then
    duration = 'FAILED'
    invalid_msg = 'DFF not working'
    Any help will be much appreciated.
    Thanks,
    Avinash
    but i am getting following error when i access SSHR
    Formula BG_ABSENCE_DURATION: ORA-01403: no data found ORA-01403: no data found Cause: During the PL/SQL execution part, an Oracle error was detected. Action: Please refer to your system administrator.

    Thanks Vigneswar  and Avaneesh for your helpful comments,
    Actually I want to retrive the DFF value that I pass while applying the Leave Request and not that already stored in the data base. I checked and found that the query you have mentioned is retriving the data from base tables.
    select target.ATTRIBUTE6 -- Attrinute6 is database item ABSENCES_HALF_DAY+
    from    per_absence_attendances                target,+
    per_all_assignments_f                  ASSIGN+
    WHERE   sysdate BETWEEN ASSIGN.effective_start_date+
    AND ASSIGN.effective_end_date+
    AND    ASSIGN.assignment_id                  = 647--&B2+
    AND    ASSIGN.assignment_type                = 'E'+
    AND    target.person_id                      = ASSIGN.person_id+
    AND    target.absence_attendance_id  =+
    *(select max (absence_attendance_id)*
    from   per_absence_attendances+
    where  person_id   =  ASSIGN.person_id+
    and    date_start <=  sysdate+
    I have only added folloing lines In my BG_ABSENCE_DURATION FF
    DEFAULT FOR ABSENCES_HALF_DAY is 'XX'+
    if (1 = 1) then+
    duration = 'FAILED'+
    invalid_msg = 'DFF not working: '+ABSENCES_HALF_DAY+
    But evry time output is *"DFF not working : Yes"* no matter what the value I am passing while applying leave. This value "Yes" is stored in DFF attribute 6 for the test employee and I guess FF is retriving this value from DATABSE not from current transaction.
    Could you please help how to retrive run time data.
    Thanks,
    Avinash

  • How to use Copy-Value function?

    Dear Friends,
    I have query on how to use Standard function Copy-Value.
    Please have a look @ the help.sap.com example use of Copy-Value function.
    http://help.sap.com/saphelp_nw70/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm
    I have designed the same example. Please see the mapping I've defined for this example :
    http://www.flickr.com/photo_zoom.gne?id=930440086&size=o
    Please see the resuts, its working perfectly. See the top image :
    http://www.flickr.com/photo_zoom.gne?id=930440300&size=o
    Ok, now lets come to the issue. Please consider the same example , If I have more than one partner
    and I want to use the address field to the customer street,city & zipcode using copy-value function, how will I achieve this?
    Please see the resuts.See the bottom image :
    http://www.flickr.com/photo_zoom.gne?id=930440300&size=o
    I think you all got the issue, if not please reply back.
    Looking for your answers!!!
    Best regards,
    raj.

    The CopyValue function considers only values in the first context of the queue.
    When the queue has more contexts, the other contexts are ignored.
    In online help, the element addrDat is 3 times under name, that means 3 values are in the first context.
    That means: For the first occurrence of the partner it is correct, for all other partners, the values of the first context is taken. The online help does not express this,  so it is misleading and should be changed to an example where address is not beyond a node with occurrence inbounded.
    In practical cases the copyValue can only be used for values that appear in source just one time, like the IDOC header fields, as it works like a constant.
    Regards
    Stefan

  • How to use time values from graph or chart for other calculations

    iam generating an ultrasonic signal of frequency 500k. In the equation i need the values of time axis of the graph or chart for calculationg the envelope of the graph. please help me how to use the x-axis time values.I have tried by writing in spread sheeet or by using arrays. here iam not able to get only 1 dim time values.
    AshwiniP

    Use a property node

  • How to use 'Extract Values' transformation?

    Hi,
    I am new to EDQ. I have the following requirement - source system sends me partyname+address details. I need to check in the oracle database and if there is a match then send back the ID along with the input details. I am using Lookup check audit process to check if the data is present in the database. If the data is present then I need to send back the ID. To extract the ID I am using 'Extract Values' transformation. I am not able define the Reference Data for this . Can provide a example how to use the same.
    Thanks
    Prabha

    Just use Lookup and Return.
    Though it sounds like you really should be using a match process.

Maybe you are looking for

  • Page items not getting set upon login in APEX 4.0.2

    We just upgraded our APEX in development from 4.0.1 to 4.0.2.00.07. While testing found that in APEX developer, unless we press one of the buttons (Debug/View Debus/Show Edit Links) in the tool bar on the login page, the application/page items are no

  • Oracle ADF VO old value problem.

    I have a web application developed Oracle ADF and Jdev 11.1.2.3.0. I have a button in my page which name is "Complaint". When user click the button, it invokes a method on ApplicationModuleImpl via a ManagedBean. public void clearAndExecute(){ getCar

  • Problems with the web based email page and Windows...

    We've just upgraded our PC to Windows 8 and I've read the bit on the Help page which says that Yahoo Mail is not compatible with Windows 8 and that we need to access our email via the webpage. Fair enough - though why Yahoo mail still won't work with

  • Back button for internal hyperlinks?

    I've created internal hyperlinks with IBA (to other chapters in the text) and for the most part, they work. But there is no back button? Help! And thanks!

  • Purchased songs/videos not working

    I've had my iPod video since January, and everything I've recorded and downloaded to it is working perfectly, except for items purchased on iStore. Some of them were bought before my new iPod, some after, but neither songs nor videos are working (wit