Query Database - Write to Database

I am querying a SQL DB which has 10 results in total with 15 fields each. The run book will filter out 2 eventually based on some rules.
Once all the activities are complete as per the runbook, I want to write back to the database as 'Complete' under Field called Status
The write works, however it creates a new item completely. I want to update the existing request
Regards, Vik Singh "If this thread answered your question, please click on "Mark as Answer"

So if I understand correctly you are querying a database and based on the response you do some activities and then you want to update the records you queried in order to indicate that the activities have been completed?
If you just want to update the existing records then I would probably just do an Update query based on the primary-key of the record you queried using the "Query Database" activity instead of the "Write to Database" (which always writes
a new record).
Something like: Update [Table Name] set Status = 'Completed' where PrimaryKey = 'xxx'
You will probably need to cut up the Query Result from your first query first in order to get the Primary Key.
Usually I do this by reading Published Data "Full Line as String Seperated by ;" with a PowerShell Script (Run .NET Activity).
For example:
$Query = <Full Line as String >   //Published Data from the Query activity
$All_Records = $Query.Split(";") //this creates an array where every record is a column from the query result
$PrimaryKey = $All_Records[0]  (if the primarykey is found in the first record of the array of course)
Then use that $PrimaryKey value in your new query.

Similar Messages

  • Select query from 2 schema & database

    Hi,
    what privileges should i give to execute select query from 2 schema & database in oracle
    thanks

    Hi,
    not so clear, if you are looking for this
    -- for other schema access
    GRANT SELECT ON <scheman_name>.<table_name> TO <schema_name>;
    or create the synonym
    --for other database access you need to create db link                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem in Execute query on non-database block and database block together

    Hi All,
    In my form,i have
    1. First block is Non-database block with one non-database item.
    2. Second and third blocks are database blocks.
    Now the problem is that i want to perform execute-query for all the blocks.
    If the cursor is on the non-database item of 1st block and i clicks on the "Enter-query" then i am getting message " This function can not be performed here".
    If i click on the item of the database block and then clicks on the "Enter-query" and then "execute-query" it's working fine.
    But i don't want to do in this way.
    My cursor will be on the First block only and then it should perform execute-query.
    I am using this non-database item to copy value of this item to the item of the database block item.
    I think i make you understand about my problem.
    I am using forms 10g on Window xp.
    Please help me.

    Hi!
    Simply create a enter-query trigger on the non-database-block:
    begin
    go_block ( 'database_block' );
    enter_query;
    end;If your search criteria is in the non-database-item in the first block,
    you actually do not need the enter_query build-in.
    Just create a execute-query trigger on the first block like:
    begin
    go_block ( 'database_block' );
    execute_query;
    go_item ( :System.trigger_item );
    end;And in a pre-query trigger on the database-block copy the
    value of your seach item into the item you want to search for.
    Regards

  • Frm-40208 from running in query mode. cannot change database fields

    Hi,
    Could some one help me with this.
    I am calling a form from another form. I am passing the parameter list to the calling form and doing a query by setting the block property. But when queries the message
    FRM-40208 Form running in query mode. cannot change database fields .
    I do not want the message to appear when they go the called form . Please some one could help me how could I avoid displaying the message.
    Regards
    Bain

    Hi,
    Good day! I am working with a module that also calls another form. It uses call_form with query mode parameter set to query_only. My problem is, whenever i call the other form using the call_form, it would display the called module and then as it populates the detail block of the called form, it will display frm-40208 from running in query mode. cannot change database fields per record. What I want is for the message to be displayed only once.
    I have tried capturing the error by using on-error trigger, but it doesn't go to that whenever the other form was being called. I think the message has to do with the post-query trigger, because it passes some values on a dbase block objects.
    Do you have any suggested solutions or workarounds to make the message display only once whenever the other form is being invoked by the call_form?
    I would greatly appreciate any suggestions/ideas.
    Thanks and regards,
    ASantiago

  • Tell me select Query that HITs the database Directly  ???

    Hi,
        I have a table, for this table in the Techinical Setttings I selected Buffering allowed, and buffering type is Full Bufferd.Now, I want a Select Query which hits the database directly, without fetching records from the BUFFER.
    Except using SELECT BYPASSING BUFFER query ????
        Regards,
    V.Raghavender.

    hi,
    ·        Any SELECT with a sub query or with joins
    ·        Any set function (COUNT, MIN, MAX, SUM, AVG)
    ·        GROUP BY
    ·        HAVING
    ·        SELECT DISTINCT
    ·        ORDER BY
    Examples:
    SELECT /*@ SAP BYPASSING BUFFER */ * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ?
    SELECT * FROM MYTAB WHERE KEY1 = ?
    SELECT * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ? OR KEY1 = ?
    SELECT MAX(DATA) FROM MYTAB WHERE KEY1 = ? KEY2 = ?
    SELECT * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ? AND DATA =
       (SELECT DATA FROM MYTAB WHERE KEY1 = ? AND KEY2 = ?)
    if helpful pls award points.
    sri

  • Managed Metadata (Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator)

    When creating a new site column of the managed meta data type in SharePoint2010, and you select "customize your term set", you are presented with one of the following errors:
    - This operation cannot be completed. The term store may be unavailable.
    - Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator

    Hi,
    I have been facing the same issue, however managed to resolve it.
    This is due to the uncommitted statements. From Powershell try running the following script
    #Connect to Central Admin, Replace the url with the environment specific URL
    $taxonomySite = get-SPSite http://centraladmin:40000
    #Connect to Term Store in the Managed Metadata Service Application, Ensure you put the right Metadate service application name
    $taxonomySession = Get-SPTaxonomySession -site $taxonomySite
    $termStore = $taxonomySession.TermStores["Managed Metadata Service"]
    write-host "Connection made with term store -"$termStore.Name
    #Connect to the Group and Term Set
    $termStore.RollbackAll()
    Hope it would help

  • How to open MSWORD using JAVA/JNI and write the database entries into WORD

    Hi..
    I am searching for java codes that uses JAVA NATIVE INTERFACE (JNI) for opening MSWORD 2003.
    To be brief.
    I created HTML form called Employee_data.
    if i click on Submit button a word document should be opened.This should be using JNI.
    I have also created a servlet in jsp to process the form data and store it into database(mysql).;
    Please help me to find the codes to open MSWORD on submit click and to write the database entries into word file.Can i get the full code for that.This is so urgent.
    Thanks in advance.

    Hi Suresh,
    The easest solution I can think of is to copy the math equation from the PowerPoint then paste in the Word document directly, there's actually no way to convert it to plain text, some equation is very complext, String variable is not suitable in this case.
    For example, this code works fine:
    var powerPoint = new Application { WindowState = PpWindowState.ppWindowMinimized };
    var oPresSet = powerPoint.Presentations;
    Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"C:\test.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
    var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
    strObj.Copy();
    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
    wordApp.Visible = true;
    Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
    doc.Range(0, 0).Paste();
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Executing the SQL query across 2 different databases of Oracle

    Hello All,
    In Microsoft SQL server we can execute following type of SQL query across 2 different databases:
    select * from TEST1.dbo.GENERIC_TABLE1 union select * from TEST2.dbo.GENERIC_TABLE2;
    Here TEST1 and TEST2 are 2 different databases.
    Can we do the same in Oracle?

    yes you can, but first one has to setup a database link
    Look up CREATE DATABASE LINK and then take things from there!
    P;

  • Query for  to get  database size, used size, freesize, db size after drop

    Pls give me a query for to get database size, used size, freesize, tablespacesize of sometables which is starting with 'RQ%'
    I have to get result like this
    Total size, used size, free size ,tablespace size of RQ tables alone
    Reason why i go for "tablespace size of RQ tables" i want to know the size of database after deleting the rq tables
    Pls reply
    S

    i tried with
    SELECT
    --fs.tablespace_name name,
    df.totalspace/1024/1024 mbytes,
    (df.totalspace - fs.freespace)/1024/1024 used,
    fs.freespace/1024/1024 free
    FROM
    (SELECT
    --tablespace_name,
    ROUND(SUM(bytes)) TotalSpace
    FROM
    dba_data_files
    ) df,
    (SELECT
    --tablespace_name,
    ROUND(SUM(bytes)) FreeSpace
    FROM
    dba_free_space
    ) fs
    i AM GETTING total bytes, used bytes, free bytes
    I WANT TO include one more column.. database size after deleting rq tables
    Pls reply
    S
    Edited by: AswinGousalya on Jul 10, 2009 2:17 PM

  • How to write from database to XML file using JAVA and back..

    Hi....
    I am strugling for a code to write from database to xml output instead of what i have written in flat file....could anyone please help me out...to do this and again read the same back to the database using java...

    Hi,
    In java world, there is a tutorial on what you are looking for :
    http://www.javaworld.com/javaworld/jw-01-2000/jw-01-dbxml_p.html
    It uses SAX/DOM parsers to translate XML data into the appropriate fields of the database and visa-versa.
    Hope it helps.

  • DMV quesiton. Can not run the DMV query in non system database.

    As the title .I can run following query when I use  'use master' , But don't work at the DB which be created my myself.
    --Error massage
    Msg 208, Level 16, State 1, Line 1
    Invalid object name 'SYS.DM_EXEC_QUERY_STATS'.
    --SQL Version : 2005
    --compatibility level : 90
    --The query
    SELECT TOP 10
    QT.TEXT AS STATEMENT_TEXT,
    QP.QUERY_PLAN,
    QS.TOTAL_WORKER_TIME AS CPU_TIME
    FROM SYS.DM_EXEC_QUERY_STATS QS
    CROSS APPLY SYS.DM_EXEC_SQL_TEXT (QS.SQL_HANDLE) AS QT
    CROSS APPLY SYS.DM_EXEC_QUERY_PLAN (QS.PLAN_HANDLE) AS QP
    ORDER BY TOTAL_WORKER_TIME DESC

    Yes, you can run the query under none system database.... Make sure that  your db is set 90.....
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Run query on all connected databases

    Is there a way to run a query across all the databases that you have connections to using a script.

    Fastest way I can think of is changing the connection in the drop-down list (upper right of the worksheet) between runs.
    Regards,
    K.

  • I Can't Write in Database with firmware 4.3.5 ?

    HI
    I have an Iphone with 4.3.5, and in my app, i write on Database, but with this Iphone dosrn't write.
    i have another iphone with 4.1, and i write on Databse without problems... the code is the Same!
    if i Debug the iphone with 4.3.5, with app.debug, i have the trace with this error:
    3122
    Attempt to write a readonly database.
    and i read:
    Indicates that an operation could not be completed because the database is read only. This can occur if the database file is designated as read only in the operating system, if the database is opened in read-only mode, or if an older version of Adobe AIR accesses a database file created with a newer version of the runtime.
    Please Help Me
    Thank You!

    You've tried what's mentioned on this page : http://support.apple.com/kb/TS3694#error3194 ?

  • Need query for refresh test database.

    Hi,
    I want refresh production database to test database refresh using expdp dumpfile. Please provide steps this is the requirement
    This request is to refresh the Tecnomatix test database MFEM which is
    on the NATEST server wnmcdwtk.natest.gm.com. This database needs to
    be refreshed using an Oracle full backup dump file from the Tecnomatix
    production database MFEP which runs on the production NAENG server
    wnmcdds8.naeng.gm.com. The MFEM and MFEP databases are both at Oracle
    v10.2.0.4.

    Hi,
    You have posted to the wrong section of the forum. This forum us for Berkeley DB.
    Regards,
    Alex Gorrod
    Oracle Berkeley DB

  • Query re-write in Desktop and Plus

    Under Discoverer Desktop, I am getting very good performance for a particular workbook -- Oracle automatically re-writes the query to go after materialized view, rather than after an original huge table.
    But, when I run the exact the same workbook under Discoverer Plus, the query re-write does not happen, and the execution plan is totally different.
    When I extract the query from the workbook and run it directly against database via SQL*Plus, the query re-write does happen and performance is excellent.
    I am using:
    OracleBI Discoverer 10g (9.0.4.00.00)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.48.18)
    Discoverer Model - 10.1.2.48.18
    Discoverer Server - 10.1.2.48.18
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.48.18
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    Are there any Discoverer’s settings that can prevent query re-write under Discoverer Plus?
    Thanks.

    Do you think this might be related to OracleAS?
    This is my current hypothesis, I don't see any other explaination at the moment.
    "Discoverer uses its own rewrite system when any of the following is true:
    1. The database version is less than 8.1.6
    2. The database version is later than 8.1.6 and it is not possible for
    Discoverer to create Materialized Views.
    The point #2 is applicable to my case.
    Marcos, could you please point me to the source of this quotation?
    My query is below:
    SQL> explain plan for
      2  SELECT O100096.LOCAL_DAY,
      3         O100088.NETWORK_ABBREVIATION,
      4         MAX(O102377.IMPRESSIONS_LIVE)
      5  FROM DOMRSCH.DW_NETWORK           O100088,
      6       DOMRSCH.DW_TIME              O100096,
      7       DOMRSCH.TELECAST_DEMO_RATING O102377
      8  WHERE ((O100096.TIME_KEY = O102377.TIME_KEY) AND
      9        (O100088.NETWORK_KEY = O102377.NETWORK_KEY)) AND
    10        (O100096.LOCAL_DAY IN (TO_DATE('20060515000000', 'YYYYMMDDHH24MISS'),
    11         TO_DATE('20060516000000', 'YYYYMMDDHH24MISS'),
    12         TO_DATE('20060522000000', 'YYYYMMDDHH24MISS')))
    13  GROUP BY O100096.LOCAL_DAY,
    14           O100088.NETWORK_ABBREVIATION
    15  ORDER BY MAX(O102377.IMPRESSIONS_LIVE) DESC;
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    Plan hash value: 2592166193
    | Id  | Operation                     | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                         |    23 |   414 |     8  (13)| 00:00:01 |
    |   1 |  SORT ORDER BY                |                         |    23 |   414 |     8  (13)| 00:00:01 |
    |*  2 |   MAT_VIEW REWRITE ACCESS FULL| TELECAST_DEMO_RATING_MW |    23 |   414 |     7   (0)| 00:00

Maybe you are looking for

  • Error while deploying SOA composite

    Hi, I am getting the below error while deploying the SOA composite. Error(45,34): Failed to compile bpel generated classes. failure to compile the generated BPEL classes for BPEL process "ApprovalProcess" of composite "default/ResourceSerialApproval!

  • Download error in CC. Cannot download LR & PS!

    Help! I purchased the $9.99 special for Lightroom & Photoshop. After downloading creative cloud, I tried to download the apps & I keep getting an error message! UGH! HELP HELP HELP, please!

  • Spreadsheet date format in lookout

    The spread sheet object automatically logs the date format as mm / dd / yyyy in the first columb, how can I get it to log the date as dd / mm / yyyy

  • SCCM 2012 R2 & MDT 2013 OSD Refresh - BDEDrive Assigned letter

    Hello, I'm having an issue with my MDT OSD refresh for Win 7 machines. I've capture a Win 7 reference image from a VM using MDT capture TS and I can successfully deploy that image to a bare metal VM using an MDT integrated SCCM TS. The disk partition

  • LOV from db table in ADF?

    Hi, I'm working with ADF in Jdev 9.0.5.1; I like it! Suppose I'm working on a simple .uix file. From the data-control palette, I drag-drop empView1 into the .uix design editor as an input form: http://www.geocities.com/jdevroberto/jdev.png How do I t