String function question

In Sybase, I could use "LEFT" or "RIGHT" to return X number of characters in a string. Does PL/SQL have a similar function?

Hi,
Solomon Yakobson wrote:
... Well, much better way is:
to_char(grade_level,'00')
I think you meant
to_char(grade_level,'fm00')To those who don't understand:
TO_CHAR leaves room for a minus sign when you use a second argument like '00', and the result will be a three-character string, starting with a space, e.g. ' 01'. Adding 'fm' to the second argument tells TO_CHAR not to include the extra space.

Similar Messages

  • Split string function in oracle ...

    Hello,
    Little question, is there any split string function available in Oracle.
    SQL> select more_info
    2 from dba_advisor_findings;
    MORE_INFO
    Allocated Space:4390912: Used Space:4237403: Reclaimable Space :153509:
    select more_info as Allocated_Space,
    more_info as Used_Space,
    more_info as Reclaimable_Space
    from dba_advisor_findings
    Allocated_Space Used_Space Reclaimable_Space
    4390912 4237403 153509
    Thanks,
    Manish Gupta

    I explored more on SUBSTR and INSTR string functions ... and below is the solution
    select substr(more_info,instr(more_info,':',1,1)+1,instr(more_info,':',1,2)-instr(more_info,':',1,1)-1) as "Allocated_Space",
    substr(more_info,instr(more_info,':',1,3)+1,instr(more_info,':',1,4)-instr(more_info,':',1,3)-1) as "Used_Space",
    substr(more_info,instr(more_info,':',1,5)+1,instr(more_info,':',1,6)-instr(more_info,':',1,5)-1) as "Reclaimable_Space"
    from dba_advisor_findings;
    Allocated_Space
    Used_Space
    Reclaimable_Space
    4390912
    4237403
    153509
    Thanks...

  • Hash function question

    I'm working with hash codes for string objects. Here's the method i'm using (i think this is the same as the normal string hash function, except for mine supports skipping characters):
    public int hashCode () {
            int h;
            h = 0;
            for (int i = 0, len = rep.length (), step = skip; i < len; i += step)
                h = h*31 + rep.charAt (i);
            return h;
        }This comes from a wrapper class that holds a string (REP) as well as an int SKIP that causes the hash function to skip characters in the string (my question won't be dealing with SKIP, ie, assume SKIP is one for the purposes of this question).
    I'm running this hash function on four-character "words" of the form "xxyy" (where x and y are some value between 1 and a specified N, where N is by usage usually less than 300 or so) and also on words of the form xXyY (where x, y, and N are the same as before, and X=2^16 - 31x - 1 and Y=2^16 - 31y - 1).
    So the question is, will this hash function take longer to run on xXyY words than it will on xxyy words? if so, why?

    If X and x, as well as Y and y, are of the same type but merely hold different values, and the strings are of equal length, that shouldn't matter performance-wise.

  • Search and replace string function

    Hello, I am using the "search and replace string" function and it does nt seem to work consistently for me.   I am using it in a situation where I am taking an array of strings, converting this into a spreadsheet string then deleting all of the commas.  Has anyone experienced the same behavior? I have searched through other posts and found other simular faults but none of the fixes worked for this. I can post the code it needed.
    Thanks,
    Andrew

    I agree that commas are often not desirable, especially if your software should also work in countries where comma is used as a decimal seperator.
    Where are the commas coming from? Does (1) each element of the original array have one (or more), do you (2) use comma as seperator if you convert it to a spreadhseet string?
    For (1), you might just strip out the comma for each element right in the loop. For case (2) you would simply use a different separator to begin with, of course.
    Btw: you are abusing a WHILE loop as a FOR loop, because you have a fixed number of iterations. Please replace it with a FOR loop. If you use a FOR loop, LabVIEW can manage memory much more efficiently, because it can allocate the entire output array before the loop starts. For While loops, the total number of iterations is not known to the compiler. (Of course a real program would also stop the loop if an error occurs. In this case you would need to stay woth the WHILE loop. )
    Do you have a simple example how the raw array elements look like. How many commas are there?
    LabVIEW Champion . Do more with less code and in less time .

  • Error in XSLT mapping while using string functions

    Hi All,
    While using tokenize() and substring-before() functions in XSLT mapping,we are getting an error.The error message is Unexpected symbol "" So while using string functions in XSLT mapping do we have to use any header functions.
    Please through light on syntax etc.,of string functions in XSLT.
    Thanx in advance,
    Lokesh Dhulipudi
    Edited by: LOKESH DHULIPUDI on Dec 27, 2007 7:32 AM

    Hi,
    Hope you have gone thru this help:
    http://w3schools.com/xsl/default.asp
    Rgds, Moorthy

  • Wrong use of "Scan From String" function in a while loop?

    Hi,
    I've got a "Scan From String" function inside a while loop. On the first iteration it converts correctly the number passed by the input string (for example 4) But on the second one it has only spaces (one or more \s) as input string.
    I expected to obtain a zero as output (as it does always that it can not make any conversions, as I am supposed to) but indeed, i subtracts 1 from the previous number (according to the number indicated as example I would obtain a 3 as output)
    What's wrong with this?
    Does the function fails on this case?
    The rest of the diagram o the VI is expected to manage a 0 on that situation, like others in which the conversion is not made.
    Andres.

    I have simplified the VI evading calls to other VIs and trying to reproduce the mistake.
    The type of string I introduce to reproduce the mistake is:
    clock 3 (30) clock (40)
    Forgetting to introduce a number between the second "clock" and the following parenthesis, I would manage it programmatically with code that isn't included.
    Then "Scan From String" is supposed to do not make a conversion. But it leaves a 2 as output (in this example)
    I have realised, unbelievable but true, that it has matter with the number I substract to the output number (if it were 2, I would obtain 1 as output and so on)
    Excluding that, I got the conversion made before as output, 3, on the second time that "Scan From String" executes. But, how can this func
    tion as bad?
    I am using LV4 on an old PC. I have tried to reproduce it with LV6 and it works. But it isn't desirable for me, I would have to convert a lot of VIs and surely I will find a lot of errors due to the conversion (I have already tried)
    Attachments:
    EXTCLOCK.VI ‏26 KB

  • Essbase MDX - string functions are not working!

    Hi all!
    this MDX code works fine (LEN function):
    With
    member Scenario.MS1 as 'Len([Account].currentmember.member_name)'
    select { Scenario.MS1} on columns from http://Planing.Budget
    this code raises error (UPPER or any string function):
    With
    member Scenario.MS1 as 'Upper([Account].currentmember.member_name)'
    select { Scenario.MS1} on columns from http://Planing.Budget
    The administration tool I am using is for version 11.1.1.3 ..
    why? O_o
    Edited by: serzzzh on 14.10.2009 22:54

    Unless maybe if you're using J2ME and have very tight memory requirements (are you?) either an array or a Vector should be fine to hold 8000 strings.
    So I'm guessing, either:
    1) you're using J2ME, have a device with tight memory, in which case you probably need a redesign, either to move data off the device and into an online service or the like, or possibly to use the record db system that's in one of the J2ME profiles (although 8000 seems like a lot of stuff to put in such a small form factor device).
    2) the strings are in fact enormous, in which case array-or-vector isn't the issue
    3) there's some other problem. maybe you have a runaway recursive method or something.

  • Contains (String function) is not working in switch condition .

    Hi All ,
    I have a interface in which there are two projects.
    1 notification interface
    2 DFW interface .
    Project 1 Has Mediator in it where I am checking a Filter condition on DESTINATION PARTNER ID as below
    contains($in.request/inp1:TSOHoldCommon/inp1:Destination_Partner_ID,'DFW')
    as you all know this is the string function(containd) I have used.
    But there is a problem I am facing , when i use the same condition in DFW INTERFACE in all the switch conditions i have used .
    So now the problem is in switch condition used in BPEL of DFW INTERFACE.
    I have a asign statement after this condition,and i am getting assign pending so flow is faulting.
    please help me in this regard or give me any suggestions for fixing this .
    BPEL VERSION 1.1
    SOA 11.1.1.6

    Please post the error log which you are getting in EM.
    Thanks,
    Ashutosh

  • SD & FI BI functional Questions

    Hi Experts,
    I need to ask some questions to customer on SD & FI functional related questions for BI Analytical reports..
    Already cutomer implemented Data ware house Informatica with congnos reporting tool.
    right now they want to implement BI.
    please any one can share on what type functional questions could ask the customer.
    Advance Thanks,
    Bala.

    Hi,
    A few more pointers.
    Start with Reports. What the client is using. What he is expecting.
    If he got existing reports map the fields with Business Content BW Fields. Go to Business content and make a list of queries which are delivered from SAP. Explain them the KPI's. This should be good to start with. Also check the Tcodes they use.
    Look for DataSources that get data from theses Tcode's.
    Project Preparation (Initial stuff -- Do a conceptual review after this phase requirements gathering)
    Collect requirement thru interviews with Business teams /Core users / Information Leaders.
    Study & analyze KPI's (key figures) of Business process.
    Identify the measurement criteria's (Characteristics).
    Understand the Drill down requirements if any.
    Understand the Business process data flow if any.
    Identify the needs for data staging layers in BW – (i. e need for ODS if any)
    Understand the system landscape.
    Prepare Final Requirements Documents in the form of Functional Specifications containing:
    Report Owners, Data flow, KPI's, measurement criteria's, Report format along with drilldown requirements.
    Hope this helps.
    Thanks,
    JituK

  • [OT] User-Defined string Functions  Oracle PL/SQL

    Ladies and Gentlemen,
    I am pleased to offer the following string functions Oracle PL/SQL:
    GETALLWORDS(): Inserts the words from a string into the table.
    GETWORDCOUNT(): Counts the words in a string.
    GETWORDNUM(): Returns a specified word from a string.
    OCCURS(): Returns the number of times a character expression occurs within another character expression (including overlaps).
    OCCURS2(): Returns the number of times a character expression occurs within another character expression (excluding overlaps).
    PADC(): Returns a string from an expression, padded with spaces or characters to a specified length on the both sides.
    STRTRAN(): Searches a character expression for occurrences of a second character expression, and then replaces each occurrence with a third character expression. Unlike a built-in function Replace, STRTRAN has three additional parameters.
    STRFILTER(): Removes all characters from a string except those specified.
    RAT(): Returns the numeric position of the last (rightmost) occurrence of a character string within another character string (including overlaps). The search performed by RAT() is case-sensitive. RAT similar to the PL/SQL function INSTR.
    ATC(): Returns the beginning numeric position of the first occurrence of a character expression within another character expression, counting from the leftmost character (including overlaps). The search performed by ATC() is case-insensitive. ATC similar to the PL/SQL function INSTR.
    RATC(): Returns the numeric position of the last (rightmost) occurrence of a character string within another character string (including overlaps). The search performed by RATC() is case-insensitive. RATC similar to the PL/SQL function INSTR.
    AT2(): Returns the beginning numeric position of the first occurrence of a character expression within another character expression, counting from the leftmost character (excluding overlaps). The search performed by AT2() is case-sensitive. AT2 similar to the PL/SQL function INSTR.
    REPLICATE(): Returns a character string that contains a specified character expression repeated a specified number of times.
    ROMANTOARAB(): Returns the number equivalent of a specified character Roman numeral expression (from I to MMMCMXCIX).
    Plus, there are versions for MS SQL SERVER, SYBASE ASA, DB2, MS SQL SERVER 2005 SQLCLR.
    More than 8000 people have already downloaded my functions. I hope you will find them useful as well.
    For more information about string UDFs Oracle PL/SQL please visit the
    http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,54,33,29233
    Please, download the file
    http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,29233
    With the best regards.

    >
    I am using the Oracle Data Provider in vs2012. I am having trouble calling a function that returns an object type defined.
    >
    Returning a collection like that is a bad idea to begin with. That isn't scaleable and wastes memory.
    Either return a REF CURSOR and let the client FETCH the rows or use a PIPELINED function and let the client query it like they would a table.
    Here is an example similar to yours that uses a PIPELINED function.
    create or replace
        package pkg2
          as
            CURSOR emp_cur is (SELECT empno, ename, job, mgr, deptno FROM emp);
            type pkg_emp_table_type is table of emp_cur%rowtype;
            function get_emp(
                             p_deptno number
              return pkg_emp_table_type
              pipelined;
      end;
    create or replace
        package body pkg2
          as
            function get_emp(
                             p_deptno number
              return pkg_emp_table_type
              pipelined
              is
              begin
                  for v_emp_rec in (SELECT empno, ename, job, mgr, deptno
                                    FROM emp where deptno = p_deptno) loop
                    pipe row(v_emp_rec);
                  end loop;
              end;
      end;
    select * from table(pkg2.get_emp(20));
           EMPNO ENAME      JOB              MGR     DEPTNO
            7369 DALLAS     CLERK2          7902         20
            7566 DALLAS     MANAGER         7839         20
            7788 DALLAS     ANALYST         7566         20
            7876 DALLAS     CLERK           7788         20
            7902 DALLAS     ANALYST         7566         20

  • Supplementary characters and string functions

    I am using AL32UTF8 as my database character set and plan to store Japanese supplementary characters in the DB character set itself. Do I need to use any special string functions for these supplementary Japanese characters.

    With the AL32UTF8 character set, supplementary characters like any other characters, except that they are the widest (4 bytes). You just need standard multibyte processing.
    With AL16UTF16 (NCHAR), and depending on your needs, you may want to use certain SQL function variants that have 4 in their name: LENGTH4, INSTR4, SUBSTR4, LIKE4.
    When retrieving AL32UTF8 supplementary characters through JDBC or OCI in UTF-16 mode, you have to take care of the fact that one AL32UTF8 supplementary character becomes 2 UTF-16 code units (a surrogate pair). This is important for buffer allocations, length calculations, and any code that can split strings into substrings.
    -- Sergiusz

  • Sumifs function question

    Hi, Everyone, I have a function question of Sumifs, here a sample as follows,
    =SUMIFS(Budget :: E4:E14,Budget :: C4:C14,"=5003677000",Budget :: B4:B14,OR("=Transit","=Drawing cash")), according to the logic, I think like this, but it's wrong. So how to insert the OR function to the Sumifs function? May someone find the mistake in the function?
    Thank you.
    Alex

    I think you would actually do a sum of simifs, i.e. Sumif(....."Transit") + Sumif(....."Drawing Cash")
    Basically if you have two sumifs that differ in only one condition that would be treated like an OR in SQL, then make one Sumif for each unique set of  conditions and add them up
    Jason

  • OIC: Functional Question(11.5.10)

    Hi All,
    I would like to know answer for the following functional question in Oracle 11.5.10 Incentive Compensation Application(OIC). I would greatly appreciate if you anyone can reply for this.
    1. Question on Foreign currency exchange rates:
    We know that OIC cannot handle foreign currency exchange rates. Since all of our offer letters to the Sales guys are in local currency what we end up doing is picking an exchange rate on July 1st every year and converting them to US $. What I’m wondering is why couldn’t we just set them up in OIC in their local currency, without converting them?
    Is that possible? OIC can handle this?
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    a) Is that possible?
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    Thanks,
    Johnson
    Edited by: user10413783 on Jun 23, 2009 4:06 PM

    Hi Johnson,
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    Yes
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    You do not need to set up the dummy resource as employee. All you need is to create as OTHER type of resource and add that resource to group.
    Hope this helps.
    Thanks
    Srini

  • How to build a library of string functions?

    I want to create a set of my own special string functions. Trouble is I cannot create a class that extends String because it has been declared final. I want to be able to use the existing String functions as well as my own. Any ideas?
    Thanks in advance.

    Create a class that doesn't extend String. Use the String methods. You don't have to extend a class to use its methods. Example:public class LameUtility {
      public static char getFirstCharacter(String s) {
        return s.charAt(0);
    }

  • Overloading string functions

    hi everyone
    i have a doubt regarding overloading concept in strings .i need to know whether we can overload string functions in java.you can take any function available in the string class.
    regards
    kvikram

    The whole class of String is final, so you won't be able to inherit from it - and therefore, not overload any methods.
    String is one of these very special constructs in Java, which are not meant to be enhanced or costumized.

Maybe you are looking for

  • Error 22 in Photoshop Cs5

    Everytime i click on 'load files into stack' i get this error I'm using Windows 7 and have Photoshop Cs5.

  • Can't get Droid Charge to access my internet email

    I have Verizon/Yahoo email, which has a verizon.net address.  I just bought a Samsung Droid Charge and have tried to set up access to my email on the phone using the preloaded Verizon icon under email set up.  It just keeps saying that the attempt fa

  • Table of contents: Style and numbering

    Hi all, I've already found some information about the page numbers in the Toc here on the forum, so thank you for posting that. What I can't find is this: I've got my table of contents with the page numbers aligned to the right side. The toc consists

  • Why are messages are no longer free

    Messages to one of my friends are no longer free as they were.  I have checked that she is logged into iTunes and her iCloud accounts.  What more needs to be done to be able to exchange free messages?

  • Cannot tab out of contact first name field in CSXSRISR

    Hi, For some specific customers, we have this strange issue. If a value from LOV is chosen for the contact first name, last name or email, user cannot get out of the field. There is no error message. Unless the contact field is cleared, the user cann