How to execute SQL queris in BPEL using JDeveloper?????..Please suggest

Hi,
I am very new to JDeveloper. Curently i am tryin to execute an SQL query from the BPEL process, there is an query in the source field and the output of the query is to be mapped to a variable field in the target xsd file. the query is fairly simple, like
SELECT emp
FROM emp_table
WHERE emp_id=123
The target field, namely "employee", is an element from the xsd file. I tried using Java embedding activity to connect to the db and execute the query through a piece of Java code, but couldn't find a way to assign the output of the query to the associated target field. however lately i also discovered the Database Adapter services which helps me to create a database connection, but still i am not sure as of how to handle and map the output of the query to the variable field. Is there any other way to execute database queries in Jdeveloper using BPEL process????????? Please suggest.
Can somebody please help me in resolving the issue either through Java Embed activity or Database Adapter services??
Thanks in advance
Prabha

http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm
maybe this one is helpful for you.
best is to use the db adapter for this.
if you just execute it you will see the format of the output in your audittrial (so some kind of list of employees). In bpel when you doubleclick the invoke-activity you will see the outputvariable.
With use of xpath you coud loop over this 'list' (collection/array/etc) of employees and do with it whatever you want.
Too see how you need to loop over the array you could check this :
http://clemensblog.blogspot.com/2006/03/bpel-looping-over-arrays-collections.html

Similar Messages

  • How to execute SQL Quiries in BPEL using JDeveloper

    Hi All,
    I am very new user of Oracle JDeveloper and BPEL. I am trying to develop a process flow in JDeveloper using BPEL and get stuck when I was trying to execute a SQL quiry in the flow.
    How to execute SQL quiries using JDeveloper and BPEL?????????????
    Possibilities might be..
    1.Configring Database Adapter
    2.Using Java Embedded activities of BPEL
    However, any of the above mentioned way is not clear with me how to implement it to get the query run in the process flow.
    It will be great if anyone could hepl me with this concept....
    Thanks in advance
    -Prabha

    ... or perhaps just scan the last 5 posts before you post a new thread, in which case, you'd discover that someone else already asked Help needed in executing SQL query... and got the same answer

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Information on how to run SQL queries on the CUCM itself please

    Good Day All,
    I need to run an sql query on the CUCM to list all of my directory numbers, their partition, and their external mask values.
    I came across this excerpt below earlier so I have a bit of an idea how to do it but iw would be great to see some other examples of sql queries.
    Any assistance is most appreciated.
    Also, is there a document somewhere to tell me how to run these queries?
    Thanks in advance
    Regards
    Amanda
    Currently Being Moderated
    05/04/2011 5:18 AM (in response to Joshua Royle)
    Re: Is there a way of pulling a report off CM showing all phones that have diverts on?
    Try if running this SQL query from the CLI helps you, it should list all DN's that have CFA enabled to VM or a DN:
    run sql select dnorpattern,cfadestination,cfavoicemailenabled from CallForwardDynamic c, numplan n where c.fknumplan = n.pkid and (cfadestination != '' or cfavoicemailenabled ='t')

    Hi Amanda
    Basically it's standard SQL, so it wouldn't hurt to google 'informix select statements' and do a little reading to get the basics. There are millions of permutations of queries so it's a matter of understanding the syntax, and then applying that to the database in question. The only difference when running commands from the CLI are that:
    - You prefix the standard informix SQL statement with 'run sql'
    - You don't get any help from CUCM with the syntax, so you might be well advised to use something that understands SQL a little and colorises it as you type, and then paste the resulting commands into the CUCM SSH window. I use a text editor named JEdit, if you create a text file and save it as a file ending in .sql it will highlight your syntax.
    - Other programs are available that do reasonable syntax highlighting (e.q. SquirrelSQL) that are designed for querying the DB directly, but you can't actually query directly against the DB for security reasons. You'd still have to copy/paste the commands.
    Now... to understand the DB you'll need a reference describing all the tables etc. This is here:
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_reference_guides_list.html
    Pick your version of CUCM and download the 'Data Definition' document.
    A few notes on the command:
    run sql : is just the CLI command that tells the shell to run the following text as SQL.
    select : the SQL command to retrieve data
    dnorpattern,cfadestination,cfavoicemailenabled : the column names to retrieve
    callforwarddynamic c, numplan n : the names of two tables, and the abbreviations you want to refer to them as
    where c.fknumplan = n.pkid : this tells SQL to return values from the two tables where these fields match up. In the data definition you'll see notes that c.fknumplan (i.e. the fknumplan column in the callforwarddynamic table, as noted by the c. prefix) refers to the PKID column in the numplan field. This is a very standard type of join in the CCM DB.
    and (cfadestination != '' or cfavoicemailenabled ='t') : another clause, basically in this query we want to see only rows where cfadestination isn't blank or cfavoicefmailenabled is set to 't' for true).
    Most tables are linked in one of two ways in this database:
    - a column prefixed 'fk' refers to the pkid field (there is always only one pkid field per table) in the table following the 'fk' prefix. E.g. above fknumplan refers to the numplan table, pkid field. fkdevice would refer to the device table, pkid field.
    - a column prefiex 'tk' refers usually to an enum table which is prefixed with 'type'. This is a table that maps the number value in the 'tk' field to a string. An example would be tkmodel - this represents the phone physical model type (e.g. 7962), and maps to a table called typemodel, and the 'enum' column in that table.
    Regards
    Aaron HarrisonPrincipal Engineer at Logicalis UK
    Please rate helpful posts...

  • How to execute SQL through OEM GC, using different OS user?

    Hi all,
    I have a relatively simple issue, and I'm hoping there's a simple fix. This is all being done on ONE server - so on this server, I have OEM 11.1.0.1.0, the agent, and several 11.2 databases running. The OEM install is owned by the "oem" OS user, while the databases I'm connecting to are owned by a different OS user "oracle". All normal OEM GC operations are working great, just this one issue I am having.
    Through OEM, I am trying to go in and execute some simple SQL statements against a database. When I do this, I am selecting to "Override Preferred Credentials", and I'm putting in the host and database username/pwds. It all works fine, but only if I specify the OS user that owns the OEM install (oem). If I try to put in the OS user that owns the actual Oracle database install (oracle), then it is failing. It is not giving me any error messages, just a red X under "Execution Status", and when I click on it, it just says "(No results available)". Again, when I change the query so that the host credentials are the "oem" user, then it runs fine.
    I am not sure what I need to do, so that it can run the query, but use a different host login? Any thoughts/ideas?
    Thanks!!
    --Brad                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    It may be that when Grid logs in using the preferred credentials you've specified that the environment is not being set properly. When you log in interactively as this other user (the owner of the Oracle RDBMS binaries) do you need to manually set environment variables such as ORACLE_HOME or PATH in order to run sqlplus ? Or are they set in the user's .profile? I am assuming that this is a Linux / UNIX system and not Windows.

  • Please Suggest...How to execute SQL quiries in JDeveloper using BPEL????

    Hi All,
    I am very new user of Oracle JDeveloper and BPEL. I am trying to develop a process flow in JDeveloper using BPEL and get stuck when I was trying to execute a SQL quiry in the flow.
    How to execute SQL quiries using JDeveloper and BPEL?????????????
    Possibilities might be..
    1.Configring Database Adapter
    2.Using Java Embedded activities of BPEL
    However, any of the above mentioned way is not clear with me how to implement it to get the query run in the process flow.
    It will be great if anyone could help me with this concept....
    Thanks in advance
    -Prabha
    Edited by: user10259700 on Sep 15, 2008 3:48 AM

    Hi,
    though BPEL has its development environment in JDeveloper, it has its own forum
    BPEL
    Frank

  • How to use database control to execute sql queries which change at run time

    Hi all,
    I need to execute sql queries using database controls , where the sql changes
    at run time
    based on some condition. For eg. based on the condition , I can add some where
    condition.
    Eg. sql = select id,name from emp where id = ?.
    based on some condition , I can add the following condition .
    and location = ?.
    Have anybody had this kind of situation.
    thanks,
    sathish

    From the perspective of the database control, you've got two options:
    1) use the sql: keyword to do parameter substitution. Your observation
    about {foo} style sbustitution is correct -- this is like using a
    PreparedStatement. To do substitution into the rest of the SQL
    statement, you can use the {sql: foo} substitution syntax which was
    undocumented in GA but is documented in SP2. Then, you can build up
    the filter clause String yourself in a JPF / JWS / etc and pass it into
    the DB control.
    For example:
    * @jc:sql statement="select * from product {sql: filter}"
    public Product[] getProducts(String filter) throws SQLException;
    This will substitute the String filter directly into the statement that
    is executed. The filter string could be null, "", "WHERE ID=12345", etc.
    2) you can use the DatabaseFilter object to build up a set of custom
    sorts and filters and pass that object into the DB control method.
    There have been other posts here about doing this, look for the subject
    "DatabaseFilter example".
    Hope that helps...
    Eddie
    Dan Hayes wrote:
    "Sathish Venkatesan" <[email protected]> wrote:
    Hi Maruthi,
    The parameter substituion , I guess is used like setting the values for
    prepared
    statements.
    What I'm trying to do , is change the sql at run time based on some condition.
    For example ,
    consider the following query :
    select col1,col2 from table t where t.col3 > 1
    At run time , based on some condition , I need to add one more and condition.
    i.e. select col1,col2 from table t where t.col3 > 1 and t.col4 < 10.
    This MAY not address your issue but if you are trying to add "optional" parameters
    you may try including ALL the possible parameters in the SQL but send in null
    for those params that you don't want to filter on in any particular case. Then,
    if you word your query
    as follows:
    select col1, col2 from table t where t.col3 > 1 and (t.col4 = {col4param} or
    {col4param} is null) and (t.col5 = {col5param} or {col5param} is null) ...
    you will get "dynamic" filters. In other words, col4 and col5 will only be
    filtered if you send in non-null parameters for those arguments.
    I have not tried this in a WL Workshop database control but I've used
    this strategy dozens of times in stored procedures or jdbc prepared statements.
    Good luck,
    Dan

  • How to execute SQL Query in Code behind Using infopath 2010?

    Hi,
    I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
    Thanks In Advance
    Shoeb Ahmad

    Hello,
    You first need to add new SQL DB connection then you need execute connection from code behind.
    See below link to create new connection
    http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
    http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
    Then use below code to execute this connection:
    AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
    string origCommand = Select * from tablename;
    conn.Command = origCommand;
    conn.Execute();
    Finally bind your table:
    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
    http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to execute multiple queries in one stored procedure.

    Hi,
    I am Kumar,
    How to execute multiple queries in one stored procedure.
    here is the my requirements,
    1. get the max value from one table and sum of the that value.
    2. insert the values and also sum of the max value.
    using stored procedure
    I am using SQL server 2000 database.
    Please help me.
    Advance thanks
    by,
    Kumar

    This is not a java question and it is not even a problem: your only problem is
    1) lack of knowledge
    2) lack of interest to find a manual
    But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

  • How to execute sql qurery in st05

    how to execute sql qurery in st05
    thanks in advanced.

    Hi,
    do this....
    1.create a small ABAP/4 program that contains only the select statement. Before proceeding, test it to ensure that it works.
    2.Open that program in the editor so that it is ready and waiting to execute.
    3.Open a new session using the menu path System->Create session.
    4.Run transaction ST05 (enter /nst05-zero-five, not oh-five-in the Command field, or choose the menu path System->Utilities->SQL Trace). The Trace SQL Database Requests screen is displayed.
    5.If the Trace SQL Status Information box reads Trace SQL is switched off, go to step 7.
    6.At this point, the Trace SQL Status Information box contains Trace SQL switched on by, followed by the user id who turned on the trace and the date and time it was started. You must switch it off before you can proceed. If the trace was started within the past hour, it is possible that it is still being used. Contact the indicated user or try again later. If the trace was started hours or days ago, the user probably left it on by mistake and it can be safely turned off. To turn off the trace, press the Trace Off pushbutton. The message in the Trace SQL Status Information box should now read Trace SQL is switched off.
    7.Press the Trace On pushbutton. The Trace SQL Database Requests dialog box is displayed. The DB-Trace for User field should contain your user ID. If your user ID is not in this field, enter it now.
    8.Press the OK button. You are returned to the Trace SQL Database Requests screen and the status information reads Trace SQL switched on by, indicating that you turned on the trace.
    9.Switch back to the window containing your editor session (the one with your program waiting to execute).
    10.Press F8 to run your program. (Only press F8, do not do anything else, do not even press the Back button.)
    11.When your program has run and the hourglass is no longer displayed, switch back to the trace window.
    12.Press the Trace Off pushbutton. The status information reads Trace SQL is switched off.
    13.Press the List Trace pushbutton. The Trace SQL Database Requests dialog box is displayed. The fields on this screen will already contain values.
    14.Press the OK button. You might need to wait a little while, at most a couple of minutes. The Trace SQL: List Database Requests screen is displayed.
    15.Type %sc in the Command field and press the Enter key. The Find dialog box is displayed.
    16.Type the name of the table you are tracing in the Search For field. (This is the table named in the select statement in your ABAP/4 program.)
    17.Press the Find button. A search results list should be displayed with your table name highlighted.
    18.Click on the first highlighted table name. You are returned to the Trace SQL: List Database Requests screen. Your cursor is positioned on the first line containing your table name. To the right of it, in the Operation column, should be the word PREPARE, OPEN, or REOPEN.
    19.Press the Explain SQL button on the Application toolbar. The Show Execution Plan for SQL Statement screen is displayed.
    20.Scroll down to the execution plan. The index used will be displayed in blue.

  • How to execute sql scripts from Powershell across multiple databases

    Re: How to execute sql scripts from Powershell across multiple databases
    I have an tsql script that I want to run across a list of databases. How is the best way to do this in Powershell? Thanks.

    My example below, using just the SMO and not breaking up the batches, the ExecuteWithResults give the following error when the .sql file contains a GO. My script files are as simple as a DECLARE and then a GO.
    WARNING: SQL Script Failed
    The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-list" comm
    and which is conflicting with the default formatting.
        + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperationException
        + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
    Also, when executing from the ISE, is there a way to force the ISE to release the files. I am having to close the ISE and reopen my script every time I want to make a testing change to the .sql file.
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
    $scriptspath = "C:\temp\psExecuteSQLScripts\scripts"
    $SQLServer = "fidevc10"
    $SQLDB = "Bank03"
    # Create SMO Server Object
    $Server = New-Object ('Microsoft.SQLServer.Management.Smo.Server') $SQLServer
    # Get SMO DB Object
    $db = $Server.Databases[$SQLDB]
    # Load All SQL Scripts in Directory
    $scripts = Get-ChildItem -Path (Join-Path $scriptspath "*") -Include "*.sql" -Recurse
    # Loop through each script and execute
    foreach ($SQLScript in $scripts)
    $fullpath = $SQLScript.FullName
    # Read the Script File into Powershell Memory
    $reader = New-Object System.IO.StreamReader($fullpath)
    $script = $reader.ReadToEnd()
    # Execute SQL
    Write-Host "Executing $SQLScript on $SQLDB...."
    try
    $ds = $db.ExecuteWithResults($script)
    Foreach ($t in $ds.Tables)
    Foreach ($r in $t.Rows)
    Foreach ($c in $t.Columns)
    Write-Host $c.ColumnName "=" $r.Item($c)
    Write-Host "Complete"
    catch [Exception]
    Write-Warning "SQL Script Failed"
    echo $_.Exception|format-list -force
    Write-Host " " -BackgroundColor DarkCyan

  • URGENT How may no of queries can be used a datsources in APD

    hi
    could any one pls let me know how many no of queries can be used at once as datsource to load in to transactional ODS in APD CONCEPT
    Regards,
    N

    You can do one (or more) join in the APD which will let you merge data from two previous nodes. This should allow you to get data from two or more queries (as long as you have a logical join condition to connect the data).
    There is nothing like a union though.

  • How to find SQL queries from listerner log

    Hi,
    I have a question related to Oracle listener log. I've tried searching on this forum but couldn't find any threads on this
    Let me give a background on this. There are plenty of MSaccess databases which connect to Oracle database via ODBC link. I need to find out all the data items (Oracle tables / columns) that are referenced in the MS access applications. One way of doing that is open all MS access code components and look out for the ODBC links and extract the data items. This will be time consuming as there are several MS access databases (~450).
    I am wondering is there is way to find the data items from Oracle logs. The only information available to me now is the listener logs. A sample record id given below. Is there any way to obtain the SQL queries that was used from the lister log.
    08-MAR-2007 15:31:30 * (CONNECT_DATA=(SID=opr11a)(CID=(PROGRAM=MSACCESS.EXE)(HOST=PC12111)(USER=andrew.King))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.111.200.2)(PORT=1921)) * establish * opr11a * 0
    Any help in this regard is much appreciated
    Database version - Oracle 8i
    Thanks
    Moorthy
    Edited by: user8879184 on 20-Jul-2010 04:58

    user8879184 wrote:
    I need to find out all the data items (Oracle tables / columns) that are referenced in the MS access applications. I do not understand what you need. You want names of _"Oracle" tables/columns_ which refers MS Access *"Application"* ??

  • How to pass a parameter into execute sql task and later use it into dataflow task?

    i am in a situation, where i have a logging table in which i have a primary key called ETL_log_ID which is an identity column and acts as a foreign key for various fact table and dimension tables which are populated using SSIS packages. Now i wanna use the
    ETL_log_ID as a parameter in the execute sql task which populates the log table and pass the same value in the data flow task which populates the facts and dimension. Can you let me know how to pass the parameter in a step by step procedure.
    Thanks,
    Nikhil
      

    Nikhil,
    You can check the following :
    http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx
    http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis
    Regarding the usage in Dataflow task, Can you elaborate on that a little?
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to execute SQL scripts using OWB Process flows ?

    Hi,
    I have some SQL Scripts. I have to execute them using OWB Process flows.
    Can i get any document or link which helps me in achieving this?
    Thanks in Advance,
    SriGP

    Sutirtha,
    Thank you very much. I really appreciate all of your responses.
    I have one more question ( Sorry for flooding you with lot of questions :) )
    How to capture the errors which occured inside the SQL Scripts.
    My scenario is like this. I have two sql scripts Script_1.sql and Script2.sql namely. I would like to put dependency on the execution of the scripts.
    If Script_1.sql executes succesfully without any errors, then EXECUTE Script_2.sql
    else if Script_1.sql execution contains errors then DON'T EXECUTE Script_2.sql
    As of now, i observed that the Process flow shows Success State even if there is an error in the sql script execution. Because of which i was not able to put dependency on the execution of the scripts.
    I think i can do it by tweaking(changing) the code inside the SQL Scripts, like logging the errors in some log table and reading it before the next script execution.
    But the restriction is, I Should not touch/change the existing SQL Scripts.
    Do we have any mechanism in the ProcessFlows to identify the SQL Errors that occurred during execution of SQL Scripts ?
    Please suggest any idea on this. It will be great if you can help in this.
    Thanks in advance,
    SriGP.

Maybe you are looking for

  • Cannot send email to subdomain

    iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004) libimta.so 5.2 Patch 2 (built 19:30:12, Jul 14 2004) SunOS stud.usm.my 5.9 Generic_117171-17 sun4u sparc SUNW,Sun-Fire-V240 We have a domain xxx.com and a subdomain stud.xxx.com...the first dom

  • Sub-Script  Value in ALV  Report Output

    Hi, Let us take an example Hydrogen - H2, If we print it in this way it won't be meaning full, So i want to display this like H Subscript 2. I have a requirement for a column in an ALV Report. Is it Possible? Please give me an example. Thanks, Sekhar

  • Visual Basic, DAO, Temp tables in stored procedures

    Client code currently uses DAO with SQLPassthrough option in VB to connect to SQl 6.5 db. I migrated all stored procedures with default options except Oracle 8i temp tables. For every procedure a package and a procedure was created. We use SQL server

  • Record inserting twice on insert button trigger

    hi developers, I am designing a simple form whilch contains the datablock in tabluar form and showing the data from the table to which the data block is connected... i have an button INSERT ....when clicking the insert button the record should be ins

  • Ad Hoc Query testing when upgrading to ECC 6.0

    Hi, We have a decentralized SAP HR system. Instead of developing custom ABAP reports, we have given permission to superusers to create their own reports using Ad Hoc Query. This has lead to large number of Ad Hoc Queries  (>2000). Techincally speakin