Changing database credentials of action block SQL Query

Hi,
       I have created a SQL Query with command mode for inserting data in database. But I would like to change the database credentials of this SQL Query dynamically. How can I do this? I have seen one property of this action block as Connector. What is format of the value it expects. Can any one help me on this?
Thanks
Shaji

Can you please specify exactly what you're trying to do?
You mention credentials in your subject line and earlier post, which to me would indicate that you might want your query activity to be done on behalf of the logged in user?  This was an option in 11.5 (no idea how often it was used, or what 12.0/12.1 do since the documentation is void of the setting) http://help.sap.com/saphelp_xmii115/helpdata/en/Connectors/IDBCConnector.htm#Capabilities 
You would have to formulate an /XMII/Illuminator?QueryTemplate=xxx/yyyy type query to include these properties, since they are not applet or template parameters they won't show up in the link editor.
The User / Pwd properties you see are not for this - they are leftovers from older versions for authenticating applets.

Similar Messages

  • CHANGE THE LEVEL NUMBER IN AN SQL QUERY

    Hi
    I've this query:
    SELECT LEVEL,LPAD(' ',(LEVEL+1)*5,' ')||ENAME ENAME
    FROM EMP
    START WITH MGR IS NULL
    CONNECT BY PRIOR EMPNO = MGR
    the result is:
    LEVEL ENAME
    1 KING
    2 JONES
    3 SCOTT
    2 FORD
    3 SMITH
    my question is that if i except FORD how can i change the level number to SMITH from 3 to 2.
    for example:
    SELECT LEVEL,LPAD(' ',(LEVEL+1)*5,' ')||ENAME ENAME
    FROM EMP
    WHERE ENAME <> 'FORD'
    START WITH MGR IS NULL
    CONNECT BY PRIOR EMPNO= MGR
    the result is:
    LEVEL ENAME
    1 KING
    2 JONES
    3 SCOTT
    2 SMITH
    regards
    nadia

    Hi,
    If you notice the level of SMITH is 4 in the initial query but when you exclude FORD, then SMITH is taking up his level i.e., 3.
    SQL>     SELECT LEVEL lvl, ENAME
      2      FROM EMP
      3      START WITH MGR IS NULL
      4      CONNECT BY PRIOR EMPNO = MGR;
           LVL ENAME
             1 KING
             2 JONES
             3 FORD
    4 SMITH
             2 BLAKE
             3 ALLEN
             3 WARD
             3 MARTIN
             3 TURNER
             3 JAMES
             2 CLARK
             3 MILLER
    12 rows selected.
    SQL> Select decode(ename, 'SMITH', lag_level, lvl) dec_lvl,
      2      ename from (
      3      SELECT rownum rn, LEVEL lvl, lag(level) over (order by level) lag_level, ENAME
      4      FROM EMP
      5      START WITH MGR IS NULL
      6      CONNECT BY PRIOR EMPNO = MGR )
      7      Where ename <> 'FORD'
      8      order by rn;
       DEC_LVL ENAME
             1 KING
             2 JONES
             3 SMITH
             2 BLAKE
             3 ALLEN
             3 WARD
             3 MARTIN
             3 TURNER
             3 JAMES
             2 CLARK
             3 MILLER
    11 rows selected.
    SQL>Regards

  • SQL Query returns values like "---" and "NA"

    Hi
              When I execute a sql query in MII it returns values like "---" and "NA" for empty Char and numeric fields respectively.
    I have checked the database and made sure that these fields does not have any value. This happens only when I run the query through MII. Can any one know how can we get rid of these values?
    Thanks in advance
    Shaji

    Shaji,
    MII sets those values as a default if it discovers null values in a query result. You can change this default behaviour in several ways.
    First, have a look at the document [Setting custom null values in XML|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70628af0-8ec4-2c10-7da2-f451e412dd8f?quicklink=index&overridelayout=true]. Then you may also use SQL functions like [NVL|http://www.techonthenet.com/oracle/functions/nvl.php] to change the value directly in the SQL query. You can also change the value inside the MII BLT to whatever you need.
    Michael

  • Java bean & SQL Query

    Hi;
    I'm facing problem in running my application on different relational databses b'cos i wrote all my queries for Oracle 8i on Win-NT environment.& now i've to deploy the application on the Linux with MS-SQL database.
    How to write sql query in java beans so that it run on all the relational databases without making changes to the query in every bean. OR
    How to get the compatible query for different databases?
    Thanks in advance.

    Hey Kalpesh
    If you have just the Connection process encapsulated in the Bean, then you can use it as a Singleton object.
    Just take a look at the following snippet
    public static getConnection(String db) {
    if (db.equalsIgnoreCase("ORACLE")) {
    if (con != null) {
    return con;
    } else {
    con = DriverManager.getConnection("jdbc:oracle:thin:@"+IP+", " + user + ", " + password);
    } else if (db.equalsIgnoreCase("SQLSERVER")) {
    if (con != null) {
    return con;
    } else {
    con = DriverManager.getConnection(sqlServerDBConnectionString);
    This way you can reduce the number of live connections.
    In the JSP, you can access this bean as:
    <jsp:useBean id="mb" class="MyBean" scope=whatever/>
    Connection con = mb.getConnection("ORACLE");
    or
    Connection con = mb.getConnection("SQLSERVER");
    This way, you can meet your objective.
    Check it out.

  • Show SQL Query

    I've inherited many existing reports.  They all access stored procedures in SQL Server 2000.  As I've been trying to study them, I've noticed a major disconnect between the sproc referenced in Database Expert and the 'Show SQL Query' window.  How can I sync these up?  And how can I modify the sproc call that's referenced within the Show SQL Query?  Using VS .Net, I've even looked at the underlying class file, and cannot find any reference to the actual sproc call.
    Thanks.
    Dave

    Hi David,
    Open the report in Crystal and go to Database | Set Datasournce Location.  You will then be able to logon to your database and select the Stored Procedure you want.  You will be prompted to set the parameters if there are any and chances are you will get a message saying the database has changed and asking if you want to update the report.  Say yes to that and the report should be using the updated Stored Procedure now. 
    Unlike tables, Crystal is calling the Stored Procedure and executing it.  This is why you can't see the code for the query and just the Call. 
    Good luck,
    Brian

  • SQL query in adapter process task

    Hi all,
    I am building a custom connector with its bunch of adapters.
    In one of the adapters, i need an auto increment number and therefore i have built an SQL sequence in the DB. Is there a way to use the tcDataProvider variable mapped to the adapter database reference to execute an sql query and retrieve the number? What other ways may i have to accomplish this task?
    thx in advance

    i've found the jar containing the tcErrorReceiver class. But now i get this exception
    + Thor.API.Exceptions.tcAPIException: Error while getting utility Thor.API.Base.tcUtilityOperationsIntf +
    +     at Thor.API.tcUtilityFactory.getRemoteUtility(tcUtilityFactory.java:433) +
    +     at Thor.API.tcUtilityFactory.getUtility(tcUtilityFactory.java:330) +
    +     at FirstAPITest.main(FirstAPITest.java:46) +
    below is my code.
    +public static void main(String[] args) {+
    +          System.setProperty("XL.HomeDir", "/home/alex/workspace/OIMSignatureClient"); +
    +          System.setProperty("java.security.auth.login.config","/home/alex/workspace/OIMSignatureClient/config/authwl.conf"); +
    +          System.setProperty("java.security.policy","/home/alex/workspace/OIMSignatureClient/config/xl.policy"); +
    +          try{ +
    +               System.out.println("Startup..."); +
    +               System.out.println("Getting configuration..."); +
    +               ConfigurationClient.ComplexSetting config = +
    +                    ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer"); +
    +               System.out.println("Login..."); +
    +               Hashtable env = config.getAllSettings(); +
    +               tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","Technology0"); +
    +               System.out.println("Getting utility interfaces..."); +
    +               tcBaseUtility mBaseUtil = (tcBaseUtility) ioUtilityFactory.getUtility("Thor.API.Base.tcUtilityOperationsIntf"); +
    +               tcDataProvider databaseReference=mBaseUtil.getDataBase(); +
    +               +
    +          }catch (Exception e){ +
    +               e.printStackTrace(); +
    +          } +
    +          System.exit(0); +
    +     } +
    +} +
    any ideas?
    Edited by: Prorad on Dec 17, 2010 6:48 AM

  • Send SQL query or call stored procedure, which is best???

    hello experts!!
    i would like to ask what will be the best implementation on querying a database using Java, send a SQL query(insert into table values...) or call stored procedure(just pass parameters)?? and also in stored procedure does "autoCommit/rollback" applies/make sense??

    I searched google for this:
    Stored Procedures vs. SQL
    and found this useful link:
    http://www.karlkatzke.com/stored-procedures-vs-sql-calls/
    I thiink you should also read up on other articles based on such google searches
    to get other opinions. Also, read the links provided by that article.
    Personnally, I think stored procedures should be avoided unless there is a definite
    advantage as specified in the above article. Especially not used for CRUD operations.
    Also, no matter where you put the SQL, it should be documented. I've seen too many stored procedures that aren't documented.

  • Need to send success or failure message to BAPI of SQL query action block

    Hi All,
    I need to send success or failure message(i.e. 1 or 0) to BAPI which has been called below sql query action block in transaction
    Here in SAP, i have created on BAPI with one import parameter and one export parameter.
    In the sql query action block, it insert records in the database table. If it fail or success, that message(numeric value 1 or 0) has to send to SAP program through BAPI.
    I have created a SAP ABAP program which sends message to MII Message listener through RFC then in the process rule message it will call transaction, in transaction, sql query will insert records into database table.  if it success or fail, it will pass to BAPI. And i calling that BAPI in the same SAP ABAP Program to show in the output screen.
    Here the issues, i am not getting the value from BAPI which has send by the transaction in MII.
    SAP Jco, I have mapped in conf. links --> BAPI input with sql query sucess
    Thanks,
    Kind Regards,
    Praveen Reddy M

    Dear All,
    I am facing problem regarding completion notifications in Oraclr r12, when user click the upon completion generated notifications it can only be viewd once, second time user cannot view the notifications.
    I have find that fnd_file_temp table store this information and deleted it.
    Plz help me how to view this URL again.
    thanks
    regards,
    Zubyr

  • Problem with SQL Query Action

    Hi,
    I have a problem in using transactions with SQL Querys.
    I developed a TA based an SQL Querys against a MS SQL Server by using the jtds driver.
    After execution of the sql query I iterate through the result data by using the repeater action on the xMII XML results of the query. Using the jtds driver all table and field names are in lower case letters.
    Now I changed the data server to test it with oracle to an oracle database by using the oracle jdbc driver. The database and tables on both Oracle and MS are created with the same sql script.
    The oracle driver returns table and field names in only capital letters. So the created transaction can not be used. Because it for example accesses the node "type" in the XML structure which is fine for jtds. But when oracle is used, the node has the name "TYPE", so the TA tries to use node type but there is only node TYPE that causes the TA to run into an error.
    Anyone has an idea how to avoid / solve this problem?
    Regards
    Timo

    That's exactly what I used as solution now.
    Instead of doing
    "select fieldname from tablename"
    I do now
    "select fieldname as "fieldname" from tablename"
    So both in Oracle and Microsoft SQL Server the returned field names of the query are in lower case letters.
    Thank you for your help.
    Regards Timo

  • SQL Query with MS-Access Database

    Hi,
    I have linked my oracle database with MS-Access via a DB LINK. i can access the data from MS-ACCESS, but i have a problem that when i specify the column name or define a where clause in my query it gives me the error ORA-00904: invalid identfier ..
    This query fetch the data without any problem SELECT * FROM TBLREPORT@M_ACCESS but when i run SELECT EMP_ID FROM TBLREPORT@M_ACCESS it gives me the error i mentioned above. (Column name have No problem or mistake of spelling even CASE)
    also when i try to put where clause in the query it gives me same error SELECT * FROM TBLREPORT@M_ACCESS WHERE EMP_ID = '100' (Error)
    is there any change in SQL query for ACCESS database ??
    any clue
    Regards
    Rehman

    Are column/table names in access case sensitive? Issue
    DESC TBLREPORT@M_ACCESS If column EMP_ID actual name shows up in mixed/lower case, enclose it in double quotes and use the exact case. E.g., if column name shows up as Emp_Id, use:
    SELECT "Emp_Id" FROM TBLREPORT@M_ACCESSSY.

  • Update Field On Change For A SQL Query (updateable report)

    Hi,
    I'd like to request help from anyone with ideas on how to solve this.
    We are using APEX 4.2, 10GR2, RedHat5.
    I have a report that comes from SQL Query (updateable report).
    I'm using the apex_item.text and apex_item.hidden on fields.
    I'm using a button to submit and after submit process to add some logic that I need.
    There could be 1 - 10 records in the report.
    There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
    I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
    This is the question
    When the value of that field is changed then the value of another field in the same row changes immediately.
    Is this possible?
    All the examples I've seen so far are for a single record and that doesn't work for us.
    I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
    Could anyone direct me to where I can see an example or help me get directions?
    I appreciate all your help an comments and I thank you in advance.

    Yes why not...what you looking for is a ajax call
    See {message:id=10390979}
    Please note:-you can also do this as a dynamic action as shown below
    Event: Change
    Selection type: jQuery Selector
    jQuery Selector: input[name="f01"]
    True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this

  • Database - Show SQL Query question..

    Greetings:
        I am helping a co-worker with Crystal. I don't use crystal but I am able to explain the problem. My co worker is currently using crystal reports 8.5. If he pulls a query and the report is generated he can then click on Database menu then click on Show SQL Query. From there he is able to edit, add, remove fields. Now we want to place him on Crystal V10. When he does the same task, instead of being able to edit the Show SQL query he can only view it. Is there a way around this so that he can Edit the sql query in version 10 or did that feature go away in versions 9 and above. Also we are going to Purchase Crystal 2008, is this feature available in 08? Any help would be appreicated..

    Hi there!
    I have the same problem as described above.  I have been asked to figure out what is wrong with one of the reports that used to work when we used MAS 4.05.  We are now on MAS 4.20 with Crystal Reports v.10 and the report fails to run.  I loaded the report into Crystal to see if I could see the problem and I discovered that the report is still trying to access a table from the old MAS database.  The SQL code as shown in the Show SQL Query window is as follows:
    SELECT "AR_InvoiceHistoryHeader"."InvoiceNo", "AR_InvoiceHistoryDetail"."ItemCodeDesc", "AR_InvoiceHistoryDetail"."ItemCode", "AR_InvoiceHistoryDetail"."ExtensionAmt"
    FROM   "AR_InvoiceHistoryHeader" "AR_InvoiceHistoryHeader", "AR_InvoiceHistoryDetail" "AR_InvoiceHistoryDetail"   
    WHERE  "AR_InvoiceHistoryHeader"."InvoiceNo"="AR_InvoiceHistoryDetail"."InvoiceNo" AND "AR_InvoiceHistoryHeader"."HeaderSeqNo"="AR_InvoiceHistoryDetail"."HeaderSeqNo" AND "AR_InvoiceHistoryHeader"."CommissionAmt"="AR_InvoiceHistoryDetail"."CommissionAmt" AND      ARO_InvHistoryDetail."SOItemNumber" <> 'COMMENT' AND      ARN_InvHistoryHeader."InvoiceDate" = {d '2007-09-21'}  
    ORDER BY "AR_InvoiceHistoryHeader"."InvoiceNo"
    The problem is that ARN_InvHistoryHeader needs to be AR_InvoiceHistoryHeader and SOItemNumber needs to be ItemCode.
    When I go into the Database Expert, I can only see the tables in the FROM clause.  I don't know how to modify the WHERE clause.  It kind of looks like this report was only partially converted to the new version.  Is there a way to changed these attributes without rebuilding the whole report?
    By the way, I apologize for not setting my SQL off in a code box, but I tried that and it caused the page to be very wide with no horizontal scroll bar.
    Edited by: Jason Schill on Oct 27, 2008 11:30 PM

  • SQL Query Works in MS SQL Server 2008 but not when using Database Toolkit

    I have this SQL query:
    DECLARE @DataTypeTable TABLE (
    Name varchar(128),
    TypeID INT)
    --Add comma delimeted data type names to temp table
    INSERT INTO @DataTypeTable (Name)
    SELECT * FROM WhatWeShouldDoRead.func_Split(@DataTypeTrimmed,',')
    SELECT Name FROM @DataTypeTable
    Which takes a comma delimited string and returns the string as a table.  It works correctly in Microsoft SQL Server Management Studio.  When I run this as a stored procedure  I get back nothing.  There are no errors, SQL or otherwise.  I've verified that I am connected to the correct database and that the stored procedure is loaded by changing the no error string that is reported from this stored procedure (that code is not shown in the above example).  Has anyone seen this problem before, or have any experiance with SQL/Labview interfaces to tell me what I'm doing wrong?
    Thanks in advance. 
    Solved!
    Go to Solution.

    After doing some more research it appears that the database toolkit cannot interface with any table results from any type of temp table.  It may have to do with the fact that MS SQL 2008 stores temp tables in a seperate database (tempdb) and not the database you are currently connected to.  See this link for a good artical on temp tables:
    http://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html
    If possible,  I'd like a someone to prove me wrong, but for now will have to settle for exporting the contents of a temp table through a string.

  • Executing SQL query in portal database

    Hi ,
       I wish to do a simple POC . I need to create a table from NWDS , populate it with some data and then access the table data using an sql query . I am aware how to create a table but I am not sure where exactly to write the query .
    What I would like to understand is
    1) If I create a table where would that table get created (The database) ?
    2) Where would I write that query in NWDS ?
    3) How would I execute that query in that database ?
    Please help for the same .
    (Needless to say that I always award points )
    Regards
    Deepak Singh

    Hi Gopal ,
       Thanks for the reply .This is what I did . I am pasting the whole code of the class that I am using to do the POC .
    package com.gravity;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    /*import sun.jdbc.odbc.ee.DataSource;/
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataHandling {
    public static void DataPost(){
         Connection con = null ;
         try {
    Added code
            Hashtable env = new Hashtable();
              env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              System.out.println("initial_context_factory put ");
              env.put(javax.naming.Context.PROVIDER_URL, "gms29:50004");
              System.out.println("provide_url put ");
              env.put(javax.naming.Context.SECURITY_PRINCIPAL, "j2ee_admin");
              System.out.println("security_principal put ");
              env.put(javax.naming.Context.SECURITY_CREDENTIALS, "gravity");
              env.put("domain", "true");
              env.put("force_remote", "true");
              System.out.println("security_credentials put ");
              InitialContext iCtxt = new InitialContext(env);
              System.out.println("Object made for initial context ");
              DataSource ds = (DataSource) iCtxt.lookup("jdbc/my_db");
              System.out.println("Datasource obtained ");
              try {
                   con = ds.getConnection();
                   Statement stmt = con.createStatement();
                        String query1 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('naveen',125188)";
                        String query2 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('deepak',125189)";
                        String query3 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('rajeev',125190)";
                   stmt.executeUpdate(query1);
                   stmt.executeUpdate(query2);
                   stmt.executeUpdate(query3);
                  }catch (Exception e) {
                   e.printStackTrace();
             }catch (Exception e) {
                    e.printStackTrace();
                                         } finally {
                                            try {
                                            con.close();
                                                }catch (Exception e) {
                                                e.printStackTrace();
    public static void main (String[] args){
         System.out.println("Hello");
         DataPost();
    I have imported all the driver jar files and sapj2eeclient.jar in the classpath .
    Also the drivers found in the path
    172.16.161.11\usr\sap\EP1\DVEBMGS00\j2ee\cluster\server0\bin\ext\com.sap.portal.jdbcdrivers
    have all been added to the classpath .(Not sure if this is required)
    Let me know what you find wrong in my code and in the meanwhile I will try to implement what you suggested .
    Regards
    Deepak Singh

  • Change JDBC select SQL query's where clause at runtime

    Hi,
    I have one JDBC sender channel with Select SQL Query which helps in fetching data from JDE table. We have defined where clause to fetch some particular records i.e. if ABC = NULL then fetch the record.. and then update query is used to turn that flag to "Y" i.e. ABC ="Y" so that next time the channel don't pick the same records again.
    Now the problem is that if we want to fetch some records again whose flag has been set to "Y" we cannot change the select query again and again in the production environment.
    Is there any way to change the select query of the JDBC channel at runtime e.g. Picking up some flat file where the conditions for the particular records to be picked are defined (ID=123) and changing the WHERE clause of select query in the JDBC channel for those records to be picked without using BPM.
    Thank you!
    With regards,
    Simran

    Hi Simran,
    Yes, it is possible with the help of store procedure. In SQL Server there is a IF-Else Conditional block, which you can use inside store procedure. Create a SP with 2 additional parameter something like FlagReadAgain and KeyField. Pass the flag always as True or False. For the Key field pass the record key which you want to read again if you are passing the Flag as True else pass it as 0 or whatever.
    In the procedure check if the value of flag is True -> If yes, Read the entry with key name specified in where part.
    In the else part put the query which you are using for the normal flow.
    IF (FlagReadAgain) = TRUE
    BEGIN
       SELECT EmpName, EmpAddress
       FROM Employee
       WHERE EmpID = 'E001'
    END
    ELSE
       BEGIN
         SELECT EmpName, EmpAddress
         FROM Employee
         WHERE Status = 'N'
       END
    You may also use the approach which Srini mentioned. Create an application to restore any value to intial stage so that it can be picked up by XI when it poll again.
    Choose any approach which you like.
    Regards,
    Jitender Chauhan

Maybe you are looking for