Can we Run a simple SQL statement from OBIEE Middle Tier node

Hi
i am working in OBIEE 11g environment. Database is installed on one node and Middle tier (BI services ) in other node,
Can i use any utility to run a simple SQL statement from Middle tier ?
Thanks
Reddy

Any utility means?
We can create an ODBC connection on the BI server and run the sql.
Mark if helps.

Similar Messages

  • How to run a single sql statement

    I want to run a simple sql statement to get some data in my Controller or AM.
    Is there some way, other than creating a VO with the SQL statement, to get some data from the database. My sql query will always return a single row.

    Hi,
    here you have an example I use to call a function in a package (note how you can pass parameters and read results):
    Connection conn = this.getOADBTransaction().getJdbcConnection();
    OracleCallableStatement ocs = null;
    String param = null;
    try {
            String stmt = "BEGIN :1 := <PkgName>.<FunctionName>(:2); end;";
            ocs = (OracleCallableStatement)conn.prepareCall(stmt);
            ocs.registerOutParameter(1, OracleTypes.CHAR);
            ocs.setString(2, <param>);
            ocs.execute();
            param = ocs.getString(1);
         } catch(SQLException se) {
             throw OAException.wrapperException(se);
         finally {
             try {
                    ocs.close();
                    return(param);
             } catch(Exception e) {
                    throw OAException.wrapperException(e);
         }Hope this helps you
    Bye
    Raffy

  • Where to see generated SQL statement from jdbc adapter?

    Hi everybody,
    where can I see the generated SQL statement from JDBC adapter?
    Regards Mario

    Yes and True lterally means the same, but alas XI does not understand literature..
    Just checked the note as well, as you are correct!
    Regards
    Bhavesh

  • How Can I Retrieve SQL Statement From The User ?

    Hi
    I want to know, how can I make the user can enter the SQL statement from himself ?? in this code he can't enter it. Only he can display the SQL that i wrote it...
    this is my Code:
    import java.sql.*;
    public class db_testing {
         static final String DRIVER = "com.mysql.jdbc.Driver";            
         static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
         public static void main(String[] args) {
              Connection cn=null;
              Statement st= null;
              ResultSet rset=null;
              try{
                   Class.forName(DRIVER);
                   cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
                   st=cn.createStatement();
                   rset=st.executeQuery("select * from employee");
                   ResultSetMetaData metadata=rset.getMetaData();
                   System.out.println("The begining: ");
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(metadata.getColumnName(i)+"\t");
                   System.out.println();
                   System.out.println();
                   while(rset.next()){
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(rset.getObject(i)+"\t\t");
                   System.out.println();}
              catch(Exception e){
                   e.printStackTrace();
              finally{
                   try{
                   cn.close();
                   st.close();
                   rset.close();
                   catch(Exception e1){
                        e1.printStackTrace();
    }

    The following changes in the code will make the user to give the input
    import java.sql.*;
    public class db_testing {
    static final String DRIVER = "com.mysql.jdbc.Driver";
    static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
    public static void main(String[] args) {
    Connection cn=null;
    Statement st= null;
    ResultSet rset=null;
    try{
    Class.forName(DRIVER);
    cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
    // st=cn.createStatement();
    // rset=st.executeQuery("select * from employee");
    PreparedStatement pstmt=null;
    pstmt=cn.prepareStatement("select * from employee where id=?");
    pstmt.setInt(1,Integer.parseInt(args[0]));
    rset=pstmt.executeQuery();
    ResultSetMetaData metadata=rset.getMetaData();
    System.out.println("The begining: ");
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(metadata.getColumnName(i)+"\t");
    System.out.println();
    System.out.println();
    while(rset.next()){
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(rset.getObject(i)+"\t\t");
    System.out.println();}
    catch(Exception e){
    e.printStackTrace();
    finally{
    try{
    cn.close();
    st.close();
    rset.close();
    catch(Exception e1){
    e1.printStackTrace();
    }

  • Run a PL/SQL statement in an Oracle Alert action?

    Hello
    did anyone know is it possible to run a PL/SQL statement in an Oracle Alert action?
    I can run an SQL like “UPDATE Table SET alert_run = 'ok' where id = 10;” but if I run instead of this the following
    “Select XXKN_TEST.UPDATE_XXX_TEST('&USER_NAME') From dual;”
    I get the following error log:
    Alert: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    ALECDC module: Check Periodic Alert
    PL/SQL procedure successfully completed.
    XXKN_TEST.UPDATE_XXX_TEST('GROSS2')
    ERROR at line 2:
    ORA-00904: "XXKN_TEST"."UPDATE_XXX_TEST": invalid identifier
    APP-ALR-04020: Oracle Alert was unable to execute "&VALUE". Check that this file exists and that its read protection is set correctly.
    Many thanks for your help,
    Alois

    Hello Suresh,
    I tried your suggestion but it doesn't work.
    The PL/SQL procedure was successfully completed but no data was modified.
    Are you sure that running a PL/SQL is possible in an alert action?
    Kind Regards,
    Alois

  • Patterns to execute a SQL Statement from a Droplet (select)

    Hi,
    I need to perform a query on a table, Example: select * from ARF_QUERY "the database used is Oracle. I would like to know if the atg has some
    standard method to perform this database connection and execute the SQL statement from a Droplet (select).
    Thank.

    I dont think there is any generic droplet to run a select query directly against a table.
    However, there are various lookup droplets available that run on the repositories.
    Like /atg/targeting/RepositoryLookup droplet. you can run it for specific id or for all.
    You might want to have a look at it in documentation of how exactly to use it.
    Thanks

  • Extracting SQL statement from a Webi document's data provider using SDK.

    Hi all,
    Is it possible to extract the SQL statement from an existing Webi document's data provider using BO SDK?  I've searched through the class library but haven't found any information on this yet.  If you have done it, could you provide some guidance.  Many thanks.

    I found the following Java code that might be of some help to you. I realize you are using .NET but this might push you down the right path.
    The trick here is to use the Report Engine SDK to get the DataProvider of the DocumentInstance. Then, look at the SQLDataProvider to get your SQLContainer.
    My apologies for the poor formatting. This didn't copy and paste over to the forums very well. I've cleaned up as much as I could.
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
    <%@ page import="com.businessobjects.rebean.wi.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession oEnterpriseSession = null;
    String username = "username";
    String password = "password";
    String cmsname  = "cms_name";
    String authenticationType = "secEnterprise";
    try
    //Log in. oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
    if (oEnterpriseSession == null)
    out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
    else
    {  loginSuccessful = true;
    catch (SDKException sdkEx)
    { out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");}
    if (loginSuccessful) { IInfoObject oInfoObject = null;
    String docname = "WebI document name";
    //Grab the InfoStore from the httpsession IInfoStore oInfoStore = (IInfoStore) oEnterpriseSession.getService("", "InfoStore");  //Query for the report object in the CMS.  See the Developer Reference guide for more information the query language.   String query = "SELECT TOP 1 * " +        "FROM CI_INFOOBJECTS " +        "WHERE SI_INSTANCE = 0 And SI_Kind = 'Webi' " +        "AND SI_NAME='" + docname + "'";
    IInfoObjects oInfoObjects = (IInfoObjects) oInfoStore.query(query);
    if (oInfoObjects.size() > 0)
    //Retrieve the latest instance of the report  oInfoObject = (IInfoObject) oInfoObjects.get(0);
      // Initialize the Report Engine  ReportEngines oReportEngines = (ReportEngines)
    oEnterpriseSession.getService("ReportEngines"); 
    ReportEngine oReportEngine = (ReportEngine) oReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
      // Openning the document  DocumentInstance oDocumentInstance = oReportEngine.openDocument(oInfoObject.getID());   
    DataProvider oDataProvider = null; 
    SQLDataProvider oSQLDataProvider = null; 
    SQLContainer oSQLContainer_root = null; 
    SQLNode oSQLNode = null;
    SQLSelectStatement oSQLSelectStatement = null; 
    String sqlStatement = null;
      out.print("<TABLE BORDER=1>");
    for (int i=0; i<oDocumentInstance.getDataProviders().getCount(); i++)
    oDataProvider = oDocumentInstance.getDataProviders().getItem(i);
      out.print("<TR><TD COLSPAN=2 BGCOLOR=KHAKI>Data Provider Name: " + oDataProvider.getName() + "</TD></TR>");
       if (oDataProvider instanceof SQLDataProvider)
    oSQLDataProvider = (SQLDataProvider) oDataProvider;
        oSQLContainer_root = oSQLDataProvider.getSQLContainer();
        if (oSQLContainer_root != null)
    for (int j=0; j<oSQLContainer_root.getChildCount(); j++)
    oSQLNode = (SQLNode) oSQLContainer_root.getChildAt(j);
          oSQLSelectStatement = (SQLSelectStatement) oSQLNode;             
    sqlStatement = oSQLSelectStatement.getSQL();     
    out.print("<TR><TD>" + (j+1) + "</TD><TD>" + sqlStatement + "</TD></TR>");   
    else
    out.print("<TR><TD COLSPAN=2>Data Provider is not a SQLDataProvider.  SQL Statement can not be retrieved.</TD></TR>");   }  }  out.print("</TABLE>");
      oDocumentInstance.closeDocument(); }
    oEnterpriseSession.logoff();}%>

  • How to isolate the Sql Statement from Java Code

    Hi
    I Need to know that can we segregate the Sql Statements and convert them to Stored Procedures so as to isolate the Sql statements from Java Code.
    So i have one static web page which uses four select Statements so what i want is to create a stored procedure encapsulating these queries. So that the Java Web Developer will simply call the Stored Procedure instead of using four different SQL Statements.
    Suppose the developer has these four Statements
    Select ename,empno,sal,job from emp;
    select empno,ename,mgr from emp;
    select deptno,dname from dept;
    select emp.ename,emp.empno,emp.deptno,dept,dname fromemp,dept;
    So can i encapsulate these four Sql Statements in one Procedure and the Web developer can call the Store procedure and dont need to write the Sql Statements in his code.
    Can Anybody guide me how to write this Stored type of Store procedure.
    Thanks

    http://www.google.com/search?q=java+windows+registry
    Next time, search yourself. It might be beyond your belief, but you're really, really not the first person to wonder about this.

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • Copy records: is there a simpler sql statement

    For each record in one table "msTab" of a MS Sql Server database, I need basically to insert a new record to another one table "oraTab" in Oracle.
    I want to do this via codes to meet other requirements. I use Java with jdbc.
    It looks like a sql statement (built using codes) must look like:
    "Insert into oraTab(field1, field2, field3) values ('XXX', TO_DATE('13-NOV-92','DD-MON-YY', 322)"
    If my codes find the date data in msTab being null I thought I need to build insert statement as:
    "Insert into oraTab(field1, field3) values ('XXX', 322)", in order that Oracle will insert the default value for field2 automatically (field 2 of oraTab does not allow null).
    The logic is not as complicated if there are only 3 fields. But for a table with over a hundred fields, the codes to achieve this is not quite simple. Do I miss some simpler sql statement to do the job?
    Thanks.

    I believe Satish's suggestion was to use the DEFAULT keyword in the insert
    INSERT INTO table_name( col1, col2, col3 )
      VALUES( 1, DEFAULT, 2 );will insert the default value for col2. If you don't know which columns should take on the default value, though, I'm not sure how practical that would be.
    Were it me, I'd probably create a BEFORE INSERT trigger that replaced NULL values with appropriate default values and then just do
    INSERT INTO oracleTable( column_list )
      SELECT column_list
        FROM sqlTable@databaseLinkJustin

  • How could I extract past executed SQL statement from dictionary ?

    We use oracle11gR2 on win2008R2.
    How could I extract the past executed SQL statement from dictionary ? (Is it possible from V$SQLTEXT or other dictionary table ?)

    IvicaArsov wrote:
    Hi,
    You can find executed SQL in V$SQLAREA view (if it's still in memory). If it does'n't exist and you have AWR enabled you can query DBA_HIST_SQLTEXT table, but remember that the statistic information in AWR tables is filtered (1 out of 10).
    I.Arsov
    As you know when taking snapshot oracle will capture only top sql statements and stored in AWR.
    But can you please link(source) dba_hist_sqltext contain only 1 out of 10 filtered data?. In dba_hist_active_sess_history yes it contain 1 out of 10 sampled data.

  • Building up dymanic SQL statement from user entered fields on a jsp

    Hi guys.
    I'm building up a sql statement from a bunch of input fields that the users can type in on a .jsp page. No real problem there, but I get a problem when they type in words with ' character in it Eg: Don't, I'll etc.
    This confuses the java code totally and usually results in a spectacular crash of the system.
    Any ideas/thought/wild speculations would be most appreciated.
    Regards
    Elmar Matthee
    University of Stellenbosch
    South Africa

    Even in pure read-only databases SQL injection can be a problem, as the user might be able to read data he should not be able to see.
    You can also create dynamically created sql statements using PreparedStatements, that's not a problem, I'm doing it pretty often myself.
    List<Object> arguments = new ArrayList<Object>();
    StringBuilder sql = new StringBuilder("SELECT foo FROM bar WHERE");
    if (someCondition) {
      sql.append(" foobar = ? ");
      arguments.add(someValue);
      if (someOtherCondition) {
        sql.append(" AND barfoo = ?");
        arguments.add(someOtherValue);
    // later on use setObject() to fill in the parametersObviously you'll have to handle putting the correct ANDs and ORs there, but you probably has solved that already, as it isn't any different if you don't use a PreparedStatement.

  • Getting SQL statement from OCIStmt

    Is there a way to retrieve the SQL statement from OCIStmt structure? That is, does anyone know what this structure is? For example, if used OCIPrepareStmt, then bound all the variables to OCIStmt, can I tell from OCIStmt what the final SQL statement is? What about the statement string that was originally passed to OCIPrepareStmt()?
    Thanks!
    Igor

    Hey! Thanks for your time!
    use preparedStatements.I'm trying that
    Then use a wrapper class called
    [url=http://www.javaworld.com/javaworld/jw-01-2002/jw-0
    25-overpower.html]debuggableStatement. You willget the SQL that the driver is using.
    Is that only for Debugging or can i use that in live code?
    Thanks again,
    Ryan

  • SQL statement from ST05

    Hi All,
    Please let me know how to retrieve the SQL statement from ST05 output or how to know what is the field
    browsed and what was the input in SE16 from ST05.
    Thank you.
    With Regards,
    Gandhi Subramani

    Hi,
    Go to ST05.
    (1)- Activate Trace.
    (2)- Run the desired T-Code for which you want to do the SQl Trace.
    (3)- Go to "ST05" and deactivate Trace.
    (4)- Then Press Display Trace.
    (5)- Then POP will come. Just press Execute.
    (6)- Your SQL trace will be displayed, with the table names and the Field names and the logic which is retevering data from specific table.
    Thanks
    Saurabh

  • Workspace to parse SQL statements from multiple database schema's

    Hi ,
    When go through the following link of workspace admin user :
    Home>HTML DB Workspace Administration>Manage Services>Schema Reports>Workspace Schemas there I saw "Your workspace has the privilege to parse SQL statements using the following database schemas. Note that the terms database schema and database user can be used interchangeably.
    " at the right pane.
    So how can i make my workspace to parse SQL statements from multiple database schema's ?That must be listed there .But i have only one schema in view ? Can i make it multiple ?If then How ?
    Anybody have an idea ?
    ROSY

    Assign as many schemas to your workspace as you want using the administration app. Read about it in the doc.
    Scott

Maybe you are looking for

  • Sender FTP Adapter, text mode should convert source file?

    Hi ! We have a Unix file system where systems and people drop files to be captured by XI. XI runs also on another Unix system. We configured the Sender FTP comm channel from XI to use the TEXT mode, to have converted the captured file to Unix TEXT (e

  • Project administration & system role

    Dear All, we are working with SAP ecc 6.0 implementation project . We r having solution manager 4.0. Our development system is having clients 220 as golden client, 230 the development client and 200 client is used as sandbox. The development team is

  • Help with using Program unit.

    How do I use a program unit. I am creating a procedure trying to understand how to use it. I added 2 parameters to the layout. :P1_TEST and :P2_TEST I created a simple program unit to place information into them procedure test is begin :P1_TEST := 'Y

  • InDesign CS3 crashes when importing multiple files.

    I've got a new box that's been running pretty solid for several weeks now. It's Win 7 with 8 gigs. Just last night it starts crashing when I'm importing multiple files. Doesn't matter if it's JPGs, TIFFs, or PDFs. I can import all the same files one

  • Zen Neeon Freezing Prob

    Hi When using my Zen Neeon Creative and scrolling through songs that are playing it sometimes freezes and I can't even turn it off. I have to reset the player. Does anyone know what causes it to freeze? Thanks fraggle_20