Number of Times Word Repeated

Hi
I need to count the no.of words in a particular sentence....I need a program in PL/SQL......Please any one help me.......
Regards,
Sankar.C

sql>declare
      i number := 0;
      j varchar2(2000);
      x varchar2(2000) := '1234567890123456789';
    begin
      loop
         i := i+1;
         select substr(x,i)
         into j
         from dual;
         if j is null then
          exit;
         end if;
      end loop;
      dbms_output.put_line(to_char(i-1));
   end;
19
PL/SQL procedure successfully completed.
jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • QUERY WHICH COUNTS NUMBER OF TIMES WORDS/LETTER APPEAR IN SENTENCE - Thanks

    I have this query below
    it gives the number of times a txn is hign comfort and Approved
    .. nyumber of times txn is meduim comfort and approved etc.
    There is a futher line whihc shows the number of times txn is blacklisted BL COUNT.
    I am trying to get line of query which can show me the number of times txn is approved, is high comfort and blcklisted ( the same applies for
    wl - watch listed)
    The query i am using
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('BL(%') and cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
     THEN 1
    ELSE 0 END)AS hbcl  - NO RESULTS BEING GIVEN
    pLEASE CAN ANYONE HELP,. THANKS
    QUERY
    USE RiskManagementReporting
    GO
    DECLARE
    @StartDate DATETIME,
    @EndDate DATETIME
    SET @StartDate
    = '2014-01-01 00:00:00'
    SET @EndDate
    = '2014-03-31 23:59:59'
    SELECT
    CONVERT
    (VARCHAR(10),
    mt.OPacket_TransactionTime, 102)
    AS [Date],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
    THEN 1 ELSE 0
    END) AS [A - HighC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Medium Comfort%')
    THEN 1 ELSE 0
    END) AS [A - MediumC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Low Comfort%')
    THEN 1 ELSE 0
    END) AS [A - LowC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Low Risk%')
    THEN 1 ELSE 0
    END) AS [D - LowR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Medium Risk%')
    THEN 1 ELSE 0
    END) AS [D - MediumR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Risk%')
    THEN 1 ELSE 0
    END) AS [D - HighR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('BL(%')
    THEN 1 ELSE 0
    END) AS [BL Count],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('WL(%')
    THEN 1 ELSE 0
    END) AS [WL Count],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Marked as Touched%')
    THEN 1 ELSE 0
    END) AS [Touched by DRT],
    COUNT
    (mt.csnTransactionId)
    AS [Sent to DRT]
    FROM MatchedTransaction mt
    WITH (NOLOCK)
    LEFT
    JOIN CustomerComment cc
    WITH (NOLOCK)
    ON (mt.csnTransactionId
    = cc.SenderMTCN
    AND cc.InsertDate
    BETWEEN @StartDate AND
    DATEADD (D, 1, @EndDate)

    I have adjusted this as  
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
    AND cc.Comment
    LIKE ('%BL(%')THEN 1
    ELSE 0 END)
    AS hcbl,
    Still no result

  • Repeat a specific number of times

    I have 6 frames on my movie timeline. Each frame has a movie
    about 200 - 300 frames.
    I want each movie to repeat a specific number of times before
    it goes to the next frame on the main movie time line.
    How can I do this

    Look at this:
    http://www.smithmediafusion.com/blog/?p=19
    Change this:
    if(myCount ==3){
    stop();
    to:
    if(myCount ==3){
    gotoAndPlay(nextMovieFrame);
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "umr" <[email protected]> wrote in message
    news:ed1ug9$41o$[email protected]..
    >I have 6 frames on my movie timeline. Each frame has a
    movie about 200 -
    >300
    > frames.
    > I want each movie to repeat a specific number of times
    before it goes to
    > the
    > next frame on the main movie time line.
    >
    > How can I do this
    >

  • How do I count the number of times a word appears in a column?

    What I have is a spreadsheet logging work history. Let's say the work location is "office", "home", or "travel" and I want to have a separate cell in another table for totals, count up the number of time each appears in the data for the year. So it would look like this:
    Date
    Location
    sept 1
    office
    sept 2
    home
    sept 3
    home
    sept 4
    travel
    sept 5
    office
    sept 6
    office
    sept 7
    office
    sept 8
    travel
    sept 9
    home
    sept 10
    office
    Totals
    Days
    10
    Office
    5
    Home
    3
    Travel
    2
    I just can't figure out how to develop the formula to put in the Totals column to make it work this way. If you can help me achieve this I'd really appreciate it!

    Hi SpartanAntarctican,
    Table 1 to record your locations
    Date
    Location
    sept 1
    office
    sept 2
    home
    sept 3
    home
    sept 4
    travel
    sept 5
    office
    sept 6
    office
    sept 7
    office
    sept 8
    travel
    sept 9
    home
    sept 10
    office
    Table 2 to sum your locations
    Totals
    Days
    10
    Office
    5
    Home
    3
    Travel
    2
    In Table 2 the formula in B2
    =ROWS(Table 1::A)−1
    Minus 1 because there is a Header Row in Table 1.
    In Table 2 the formula in B3 (and Fill Down)
    =COUNTIF(Table 1::B,A3)
    You can check this by adding 5 + 3 + 2 to arrive at 10
    Or maybe delete Row 2 put the Days calculation into a Footer Row in Table 2
    =SUM(B) .
    Regards,
    Ian.

  • When opening microsoft word on mac it automatically opens a huge number of my word files and I have to wait for it to open them all then when i try to close them down it freezes and I 'force quit' and on reopening the same thing repeats

    When opening microsoft word on mac it automatically opens a huge number of my word files and I have to wait for it to open them all then when i try to close them down it freezes and I 'force quit' and on reopening the same thing repeatsI have to wait for it to open them all then when i try to close them down it freezes and I 'force quit' and on reopening the same thing repeats

    One thing to try/check - in System Preferences, General.  Check the box "Close windows..."

  • Running a java program a set number of times

    This is a general question. Is it possible to make a java program run only 5 times for the sake of arguement.
    Basically I want to write a program that will give the user some flexibility when it will actually run another Java program, but I only want them to be able to say "not now' for a set number of times. When the last time comes the other program will launch. I was initially thinking of the Do Whilw loop, but this needs to work when the program is restarted.
    Program starts, it has 5 times it will run before it does something else(doesn't really matter now I think). User takes option "Not Now" and the program ends, but warns the user this will run 4 more times before you will need to do something.
    This process will repeat until the user takes the option "Ok install now" or the time limit expires and the install occurs anyway. Can someone point me in the right direction.

    ok I see so it's like one those programs that you download for free on the internet and they give you a set amount times to use it before you have to pay for it. but in this case when the number of times you use it equals 5 (or when the user clicks ok) a different java app will open automatically.
    My first thought would be to Write a Serialized object to disk using objectOutputStream that stores the number of times the application has been opened. and each time the program runs it checks for the serialized object and then you can do something like what I posted before. of course if were worried about security the user could always look for the object and erase it, if so then I guess we would have to come up with another plan of attack
    Hope this helps

  • Generate numbers in incremental order, the number of times condition met?

    I have tried explaining my problem here also.
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=31&t=007531&p=1
    But trying to put in other words now.
    I have a NO tag which appears many times in xml. and alwyas have some random numbers displaying.
    output looks something similar to this
    something......<NO>1</NO>
    something......<NO>1</NO>
    something......<NO>2</NO>
    something......<NO>1</NO>
    something......<NO>3</NO>
    something......<NO>1</NO>
    something......<NO>5</NO>
    something......<NO>1</NO>
    something......<NO>1</NO>
    something...... & so on.
    Now instead of these numbers coming in this order i prefer to display in final output file as
    1 2 3 4 5 .................... n
    Is it possible in any ways using xslt.
    DO we need to ignore the values given in input file and then generate output values for same.
    it can be like the number of times NO tag appears in xml, it should start from 1 and keep increasing value by 1, until NO tag finishes appearance.
    But next time when other xml transforms it again should be able to start from 1 till n.
    is there a possibility of using java code for this situation or xslt is capaable enough to handle this.
    Thanks
    VJ

    I'm guessing you are looking for something like this. I used a pull approach but it could be done with a push (xsl:for-each).
    Sample XML
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
         <NO>1</NO>
         <NO>1</NO>
         <NO>2</NO>
         <NO>1</NO>
         <NO>3</NO>
         <NO>1</NO>
         <NO>5</NO>
         <NO>1</NO>
         <NO>1</NO>
    </root>
    Sample XSLT
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/>
         <xsl:template match="root">
              <output>
                   <xsl:apply-templates select="NO"/>
              </output>
         </xsl:template>
         <xsl:template match="NO">
              <row>
                   <xsl:value-of select="position()"/>
              </row>
         </xsl:template>
    </xsl:stylesheet>
    Sample Output
    <output>
         <row>1</row>
         <row>2</row>
         <row>3</row>
         <row>4</row>
         <row>5</row>
         <row>6</row>
         <row>7</row>
         <row>8</row>
         <row>9</row>
    </output>

  • Is there a way to count the number of times an array moves from positive to negative?

    I have an array of values, and I need to find the number of times that the array changes signs (from positive to negative, or vice versa). In other words from a graphical standpoint, how many times a certain line crosses the x-axis. Counting the number of times the array equals zero does not help however, because the array does not always equal exactly zero when it crosses the axis (ie, the points could move from .1 to -.1).
    Thanks for you help. Feel free to email me at [email protected] I only have lv 5.1.1 so if you attach any files, they cannot be version 6.0.

    Attached is a VI showing the # of Pos and Neg numbers in an array, with 0 considered as non-Pos. It is easily modifiable to other parameters - including using the X-axis value as your compare point versus only Zero.
    This is a modified VI from LV (Separate Array.vi)
    Compare this with your other responses to find the best fit.
    Doug
    Attachments:
    arraysizesposneg.vi ‏40 KB

  • Is there any way to limit the number of times that a PDF can be opened?

    I run a small publishing company and we want to provide exam copies of our books to professors.  At present our exam copies have the words EXAM COPY as a water mark on every page and we've also made the files so that they can't be printed or easily copied.  However, we'd like to also restrict these PDFs so that they can only be opened 5 times.  I've read about FileOpen but that approach seems a bit more complex than needed.  Is there any other way to restrict the number of times that a PDF file can be opened once it is downloaded?  Thanks in advance for any suggestions.

    DRM soltions like FileOpen are your best bet for PDFs. Others include Adobe's LiveCycle Rights Managment, LockLizard, Armjisoft PDF Security OwnerGuard, etc.
    They all work and are priced differently, but there's really nothing for what you want to do that is both simpler and secure.

  • Web AS restarts due to classes being loaded multiple number of times

    Hi,
    We are developing a custom application which uses Dynpro for UI and EJBs/java for business and DAO layer.
    ->The application size is very big and to make the build and deployment faster, we have split the application into multiple ears.
    ->We have made sure that none of the classes are repeated across ears.
    ->We are using Web AS 2004s SP12 on Solaris UNIX platform.
    With all the ears being deployed on the application server, we notice application server being restarted once/twice per day. We have gone through the logs etc in detail and we found that most of the application classes are being loaded multiple number of times. In some cases, same class is being loaded more than 150 times. Due to this reason, permSpace area of JVM is getting exhausted and JVM is crashing. permSpace of JVM is set to 1024M at the moment.
    Any thoughts on what could be wrong here?
    Please let me know if you need any more details on this.
    Thanks, Chandra

    Hi,
    Which JDK version is in use ?  If possible, use JDK 1.4.2.17
    Change Perm size :   -XX:PermSize=512m -XX:MaxPermSize=512m
    Check if the below mentioned JVM parameters exists in the list :
    -verbose:gc
    -Xloggc:GC.log
    //   -Xmx2048m (if -Xmx mentioned the JVM Parameter list, remove it) as you have already mentioned in the JVM Heapsize  //
    -Xms2048m
    -XX:PermSize=512m -XX:MaxPermSize=512m
    -XX:NewSize=320m -XX:MaxNewSize=320m
    -XX:SurvivorRatio=2
    -XX:TargetSurvivorRatio=90
    -XX:+PrintGCDetails
    -XX:+PrintGCTimeStamps
    -XX:+UseParNewGC
    -XX:+HandlePromotionFailure
    -XX:+PrintClassHistogram
    Regards
    Shaji

  • Duplicating files a number of times

    I want to duplicate a file a certain number of times (a number that I determine each time the script is run) and then move those files to a different folder. Is this possible thru Automator?
    Thanks

    Use the following AppleScript action:
    display dialog "How many times do you want the files to be duplicated?" default answer ""
    set the_times to text returned of the result as number
    set thenewfiles to {}
    tell application "Finder"
    repeat the_times times
    set thenewfiles to thenewfiles & ((duplicate input) as alias)
    end repeat
    repeat with this_file in thenewfiles
    move this_file to folder "destination folder"
    end repeat
    end tell
    Place the folder's actual name between the last pair of quote marks, and set it up so that it receives the files from a previous action in the workflow.
    (21830)

  • I have a power mac G5.  It boots up fine and then a screen comes down and in a bunch of different languages tells me the machine needs to be restarted. At this point everything is frozen. I have done this a number of times and I get the same thing.

    I have a power mac G5.  It boots up fine and then a screen comes down and in a bunch of different languages tells me the machine needs to be restarted. At this point everything is frozen. I have started the machine up a number of times and I get the same thing.  Anyone have any ideas?

    Does it boot from the Install Disc OK?
    Does it boot into any of these modes?
    Holding Option/alt key at bootup.
    Holding SHIFT key at bootup.
    Target mode...
    http://support.apple.com/kb/HT1661
    Does it boot to Single User Mode, CMD+s keys at bootup, if so try...
    /sbin/fsck -fy
    Repeat until it shows no errors fixed.
    (Space between fsck AND -fy important).
    Resolve startup issues and perform disk maintenance with Disk Utility and fsck...
    http://docs.info.apple.com/article.html?artnum=106214
    We might get clues with verbose mode...
    http://support.apple.com/kb/HT1492

  • How to find the number of times method being called.....

    hi,
    can any one pls tell me how to find the number of times the method being called......herez the example....
    Refrence ref = new Refrence();
    for(int i = 0;i < arr.length; i++){
    if(somecondition){
    ref.getMethod();
    here i want to know how many times the getMethod() is calling...Is there any method to do this.. i have seen StrackTraceElement class..but not sure about that....pls tell me the solution....

    can any one pls tell me how to find the number of times the method being called......
    herez the example.... http://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

  • How do you transfer voice memos to your pc?  I have synced my phone a number of times and everything updates with the exception of voice memos?

    How do you transfer voice memos to your pc?  I have synced my phone a number of times and everything updates with the exception of voice memos? Also, my voice memos are checked to be synced everytime my phone is synced. 

    Voice memos, once correctly synced, will appear under your Music Library.  Can you go through your music library to check?

  • Number of times an Item of Stock has been Received (Goods Receipt PO)?

    Hi Everyone,
    I have been asked to create a report to show how often a stock item has been received amongst other details; such as the last Goods Receipt Purchase Order #, and date!
    Here is the query that I have created; it is doing everything except returning the number of times that a given Item Code has been received (which is the most important part!)
    SELECT
    T0.ItemCode AS 'Item Code'
    , T0.Dscription AS 'Description'
    , MAX(T1.DocNum) AS 'Last Goods Receipt PO #'
    , MAX(T1.DocDate) AS 'Last Receipt Date'
    , SUM(T0.Quantity) AS 'Received since Go Live!'
    , T2.OnHand AS 'Currently On Hand'
    , SUM(T1.DocNum) AS '# of Times Received'    --Number of Goods Receipt Purchase Orders for the given ItemCode
    FROM AU.dbo.PDN1 T0
    INNER JOIN AU.dbo.OPDN T1 ON T1.DocEntry = T0.DocEntry
    INNER JOIN AU.dbo.OITM T2 ON T2.ItemCode = T0.ItemCode
    GROUP BY T0.ItemCode, T0.Dscription, T2.OnHand
    ORDER BY T0.ItemCode
    The line SUM(T1.DocNum) AS '# of Times Received' is actually returning the SUM of all Document Numbers associated with a given Item Code, whereas I really just want to know how many times a given Item has been received! For example if there are 12 Goods Receipt Purchase Orders for Item 'X' then I simply want to show 12, rather than some obscenely big (meaningless) number.
    Any help here will be greatly appreciated.
    Kind Regards,
    David

    hi,
    use below query
    SELECT 
    T0.ItemCode AS 'Item Code' 
    , T0.Dscription AS 'Description' 
    , MAX(T1.DocNum) AS 'Last Goods Receipt PO #' 
    , MAX(T1.DocDate) AS 'Last Receipt Date' 
    , SUM(T0.Quantity) AS 'Received since Go Live!' 
    , T2.OnHand AS 'Currently On Hand' 
    , count (distinct T1.DocNum) AS '# of Times Received'   
    FROM PDN1 T0 
    INNER JOIN OPDN T1 ON T1.DocEntry = T0.DocEntry 
    INNER JOIN OITM T2 ON T2.ItemCode = T0.ItemCode 
    GROUP BY T0.ItemCode, T0.Dscription, T2.OnHand 
    ORDER BY T0.ItemCode
    regards,
    Raviraj

Maybe you are looking for

  • Continuing inability to resolve Mobile Device Support failed to install

    Windows Vista Premier Home 64 bit on HP desktop I see this is clearly a common and frustrating problem esp for various 64 bit versions. Mine just happens to be Vista 64 and HP but I see other seemingly similar problems with other versions of the OS a

  • Time Machine restore from Network Drive

    Hi, I have a Time Machine backup of my Mountain Lion system on a GoGlex Home wireless network drive. Location is as follows: /Volumes/GoFlex Home Backup/TimeMachineBackup/AlexHarris.sparsebundle My problem is, when I try and restore this sparsebundle

  • HTTP_RESP_STATUS_CODE_NOT_OK

    Hi All, When I place any source file for processing, the message ends with the below error in MONI. <SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>   <SAP:P1>401</SAP:P1>   <SAP:P2>Unauthorized</SAP:P2> <SAP:Stack>HTTP response cont

  • Remembering windows positions when switching from/to dual screen display

    Hello, Most of the time, a second LCD screen is plugged in my Macbook and configured as the main display. When I arrange the windows, I keep iTunes or my mail application maximized on the macbook screen and use the bigger external screen for all othe

  • MacBook "pausing" problems...

    OK, had this MacBook for 2 years now, no issues. Starting this past week it seem to work fine and then when I click on an app, click off and app, or am simply scrolling the comp pauses and the pinwheel comes up for about 15 seconds before the process