Cutting down a Char

I am new to Oracle so this is probably really easy (but maybe not).
I am working in Oracle Forms, and I have a list that is full of character strings that are up to 25 characters long. I take this value and try to use it somewhere else, but it seems to be padded on the right with white spaces that also get copied. Here is an example:
string_to_copy -> (actual value '12345')
new_string := string_to_copy || 'Hello'
What I see with the new string:
12345 Hello
I need a way to copy the original string into a temporary variable and cut down all the spaces on the right of it. I am a C++/C# programmer so this is kind of tough for me to figure out in PL/SQL.
I can not change the original value at all, and the original value can contain spaces between words, ie 12345 6789 10
So I think what I need to do is loop through the string with a 2 character look-ahead and find the first occurance of 2 whitespaces in a row. Once I find this I will take the Loop Control Variable and use that in declaring a new string of that length ????????
That is one idea and problably the wrong one, since you can not declare variables after "begin" in PL/SQL. Please give me some insight in how to best approach this. Thank You.

You can use trim() function to eliminate spaces on the left and right sides.
SQL> SELECT 'A' || '    TEST      ' || 'B' FROM dual;
'A'||'TEST'||'B'
A    TEST      B
SQL> SELECT 'A' || trim('    TEST      ')  || 'B' FROM dual;
'A'||T
ATESTB
SQL> If you need to remove spaces from right side only use RTRIM() function. Syntax is the same as above. Neither TRIM() nor RTRIM() will remove spaces from the middle of the string
TRIM('A     A') will be equal to 'A     A'

Similar Messages

  • Cut down Table data

    Hi
    I got one requirement to cut down one Table having 4 years worth of data. Requirement want to export only 6 month of data of same table to another database.
    The problem with this table is that.. This table is not having any "date" column_name or Data_type.
    Table structure is as ..
    "CLICK_ID" NUMBER,
    "MEMBER_ID" NUMBER,
    "LINK_ID" NUMBER,
    "CLICK_TIMESTAMP" NUMBER,
    "REMOTE_HOST" VARCHAR2(255 CHAR),
    "USER_AGENT" VARCHAR2(255 CHAR),
    "FAMILY" NUMBER,
    "AGENT" NUMBER,
    "TYPE" NUMBER,
    "COMBINED" NUMBER,
    "BUILDMODE" NUMBER,
    Please guide me how can I cutdown this table to only 6 months of data.
    I am on Oracle 10g.
    Let me know if you need more information.
    Thanks

    PK wrote:
    Hi
    I got one requirement to cut down one Table having 4 years worth of data. Requirement want to export only 6 month of data of same table to another database.
    The problem with this table is that.. This table is not having any "date" column_name or Data_type.
    Table structure is as ..
    "CLICK_ID" NUMBER,
    "MEMBER_ID" NUMBER,
    "LINK_ID" NUMBER,
    "CLICK_TIMESTAMP" NUMBER,
    "REMOTE_HOST" VARCHAR2(255 CHAR),
    "USER_AGENT" VARCHAR2(255 CHAR),
    "FAMILY" NUMBER,
    "AGENT" NUMBER,
    "TYPE" NUMBER,
    "COMBINED" NUMBER,
    "BUILDMODE" NUMBER,
    Please guide me how can I cutdown this table to only 6 months of data.
    I am on Oracle 10g.
    Let me know if you need more information.
    ThanksObviously you are going to have to decide how to identify the age of a row. WE certainly don't know your application. I do see a column CLICK_TIMESTAMP that could be promising. What is it?

  • I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if I

    I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info/start time and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if If I change the start time on one it will change it on all of them.

    In your library, right-click the song you want to edit.
    select "get info".
    go to "options" and select the start and stop times for your first section of the song.
    click "OK".
    Find the shortened version of the song in your library. It may take a minute for it to show up. right click it again and select "create (????) version". (the ???? is different for different formats).
    The library will spit out a new, second version of the song which you can rename. I suggest you use the original title and add a 1 to the end.
    Now you can go back to the other version and repeat the process with a different  start/stop time.
    Once you are done editing, you can burn all of your versions to a disk, just make sure your interval time is zero so there are no gaps between edits.
    To keep the orginal song on your library, just go back to the original and put the start/stop times back to the original settings.

  • Elements 9 ACR 6.5 is a cut down program

    I've used ACR with CS4 before to process my RAW files but recently bought Lightroom 3.5 and Elements 9. I've upgraded both programs to ACR 6.5 to support my camera and noticed for the first time that the Elements plugin is a cut down version of ACR 6.5 with many of its features missing. If ACR 6.5 is a free download and available from thrid party websites why isn't the full program available when opening a RAW file withing Elements 9? I've tried downloading it from Adobe and using it as a standalone probram but when opening it up I'm told that it isn't appropriate.
    George

    From what I’ve seen, while many adjustment tabs and sliders are not in PSE-hosted ACR, the underlying RAW converter is still the same, so if you have made adjustments in LR and save into an XMP then open in PSE, or just use Edit In Photoshop Elements from LR, the ACR that opens the file on the way in to PSE will apply all the adjustments that were made in LR.  And so since you can make all the adjustments in LR there’s no need to make anymore adjustments in the ACR on the way into PSE is there?
    Is your experience different than this, where if you do something in LR that doesn’t have a corresponding slider in the PSE-hosted ACR, it doesn’t get applied.  For example, if you make a manual lens-correction for perspective that is easy to tell whether it happened or not, in LR and then do a Edit in Photoshop Elements from LR, does the perspective-correction not happen?
    The only thing that should be different is that you have to be in LR to make all the adjustments, not use PSE-hosted ACR to make them.

  • SMARTFORM ERROR - Part of Text is cutting down after SPACE

    Hi,
    I have made a simple smartform just for test purpose.
    I included a simple template in the main window which has 5 mm height and 3 cm width.
    In the template there is one text element, and 1 included a constant text:
    LABEL: YYYYYYYY
    If i see the print preview, it displaying correctly.
    BUT!
    If I change the constant text to longer, to test what happens if the field is longer than the available size to display:
    LABEL: YYYYYYYYYYYYYYY
    In the print preview this will be shown:
    LABEL:
    So it means that those Y's are just cutting down.
    If I replace the longer version of the text to:
    LABEL:_YYYYYYYYYYYYYYY
    In the print preview I can see as many characters as it can display, so some Y's are not printing:
    LABEL:_YYYYYYYY
    Can somebody tell me if I use spaces, how to avoid to cut the remaining text and display as many characters as it can like with underscore character?
    This is a very strange and buggy behaviour.
    BR,
    Gabor from Hungary

    Hi
    I suppose I depends on the logic used in order to print a text in an area smoller than text
    It seems it always tries to write fully the words, that means if the text has many words, the smartform writes the first words (on the left) fully and truncates the remaining words, if the text has one word only, smartform write the part of it can be contained.
    So if you insert
    A) LABEL: YYYYYYYY
    There are 2 words:
    LABEL:
    YYYYYYYY
    Both words can be contained so smartform writes both of them
    B) LABEL: YYYYYYYYYYYYYYYYYYYYYYY
    There are 2 words:
    LABEL:
    YYYYYYYYYYYYYYYYYYYYYYY
    The second word should be trucated, so the smartform writes the first only
    C) LABEL:YYYYYYYYYYYYYYYYYYYYYYY
    There is only one word, so smartform writes only the character can be contained in the window
    Max
    Edited by: max bianchi on Nov 10, 2010 6:21 PM
    Edited by: max bianchi on Nov 10, 2010 6:26 PM

  • Overal Result is changing when drill down the char - report is having cond.

    Hi ,
    we are running one report, the overal result is changing by drill down one char. if we remove drill down  the same char. then it is displying the original value.
    Note: we have one condition on the report. in the _Characterstiv Assignment tab_  the radio box Individual chars and Chars. combinations is selected.
    can any one please sugest us, how to get the same result even though we dril down the other chars.
    Thanks in Advance,
    Raju

    Hi Gangaraju,
    If i am correct, the key figure column for which the total is changing is having the property set as "Calculate result as :Total"  at query designer level.
    If you want to display the same total irrespective of the drilldown of the characteristics then remove this property from the keyfigure in Query Designer .
    Then you will see the original total irrespective of the characteristic being taken for drilldown.
    I hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh

  • Oracle 9i cut down version

    Hi ,
    We have an embedded license for the Oracle 9i DB Enterprise edition and we r planning to package it along with our application for the clients. But all we need from Oracle 9i DB is just the database and nothing else.
    Due to the huge size of the Oracle DB around 1.5 gb we were thinking that if we cud a cut down version of the Oracle 9iDb it wud be easier to package along with our application.
    Is this possible ?? if so How??
    Thanx
    Kulkarni

    oop! should of course have been 1.4.2.03 !

  • Java needs a cut down "media" VM

    What would it take for java to take on flash in the internet media space?
    My thoughts on why flash dominates java:
    The java download is far too big, java is ~7MB, flash is ~1.8MB
    The vm takes far too long to startup
    You get an ugly grey box when the vm is starting up in place of the applet
    What is needed is a cut down java "media" vm. It should:
    Be no larger than the flash download of ~1.8MB
    Have greatly improved startup time. On a modern pc it should be almost instantaneous.
    Be fully upgradable to the "full" vm. For example if the full vm is ~7MB then if you have the media vm installed the full vm download should be ~1.8MB smaller
    As the name implies it should be focused solely on rich media (steaming movies etc)
    It should not cause the java icon to popup on the taskbar by default. It should be transparent to the user that java is running.
    Should not display a grey box in place of the applet when starting up, the box should be black or non-existent.
    The aim would be for sites like youtube to be able to realistically replace flash with java. What do you think?

    >
    Not true, you should probably read a few tutorials. You can already replace that with an image or an animated image.Well I have not written any applets for a long time it is just what I am seeing out there. I have been developing java for over 10 years so I don't need to read any tutorials.
    This is a large development space and java should be taking it over. JVM modularity is the first step in the same direction.

  • Column wise drill down a char will have to effect to a singe Key Figure

    Dear SDNers,
    I  am drilling down a Char info object in Column wise (-->) this drill down is effecting to all Key figures in the query.. But I need this will having to effect to a single key figure. Please suggest me. For other Key Figures it should be row wise drill down. Pls suggest.
    Thanks,
    Swathi

    Hi
    This is not possible, you need to use keyfigure only in coloums otherwise not able to achive.
    Regards
    Jagadeesh

  • Strange behavior - compositions being cut down

    I'm trying to create After Effects compositions to be used in my Premiere Pro projects, but strange behavior is making this completely impossible. Here's how it goes:
    1. Start a new AE project, start a new composition.
    2. Add clips/effects/etc., save.
    3. Start a NEW AE project, start a NEW composition.
    4. Add clips/effects/etc., save.
    5. Composition 1 has now been cut down to the time composition 2 and when trying to open composition 1 in AE, it redirects me to composition 2.
    I don't get what's going on... it's like they're being linked, but they're two entirely different projects/compositions. This is crazy and it's wasting a lot of my time. Any help would be appreciated.

    Let me slap my self on the forehead and say "D'oh"  It's your workflow. You're using dynamic link in Premiere Pro. The proper workflow is to have all of the comps in the same AE project. In Premiere Pro you go to File>Dynamic Link>New After Effects Project. You create your comp size in Premiere Pro, not in AE, then AE opens up and you create your comp. When you want to create a new dynamic link you follow the same procedure.
    Dynamic link can only look at one instance of AE at a time so it's looking at the last project for the comp info. It can't find comp 1 in project 1 because it's only looking at project 3. That explains the same comp showing up in all three locations. Fix the workflow and you'll fix the problem. In fact, I think that if you open up project 3 and import project 1 and project 2, then same project 3, then open up Premiere Pro your problem will be fixed.

  • I have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working except cellular data or 3g data, please help me

    i have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working calling & messaging except cellular data or 3g data, please help me

    Everything you need to know about the solution is written into the question you posed. Get a proper SIM.

  • Best Export Format for iDVD to cut down on multiplexing and processing

    My processor is what it is and my Ram has been optimized.  Is there some video/audio format/ bit rate that will require less time to convert and process?
    I understand that MPEG2, mpeg4, H.264, avi, and all seem to take far too long. I prefer using FCPX and Wondershare to do my converting.
    Also whenever I have a random burning error its almost always a “multiplexing error” so maybe if I make the “multiplexing” a little easier maybe I can prevent that headache.
    Any thoughts about inve$ting in the fastest burners available?  Isn’t the actual “burn” process the very last step that usually only takes about 2 minutes anyway?
    Thank you in advance!

    KidVid wrote:
    My processor is what it is and my Ram has been optimized.  Is there some video/audio format/ bit rate that will require less time to convert and process?
    All depends on what format you need for what purpose. If you need a DVD it'll have to be MPEG-2 or for web use it'll have to be h.264. Other than that there are tons of codecs and containers available. All conversion takes time and to cut down on that time you will need a faster machine.
    KidVid wrote:
    Also whenever I have a random burning error its almost always a “multiplexing error” so maybe if I make the “multiplexing” a little easier maybe I can prevent that headache.
    To avoid burn errors in iDVD create a disk image of your project, test that image file with DVD Player, and, if satisfied, burn with any dedicated disc burning app at no more than 4x to avoid errors.
    KidVid wrote:
    Any thoughts about inve$ting in the fastest burners available?  Isn’t the actual “burn” process the very last step that usually only takes about 2 minutes anyway?
    See the speed limit above.

  • Cut down Micro Sim in iPhone 6

    Hi everyone,
    Has anybody successfully used a cut down micro sim in the iPhone 6?
    Thanks

    DON'T try it. The micro sim might be a little bit thicker than the nano sim. So there is a possibility that the sim and sim trap get stuck and you won't get it out.

  • Ability of DSLR cameras to cut down UV and infrared light

    Is it a fact that most digital cameras can cut down ultraviolet and infrared parts of the electromagnetic radiation on their own and therefore do not require separate filters for that purpose? If so, even an entry level DSLR, like my Canon EOS 1100D, is so capable? 

    Yes, this is true.  In fact... more than you might guess.
    In the days of film (I speak as if it's ancient history but that's how many of us here grew up shooting) the sensitivity of the film to various parts of the spectrum dependended entirely on the film itself.  If you wanted to shoot infra-red, you loaded the camera with infra-red film.  Non infra-red film was not particularly sesntivie to infra-red light.  
    Many films were mildly sensitive to UV light and the real point of the UV filter (which I think might surprise most people) is that whenever you pass light through a "lens", the lens has a "dispersion" effect which bends different wavelengths of light by a different amount.  Compensating elements are used in the lens to attempt to correct for this and better lenses are judged substantially by how well they handle this.  But it turns out human eyes are not sensitive to either UV (nor IR).  Since UV is on the short end of the spectrum, it's light bends more than any other wavelength and would thus need the most correction.  If left uncorrected, this might cause an image to appear slightly "soft" because the UV wavelength does not want to focus at precisely the same focus distance.  Rather than "correct" the UV wavelength, it's much easier to just eliminate it entirely by using a filter -- problem solved.
    Back to the era of digital...
    Digital cameras are senstiive to both UV and IR and much moreso than film.  Effectively _every_ digital camera needs to filter these wavelengths out.  But more than this... human eyes are not actually 'equally" sensitive to all colors of light.  We are far more sensitive to the wavelengths in the middle of the visible spectrum and not nearly as sensitive to the wavelengths nearing the sides of the visible spectrum.  You are, in effect, VASTLY more sensitive to "greens" and much less sensitive to either red or blue.  So while you see the world with reds, greens, and blues... the real world has significantly more red and blue than you are able to see.  Cameras would see these more or less equally and this would result in images which appear to be saturated with red and blue.  
    To fix this, the camera does a few things...
    First... the sensor is coated with "photosites" under a mask of red, green, and blue micro "filters".  The array is usually referred to as a "Bayer Mask" (there are other types but this is the most common.)  The mask has twice as many "green" sensitive sites as it does red or blue sites.  
    Second... the camera has both UV and IR filters inside and these are located immediately in front of the sensor (but behind the shutter).  If you remove the lens, open the shutter, and look in side, then what you actually are looking at is a couple of layers of filters (which appear mostly clear to you) and then the sensor itself is behind them all.
    Third... the UV and IR filters have a gradual cut-off curve.  The IR wavelength begins at 700nm (and longer)  Anything "shorter" than 700 is considered 'visible' light.    The visible spectrum runs from roughly 400nm through 700nm.  But it's not as if the filter allows 0% of wavelengths shorter than 400nm to pass and 0% of the wavelengths longer than 700nm to pass and yet 100% of the stuff between 400 and 700nm through.  What it _really_ does is a gradual ramp.  
    The filter begins cutting IR light starting while it's still in the 500nm range -- it's already being filtered in the 600nm range.  By the time we get to the 656nm wavelength (which happens to be a fire-engine red color -- that's the "Hydrogen alpha emission line" the filter is already cutting nearly 75% of the "red" light (and this is still considered "visible" light spectrum territory).    By the time it gets to the 700nm wavelength it's cutting nearly all of it.
    This may sound surprising or undesireable but actually... it more mirrors the sensitive amounts of your own eyes.  Your eyes are less sensitive to those wavelengths so the camera is deliberately de-tuned to be less sensitive to those areas as well and in doing this, you end up with a photograph which more closely approximatelys the color proportions that your eyes are used to seeing.
    There are  people who modify their cameras so they can be used for IR photography and astrophotographers love to modify them for astrophotography purposes (the Canon 60Da is a special edition of the 60D which is pre-modified by Canon to be more sensitive to the wavelengths needed in astrophotography which benefits greatly if sensitive to the Ha (Hydrogen alpha) wavelength (656.28nm) is improved.)
    Thats probably more than you wanted to know about the filters... but there you have it!
    There is no "need" to use a UV (nor IR) filter on any of your lenses.  Some people use them as a form of "protection" (to avoid getting dirt directly on the front element of the lens).  There is a downside to useing them in that they often will create optical reflections in your image ... with "ghosting" or "flaring" that would not be visible had no filter been on the lens.
    Regards,
    Tim
    Tim Campbell
    5D II, 5D III, 60Da

  • HT201269 Can a sim card from an iphone 3 be cut down to fit in an I phone 4s?

    Can a sim card from an iphone 3 be cut down to fit in an I phone 4s?

    Yes.
    See: http://www.amazon.co.uk/DIGIFLEX-Micro-Cutter-Adaptors-iPhone/dp/B003V4518I
    Although it is better to just request a new MicroSIM from your network provider.

Maybe you are looking for

  • Can I use a networked Macbook as a storage device?

    I am needing to see if my idea will work and need some ideas. I have a macbook in which the screen became damaged this summer. Everything else is running fine. I am teaching Journalism and would like to use the macbook as a storage device for my stud

  • Zen Vision M Problem

    Hi there, I bought a Zen Vision?M 30gb a few years ago and since then i havent used it for a while. When i came round to using it again it wouldnt charge via mains/usb. It would only start up when the mains was plugged into it and i had like a charge

  • FTXP-error-Domain MWART fixed value  does not exist- Message no. F4341

    Hi, I am trying to created a new record for a tax code, and i get this error Domain MWART fixed value  does not exist Message no. F4341 I looked up OB40, and not sure how to fix this. Do you know how to check the tax codes? How to validate OB40? Than

  • Negative values p_quantity API pa_budget_pub.add_budget_line

    Is it possible to give negative values for the parameters p_quantity or p_raw_cost or p_burdened_cost in the API pa_budget_pub.add_budget_line. I require to give negative values for the p_quantity and the API gives a error message. No problem while g

  • Crop comp to ROI doesn't work

    I'm new to After Effects and I'm using AE6. I'm working on a video clip. After drawing a Region of Interest I selected Crop Comp to Region of Interest in the Composition drop down menu.  Nothing happens!  The original bounding box of the comp stays t