How can i use one SQL statement to solve problem?

How can i use one SQL statement to solve the question below?
For a Table named A, there is a column named F(char type).
Now select all the records where F like '%00' and update their F value to '%01'
Just one SQL statement.Do not use PL/SQL block.
How to do that?
Thanks.

What is the data volume for this table?
Do you expect lots of rows to have '%00' as their value?
Following two statements come to mind. Other experts would be able to provide better alternatives:
If you have index on SUBSTR(f, 2):
UPDATE A
SET    f = SUBSTR(f,
                  1,
                  length(f) - 2) || '01'
WHERE  substr(f,
              -2) = '00';If most of the rows have pattern '%00':
UPDATE A
SET    f = SUBSTR(f,
                  1,
                  length(f) - 2) ||
           DECODE(SUBSTR(f,
                         -2),
                  '00',
                  '01',
                  SUBSTR(f,
                         -2));

Similar Messages

  • How can I write a SQL statement which checks if a table exists?

    How can I write a SQL statement which tells me whether a table exists?

    execute an sql query: select * from <tablename>
    catch the exception n check whether the erroe code
    matches the one that occurs for table doesn't exist
    that's itHow is your answer any different from the one given in the first reply?
    It isn't.
    As WorkForFood says DatabaseMetaData has a bunch of methods for getting information about tables but this is more useful when you don't know the names of any of the tables.. it sounds like you do so I would concur SELECT from table is probably the quickest way to go. If it helps the Xopen error should be either S1000 or 42S01 (I think) but I would try and see if there is a specific vendor code for table not found/not exists error and check for that.

  • How can i use one iCloud Photostream on 2 devices?

    Due to a bug (or feature) on iOS 8 i can't use the same icloud id on 2 iphones:
    https://discussions.apple.com/thread/6536998
    So how can i use ONE iCloud Photostream then on 2 devices?
    Also, on OSX i can define only one Photostream.
    So, how do you import pictures from 2 streams into iPhoto?
    Familyshare is not usefull as the pictures are not in Original-Filesize!

    Hi ..
    Yes. " iPhone 6 or 6 Plus.  iPad Air 2  or  iPad mini 3"
    Set up and use Apple Pay

  • HT204053 Dear Support Team, every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud???

    Dear Support Team,
    Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
    Thanks

    It is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • 1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    HI Frostyfrog
    CHeck out iTunes Match which has an annual fee of £21 or thereabouts. You can store a maximum of 25,000 songs there and they all become available on your other kit, iPhone, iPad and iPod. I know it works as I have over 23000 songs uploaded of which only a few we're bought through iTunes.
    it works by comparing your music to the whole iTunes music dadata base so you access the same tunes that you could get from iTunes. If you have obscure stuff, it uploads your own music to the cloud as a copy.
    I Find it incredible that on my iPhone with its 16gb memory I can view almost 200 gb of music (ie my 23000 songs) and play any of them. Anything I add to iTunes becomes available via the cloud fairly quickly from a few minutes or a little longer if adding a lot.
    The first time you use it it will take quite a while to match your music if you have a lot, but after that it is all automatic. Read the stuff on the apple site. Your PC needs to be at least running Vista. I recommend it and at less than 50p a week it's good value.
    Good luck

  • Can you use nested sql statements in jsp??

    HI, I was wondering if you can use nexted sql statements...
    example...
    <%@ page language="java" contentType="text/html" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="forum.DataAccess" %>
    <%
         // Create a new instance of the DataAccess Class
              DataAccess d = new DataAccess();
         // This call the database connection method from the DataAccess Class
              d.ConnectDatabase();
         /* This gets the threads from database for the categories */
              // This is initilzing the variables
                   String threadname = null;
                   int threadid = 0;
              // This sets the sql variable to nothing
                   String sql = "";
                   String sql1 = "";
              // This sets the rs variable to null
                   ResultSet rs = null;
                   ResultSet rs1 = null;
              // This is doing a SELECT on the thread table based on the category id
                   sql += "select * from forum_threads where ft_catid = 2";
                   rs = d.SQLQuery(sql);
         /* End of categories */
         while (rs.next()){
                                       threadid = rs.getInt("ft_threadid");
                                       threadname = rs.getString("ft_threadname");
         sql1 += "select * from forum_messages where fm_catid = 2 and fm_threadid = " + threadid + "";
         rs1 = d.SQLQuery(sql1);
    %>
    THis is the error I get.....
    javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
    I know what that is.. it is because I am trying to open another result set before the first one is closed... but I need that one open cause I need to loop through the ids and run it against the second query??
    Any suggestions...

    I am not positive but it seems from your error message you will not be able to use the nested SQL. Another option would be to store the values of the ResultSet in a Vector (or Array), and then close your ResultSet and loop through the vector or array instead...
    Zac

  • How can I use one photo twice in a slideshow

    I am in iPhoto '11 9.4.3 making a slideshow to send to iDVD for my mother-in-laws funeral next Wednesday.
    How can I use this one particular photo of her several times in the slide show.
    I have tried copy/past and that does not seem to work.
    Thanx in advance

    I would just duplicate the picture several times and keep inserting duplicates ...

  • New to LABVIEW. How can I use one analog channel to trigger acquisiton of a signal on another analog channel?

    I am new to using Labview and have been tasked to write data acqusition program for my company. We are attempting to log 6 machines, each with their own asynchronous trigger (I can't use one trigger for all 6 machines). I have the idea to use (for example) ai0 for the measurement and ai1 for the trigger (for one machine), yet I see nothing in the documentation on how this is done. I have tried playing around with the DAQ express VI (I am using Labview7) but still don't see a way to have the setup I am looking for. I'm sure this is a relatively easy question, but I'm unsure where to go to look for an answer. Any helpful pointers or guidance in the right direction
    would be very helpful!

    If what you want to do is start the acquisition of channel 0 when channel 1 reaches the trigger condition and not start channel 2 until channel 3 reaches it's trigger condition, then no, you cna't do that unless you have multiple daq devices. What can be easily done is continuously acquire all channels and monitor your trigger channels. When the trigger condition is met, then perform the analysis/logging. On the Analyze>Waveform Monitoring palette is the Basic Level Trigger Detection function. Use one for each trigger channel and have it return either the index or relative time of the trigger occurance. This value can then be used to idex that portion of the measurement channel that you're interested in.

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • HT4623 how can i use one i5 in oman which is bought from australia?

    how can I use my i5 in oman which is bought from Australia?

    Hi,
       I put new sim card (omantel -prepaid) but some msgs. is came.( The sim card that you currently have installed in this phone is from a carrier that is not supported under the activation policy that is currently assigned by the activation server. This is not a hardware issue with the I phone.Please insert another SIM card from a supported carrier  or request that this I phone be un locked by your carrier.Please contact Apple for more information ).

  • How can I execute Dynamic SQL statement in Forms?

    Hi All,
    I have to execute dynamic SQL statement from Forms
    Below statement I have to execute
    "EXECUTE IMMEDIATE v_stmt INTO v_return;".
    Googled for the same got results saying, Better use Database function or procedures to execute these Dynamic Statements but We want to execute in forms only.
    Can any one help me..
    Thanks,
    Madhu

    So in short you are trading code obfuscation for maintainability and the ability to share code between tools? If from somewhere else you need a procedure already implemented in database PL/SQL (and now ported to forms) this would mean you'd need to implement it in every other tool. In times where you might want to integrate your forms with $other_technology and putting stuff on the database is the first step to share functionality you just go the opposite way? And all that because someone is afraid that somebody might steal your source code? I am sorry to be blunt, but this is just plain stupid.
    Leaving aside that some things like Analytic Functions, Bulk processing or execute immediate are not even available in forms your software consists of how many LOC? How long does it take to bring a new developer up to speed with your source code? Imagine how long that would take for a developer who doesn't have coleagues who know their way around.
    And just so you know: I work for a ISV selling a closed-source product as well. We have 200+ customers all over the planet. We are well aware that wrapped packages can be reverse engineered. The premise is: stored procedures can be reused in every tool we have, if it makes sense to put stuff on the database by all means do it. If someone would want to reverse engineer our software I'd wish him good luck as some parts are implemented in such a hilarious complicated way I have troubles understanding them (and quite frankly I refuse to understand certain parts, but that's another story). I do work for almost 10 years for that ISV.
    In any case the possible solutions have already been mentioned: you have exec_sql, create_group_from_query and forms_ddl to execute dynamic SQL in forms whereas forms_ddl is a one way street and most certainly not the thing you need or want. Take a look at the documentation for the other 2 things.
    cheers

  • How can I use one background jpeg in my ebook without a large file size

    I'm guessing that by simply adding a background image or watermark by default adds a separate copy to each page. Since I am intending for them to be the same on all pages except for the title page, how do I shrink the final file size of my PDF eBooks so that the image is stored once but shown on all pages?
    Thanks in advance.

    Thank you, I understand, yeah, I knew that, my phone is factory unlocked and I am going home, which is obviously not in the States and I am thinking of buying a local carrier there. However, I still have 2 weeks before I leave and cannnot wait to start using my Iphone 4. I thought at least I could use the mp3 player function. So as far as I understand, I cannot activate it without a sim card. I have been using metropcs for about two years and it does not have a sim card. In this case, do I really not have another choice but wait for two weeks to listen to music? My Mp3 player just failed me and I really need to listen to music but on the other hand, while I can use my iphone as an mp3 player in two weeks, I don't want to spend more money on a new one. So, do you have another suggestion? For instance, can I use a friend's sim card to activate mine? Would this cause any trouble, when I go home and buy a local carrier? I think these questions might kinda sound weird to you, but first time with an Iphone, extremely excited to start using under my circumstances, I need help   thanks,

  • How can I use the SQL to create a primary key for a existing table?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one? You do not have any primary key defined on your table yet, so, it does not make sense to enable it (if at all possible) !
    You need to add PRIMARY KEY using something like this:
    SQL> alter table a add constraint pk_a_bm primary key (bm) ;

  • How can I use ONE Text search iView to event/affect mutliple Result Sets?

    hello everyone,
    i have a special situation in which i have 6 flat tables in my repository which all have a common field called Location ID (which is a lookup flat to the Locations table).
    i am trying to build a page with a free-form text search iView on Table #1 (search field = Location ID).  when I execute the search, the result set for Table #1 is properly updated, but how do I also get Result Set iViews for Tables #2-6 to also react to the event from Text Search for Table #1 so that they are updated?
    i don't want to have to build 6 different text search iViews (one for each table).  i just want to use ONE text search iView for all the different result set tables.  but, in the documentation and iView properties, the text search iView doesn't have any eventing.
    if you have any suggestions, please help.
    many thanks in advance,
    mm

    hello Donna,
    that should not be a problem, since you are detailw with result sets and detail iviews because custom eventing can be defined for those iviews.
    Yes, it says "no records" found because an active search and record selection havent' been performed for it (only your main table does).
    So, yes, define a custom event, and pass the appropriate parameters and you should be fine.
    Creating a custom event between a Result Set iView and an Item Details iView is easy and works. I have done it.
    See page 35 of the Portal Content Development Guide for a step-by-step example, which is what I used.
    For my particular situation, the problem I'm having is that I want the Search Text iView's event (i.e., when the Submit button is pressed) to be published to multiple iViews, all with different tables.  Those tables all share some common fields, which is what the Search iView has, so I'd like to pass the search critera to all of the iViews.
    -mm

Maybe you are looking for

  • Inspection lot size

    Dear all, I am using in process inspection for that i have set inspection type 3 in material master. An inspection lot is created of the whole order quantity but in one shift only a part of oder quantity is confirmed then in QA 32 How to enter the re

  • Read last shutdown information

    Hello. Where can I read information about last shutdown (a type of shutdown - normal, transactional, immediate, abort ...)? Thanks.

  • Idoc state 56.  jdbc to multiple idoc.

    hi, i have made a jdbc to multiple idoc scenario. i disabled so many mandatory field. i defined a external defination for the idoc. i changed occurance for "IDOC" segment. i can send multiple idoc successfully to ECC. BUT: I found that state 56 of th

  • Smart Folders and Spotlight

    Previous discussions on this forum regarding Spotlight's inconsistent ability to find files caused me to disable Spotlight (using Spotless) and use Easy Find to find things. No one warned me that disabling Spotlight would interfere with smart folders

  • P7 Lightshow Magic and PHP

    Hope someone can help with this. I've basically been using Lightshow Magic in conjunction with a database site, so that the preview pic on product details page can be enlarged in the style of LSM. I've pretty much managed to get it working, in that t