How to run a delete query from JSC

There is a simple way to run this:
delete from some_table where condition
this statement will delete from 0 to n rows, depending on condition.
Regards.

There is a simple way to run this:
delete from some_table where condition
this statement will delete from 0 to n rows,
depending on condition.
If you want to first
select ... from some_table where condition
then delete one or more of those rows, the
"Accessing databases: Performing Inserts, Updates, and Deletes" tutorial has some hints.
If you just want to just execute a statement , such as
any delete or update, then just use standard JDBC.
For example:
// Obtain a connection
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/<CreatorDataSourceName>");
Connection conn = ds.getConnection();
// make and execute the statement
Statement stmt = conn.createStatement();
stmt.execute("delete from xxx where ...");
// find out how many rows were deleted.
int rowsAffected = stmt.getUpdateCount() ;
// Don't forget to close() in a finally clause!!!
conn.close() ;

Similar Messages

  • How to run a BI query from SSM

    HI,
    My client would like to drill down to a BI query where the starting point is a KPI.
    For eg, we have a KPI "Turnover". When we are at kpi detailed level for a specific period, we would like to run a query to have detailed information for turnover (we dont want to use report functionnality of SSM).
    We are using SSM 7.5 and BW queries as data provider.
    Is there a way to achieve this ? (web service ? )
    Thanks in adavnce

    Jacques,
    You cannot run a BI Query from the end user interface of SSM. Your alternatives are to create an associated report inside SSM or use an Associated Link in the KPI Details section.
    Right above the graphing on the KPI detail page there is the link Create Associated Report. SSM has some template reports and allows users to put together a report based on available SSM data.
    There is also the possibility of using Associated Links on the KPI detail page to point the user via a url to another reporting application, though it would not bring that data with it.
    Regards,
    Bob

  • How to run a sql query from a button in apex 3.0

    Hi,
    I am brand new and went through/installed the obe project tracker. I have need to create a simple application that displays a result (2 fields, name and license number) based on two parameters (dob and login id) which all are stored in 1 table in the database. I could this very simply in VB or VB.net but have no idea how to do it in apex.
    Please provide guidance,
    Thank you,
    Tom

    Hi Tom,
    Sounds like a report region will satisfy your requirements.
    Create a new report region on one of your pages.
    Choose SQL Report and give the region a title.
    When you get to the "Enter SQL Query or PL/SQL function returning a SQL Query:" step, type:
    SELECT name, license_number
    FROM   <insert_your_table_name_here>
    WHERE  dob = :P<n>_dob
    AND    login_id = :P<n>loginid(replace <n> with the page number that the region is on and use your own table name).
    Don't try to run the page yet - it will give 'No data found'
    Now, go back to the Page Definition screen and add two items in the region you just created - call them P<n>dob and P<n>login_id
    Then, create a button in the same region (to be displayed amongst the region's items) - call it P<n>_GO and click 'Create' (take all the other defaults).
    Now you can run the page, put some values into the fields and click go.
    If you want to get fancier, you can change the text items to select lists etc. - let us know if you need help with that.
    Hope this helps,
    Bryan.

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • How can I execute a query from a BSP application?

    How can I execute a query from a BSP application?
    I´m trying to execute a Query from intranet. I´ve been looking for examples, but the templates I´ve found doesn´t help me.
    does anybody has an example?
    Thanks.

    Hi
    Have you designed the BSP application ?
    design it first with one page
    page will have layout and Event handlers
    Design the layout with the fields
    in the event handler there are events
    in the event On Initiailization or ON inputprocessing write the select query similar to what we write in routine ABAp and fetch the data into ITAB and that has to be passed to the Layout
    see the doc
    BSP
    To learn how to create Web applications with Business Server Pages, you can work through the simple tutorials that build on each other. You should be able to run through all of the steps described here in your own system.
    If you want to develop Web applications with BSPs, your system must meet the following requirements: Prerequisites for Creating Web Applications.
    The following tutorials are available:
    · First Tutorial: First Steps with Business Server Pages…
    · Second tutorial: A Small BSP Application and A Small BSP Application with HTMLB
    · Third tutorial: Our First Online Bookshop
    · Fourth tutorial: Further Developing the Bookshop
    · A small Tutorial is also available for your first steps with the Model View Controller design pattern.
    · For a more complex MVC tutorial based on the third tutorial, see: Our Little Online Bookshop Using MVC and HTMLB
    When creating BSP applications, note the browser dependencies described in Note 598860.
    steps:
    1) start the transaction RZ10.
    2) now u u have to select Profile name, so select the INSTANCE Profile from the list of options given with the Profile parameter list.U may find multiple instance profile in the list, so select the profile in which ur server name is given.
    3) u will also find three options in the same window.
    Administrator data, Basic Maintenance, and Extended Maintenance. So select the last one from that.
    4) Now click on change button.
    5) here u will find parameter icm/host_name_full, so now set it as FQDN.
    6) Now copy ur settings with new version number.
    7) Activate that version.
    8) And now please restart ur WAS.
    So this will set ur FQDN, and also don't forget to login using Admin User.
    Now u also check for following service are active in your ICF setting or not,( just start transaction code SICF)
    /default_host/sap/bc/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/bc/bsp/sap/public/bc
    /def ault_host/sap/public/bc
    /default_host/sap/public/bc/ur
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/public/bc
    /defaul t_host/sap/public/bsp/sap/system
    /default_host/sap/public/bsp/sap/htmlb
    if not then activate all.
    check this link
    Read this weblog...
    /people/brian.mckellar/blog/2003/09/25/bsp-in-depth-fully-qualified-domain-names
    http://www.thespot4sap.com/articles/SAP_WAS_Creating_BSP_Apps.asp
    it consists of screen shots also
    Check it.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/101c3a1cf1c54be10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/bb153aab4a0c0ee10000000a114084/frameset.htm
    Regards
    Anji

  • How Can I Restore Deleted Query?

    Hi, gurus.
    Can anybody tell me How Can I Restore Deleted Query?
    Help me plz.

    If it has only been deleted from the role and not the object completely then it could still be found within infoareas in Bex, if the object has been deleted completely you could re-transport the query from the development system assuming it was created her in the first instance.
    I'm not sure if you can retrieve the query any other way, i do know there are procedures for workbook retrieval but for querys im not certain.

  • How can I erase deleted items from the hard drive?

    How can I erase deleted files from the hard drive?  Will my machine run faster?

    If you've already deleted the files and emptied the Trash they are already, in effect, erased. At least the disk space they occupied is now available.
    To be able to offer help we need more information about which Mac you have, which OS you are running, how much RAM you have installed, how much hard disk space you have available, etc.
    Go to the Apple Menu>About this Mac - copy and paste the contents of the report here (deleting the serial number of your machine). Once we have that info, I'm sure someone will have some suggestions.

  • How to run a Concurrent Program from the back end?

    Hi,
    How to run a Concurrent Program from the back end?
    Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
    If yes, then Please Give reply how to write the code
    Thanks in Advance,
    Bharathi.S

    This is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
    221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
    235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
    HTH
    Srini

  • How can i recover deleted files from my mac book

    how can i recover deleted files from my mac book

    Check out software like Data Rescue 3 (and you need an external drive to recover to)

  • How to call a BW Query from an ABAP program?

    How to call a BW Query from an ABAP program?

    hi
    check this link
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    hope this helps
    cheers

  • How can i retrieve deleted sms from my iphone

    how can i retrieve deleted sms from my iphone 4s?

    If you backed up your iPhone after the texts were made and before you deleted them you can Restore them in iTunes from your backup.

  • How can I prevent deleted mail from ending up in "All Mail"     and "Archives"?  To my horror, I've emptied these boxes and lost all my mail from all my boxes  (and why do I need to enter this question three times?"

    How can I prevent deleted mail from ending up in "All Mail" and "Archives"? 
    To my horror, I emptied these boxes and lost all my mail from all my boxes .
    All mail also disappeared from my iPad, I suppose because they are "synched"
    (Also, no offense, but why do I need to enter this question multiple times?)
    Thanks for any thoughts.

    I'm having a similar but slightly different problem. My company just migrated to Gmail, and it's saving mail drafts every 30 seconds into my Trash folder.
    I unchecked the "Show in IMAP" preference in the Gmail settings, but my Drafts folder completely disappeared. I went back and checked it and the folder reappeared (with my drafts still in there).
    I like the idea if starting an email on my laptop and having the option of finishing it on my iPhone or iPad, so only saving Drafts locally would not be ideal.

  • How do you permanently delete apps from all your mac products (MacBook Pro, iPad, iPhone), how do you permanently delete apps from all your mac products (MacBook Pro, iPad, iPhone)

    how do you permanently delete apps from all your mac products (MacBook Pro, iPad, iPhone)

    They are not taking up storage space.  Apple knows you installed them at one time (="purchased", whether you paid money or not), and merely keeps a list so that if you wish to reinstall any of them on this or a future device, you can.  This is useful if maybe you deleted them due to space constraints, and now have a device with more memory and wish to reinstall.
    It's also useful for taking a trip down Memory Lane looking at all the useless apps you installed once then immediately deleted once you realized they were total garbage ...

  • How do you get deleted data from the app Tote M'Notes back on iPad ????

    How do I get deleted data from app Tote M'Notes back???...Not displaying in my notebook anymore...also how do i retrieve data from apps stored in Icloud?

    Why don't you use the fully-qualified-domain-name (FQDN) of your GW and perform a re-direct to this ?
    This should be known (and everytime the same), addtionally you won't have any problems if there's any load balancer in between or in fron of the GWs.
    Secondly you'll have problems to get the IP -address if there's any proxy server involved.
    /ulf

  • How to restore a deleted file from the iCloud

    How to restore a deleted file from the iCloud

    first you right click on the ipad (on the left in itunes): restore from backup.
    It will restore to factory ALL data anda apps
    At some point it will offer restoration from itunes, but you will only see backups made on your computer.
    If you wish to restore from icloud you forget itunes on your computer, go to the ipad and follow the instructions. At some point you will be asked to choose from icolud or confgiure it as a new ipad.
    it works

Maybe you are looking for

  • Is it possible to restore a datafile after opening the db using resetlogs?

    Hi Experts, We have cloned the db and after opening the db with resetlog option we came to know that one of the user db file is not part of the db and is showing the below error while checking the status and attempting to online it. When checking the

  • TS3960 Unable to connect to Lion Server with Server App or Server Admin

    I'm running 10.7.4 on my Mac Mini and my iMac.  I administer my Mac Mini server from my iMac.  I am unable to connect using fully qualified domain name. Even after checking the items in this article.  I am able to connect if I use the internal networ

  • Primary and Standby Database on different versions

    Dear Friends, We have a situation now where we have successfully completed the oracle upgrade of primary database to 10.2.0.4 but could not proceed further with the physical standby database. Can we have standby database in its current version (9.2.0

  • Virtual Private Database - VPD

    I have been trying to enforce security policies through oracle's fine grained access control (DBMS_RLS). When trying to access object the error ORA-28112: Fail to execute policy function received, but I can see predicate value generated by secure_per

  • Conversion of ArrayList to Resultset Back...

    hey, Is there anyway i can create ResultSet From ArrayList ..where my Hibernate will returns me the arraylist ..i just want to convert that one to ResultSet for japserreports..is there anyway plz help me?