SQL SPLIT STRING

I wanted to know if it would be possible to do something like this in t-sql.
I want to create a stored procedure which takes a list of invoice numbers and uses it as a parameter for my stored procedure
PARAMETER = @INVOICES NVARCHAR
UPDATE INVOICES SET STATUS = 'INVOICE' WHERE INVOICE IN(@INVOICES)
and in my c# code I will fill the parameter with a list of invoices separated by a comma I need those to be able to go in the IN of the update command but the problem is that the invoice column is an int column so it doesn't recognize all the invoices with
the comma in middle.
Debra has a question

I will go one step further. Do not use XML and make the maintenance programmer have to learn XML, maintain XML when it changes, etc.  Mixed languages are a disaster. My favorite was the MOD() function in procedural languages; Pascal FORTRAN, BASIC favors,
etc. all defined non-integers and non-positive parameters differently! Yet, you would think that a basic math function would be the same. 
The TVP is nice, but proprietary. When SQL/PSM gets it so it will port, I migfht use it. 
I prefer to use the long parameter list so I get all the benefits of the SQL engine, save disk access and give the optimizer something.
https://www.simple-talk.com/sql/learn-sql-server/values()-and-long-parameter-lists/
https://www.simple-talk.com/sql/learn-sql-server/values()-and-long-parameter-lists---part-ii/
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

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...

  • Split string into new column

    Hi All,
    Hoping you are able to help.
    I have a table of approx 16 items that I need to split,
    EG:
    CUSTOMER ACCEPTANCE - HAS BEEN DECLINED - DO NOT APPLY TO ACCOUNT
    CUSTOMER ACCEPTANCE -  HAS BEEN ACCEPTED - APPLY TO ACCOUNT
    CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED - RAISED IN PORTAL
    ESCALATION - RAISED - PENDING
    ESCALATION - NOT RAISED - STILL TO BE PROCESSED
    I need to Keep the first two sections, eg CUSTOMER ACCEPTANCE - HAS BEEN DECLINED in one column, and split off the remaining, eg DO NOT APPLY TO ACCOUNT into a new TEMP table to insert as a column into an existing table.
    With little SQL experience, I am having difficulties as they are all of different lengths / criteria etc. Some have 3 hyphens whilst others have 4+
    Is anyone able to help point me in the right direction with this request? I will be greatly appreciated.
    Kind Regards,
    BTMMP

    If you're trying to do this all in a SQL query or stored procedure, then you'll probably get better results on the SQL Server forums. However, if you're working with a PowerShell or VBScript that's doing the work, you're in the right place.
    Here's one example of how you could do what you're describing.  By the way, what do you want to do with the string "CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED - RAISED IN PORTAL"?  Should that be split into "CUSTOMER ACCEPTANCE
    - PENDING DECLINE" and "ESCALATION REQUIRED - RAISED IN PORTAL", or "CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED" and "RAISED IN PORTAL"?
    (In other words, should the script only split off whatever's after the final hyphen, or should it grab the first two pieces of text and split off everything else?)
    Here's an example in PowerShell which assumes that you want to separate out all text after the final hyphen in a string.  It uses a regular expression, though you could accomplish the same thing with Split, Join and Trim operations, if you prefer.
    $string = 'CUSTOMER ACCEPTANCE - HAS BEEN ACCEPTED - APPLY TO ACCOUNT'
    if ($string -match '(.*?)\s*-\s*([^-]*)$')
    $split = $matches[1], $matches[2]
    else
    $split = $string, ''
    Write-Host "Original String: $string"
    Write-Host "First Text : $($split[0])"
    Write-Host "Second Text : $($split[1])"

  • ORA-00604:error occurred at recursive SQL level string

    Hi all,
    Oracle Version :- 11.2.0.2
                   I found a error in a trigger(Statement Level)
    ORA-00604:error occurred at recursive SQL level string.
    Before Finding this issue,Once the DB Response was slow . Will this be the issue Of DB Slow response. The Above trigger fires for each entry in an transaction table.
    The code is Patched and was executed . The above issue was found during another issue and not the DB Slow response.
    My Doubt is Whether DB response slow issuewould be because of this. Now after fixing this Slow response was not reported.
    Your inputs are highly appreciated.

    it helps if you can post the complete stack of error messages (I'm suspecting you have several more messages than just ORA-00604).
    A cut-n-paste of the SQL*Plus session with the SQL statement and the error message(s) below would give the info as to what the actual problem is.
    Do you have INSERT priv. on that table? Are you doing this from within a stored procedure or at SQL prompt?

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • HELP URGENT:; Splitting strings in servlets

    hi ...
    I am trying to access the below servlet from another servlet in iplanet . I have to access a file and arrange the '|' delimited data in the file in a table format like in html ...
    I have used my own function inside the servlets which splits a string based on character ...But I always get
    Internal error: exception thrown from the servlet service function (uri=/servlet/ReportsDataServlet): java.lang.NullPointerException, Stack: java.lang.NullPointerException
    at ReportsDataServlet.split(ReportsDataServlet.java:82)
    at ReportsDataServlet.doPost(ReportsDataServlet.java:56)
    at ReportsDataServlet.doGet(ReportsDataServlet.java:14)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
    at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:483)
    The sample code is shown below....I get the same error when i tries with stringokenizer as well....Pls help me fix this.....
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, Se
    rvletException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    cont=getServletContext();
    out.println("<html><head><title>Reports Data</title></head><body bgcolor=DBD0E2>");
    String repType = request.getParameter("Rep");
    String mon = request.getParameter("month");
    String day = request.getParameter("day");
    String year = request.getParameter("year");
    String repName = repType+"."+mon+"-"+day+"-"+year+".txt";
    BufferedReader in = new BufferedReader( new FileReader("/home/lnayar/baais/xmlServlet/"+rep
    Name));
    String st;
    st = in.readLine();
    cont.log(st);
    int c =0;
    out.println("<table border=\"3\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\"><tr><td>L
    ATA</td><td>WC CLLI</td><td>WC NAME</td><td>ADSL_LOCATION</td><td>ATM FLAG</td><td>ATM RELIEF DATE</td><t
    d>FRAME FLAG</td><td>FRAME RELIEF DATE</td><td>GOLD FLAG</td><td>GOLD RELIEF DATE</td><td>OVERLAY INDICAT
    OR</td><td>COUNT</td></tr>");
    while (st != null)
    c++;
    st = in.readLine();
    StringTokenizer stt = new StringTokenizer(st);
    out.println("<tr>");
    while (stt.hasMoreTokens())
    //out.println("<td>"+stt.nextToken("|")+"</td>");
    out.println("<td>hello</td>");
    out.println("</tr>");
    while (st != null)
    c++;
    st = in.readLine();
    out.println("<tr>");
    Enumeration en = split(st,"|");
    while(en.hasMoreElements())
    out.println("<td>"+en.nextElement()+"</td>");
    out.println("</tr>");
    cont.log("out while");
    out.println("</table>");
    out.println("</body></html>");
    public Enumeration split (String str, String delim)
    Vector v = new Vector();
    int pos_1;
    int pos_2;
    //Set initial delimiter positions...
    pos_1 = 0;
    pos_2 = 0;
    //Start chopping off bits from the string
    //until left boundary reaches the length of string
    while ( pos_1 <= str.length() )
    pos_2 = str.indexOf(delim, pos_1);
    if ( pos_2 < 0 )
    pos_2 = str.length();
    String sub = str.substring (pos_1, pos_2);
    pos_1 = pos_2 + 1;
    v.addElement(sub);
    return v.elements();
    d deeply appreciate if soeone could take a look at the code and tell me exactly where i am going wrong ..... Its URGENT ...
    Thx
    klv

    But there is the while statement which filters null
    values..Which is useless in your case, because you proceed to change the value of st to something else which you don't check for null.
    At any rate, what you have to do is this:
    1. Look at the stack trace to find the line number where the error occurs.
    2. Look at that line in your code.
    3. Look at each object variable in that line. Find out how it became null and fix that.

  • How to make Multiple parameters to sql query string seperated by ,(comma) ..

    Hi,
    I would like to konw how I can make multiple parameters to sql query string seperated by ,(comma)  ..
    For example, this parameters can be printed like 'abc,dde,ggf,eeg' ,once I use  "join(Parameters!rpCode.Value,",")" with report builder , 
    By the way, when I test this multiple parameters by Query Designer of report builder there was no problem,.(using Define query parameters, I put abc,dde,ggf,eeg)
    however, when I run this report , it won't be executing ,  with (rsErrorExecutingCommand)
    Plz, help me....

    If its sql query then it should like this
    Select t.*
    from table t
    inner join dbo.ParseValues(@Parameters,',')f
    on f.val = t.ID
    ParseValues can be found him
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    or easier way is
    Select t.*
    from table t
    where ',' + @Parameters + ',' LIKE '%,' + CAST(t.ID AS varchar(10)) + ',%'
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • FM for to split string

    Hi All,
    Is there a FM available which can split string based on seprator e.g ABC XYZ needs to be separated using space delimeter.
    Thanks!
    Prakash D. Naik

    if you dont know the number of occurrences of the delimeter you can use the following code.
    data: source type string ,
          target type standard table of string .
    source = 'This is for test.' .
    split source at ' ' into table target .
    Regards
    Raja
    PS Kindly post ABAP related questions at
    ABAP Development

  • Java.sql.SQLException: String index out of range: -8

    Hi Folks,
    I am experiencing the following error in my application and can't seem to fine where the error is occuring. Please help.
    java.sql.SQLException: String index out of range: -8
         at sanchez.jdbc.dbaccess.ScDBError.check_error(Unknown Source)
         at sanchez.jdbc.driver.ScPreparedStatement.executeQuery(Unknown Source)
         at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205)
         at etrade.persistance.framework.dataaccess.request.SQLPreparedStatementRequestBuilder.sendRequest(Unknown Source)
         at etrade.persistance.framework.dataaccess.request.Request.sendRequest(Unknown Source)
         at etrade.persistance.framework.dataaccess.transactions.Transaction.executeTrxn(Unknown Source)
         at etrade.persistance.components.ComponentSupport.executeTrxn(Unknown Source)
         at etrade.services.atmdebitsrv.ProcessCardComponent.execute(ProcessCardComponent.java:53)
         at etrade.services.atmdebitsrv.ProcessCardBindingImpl.processCard(ProcessCardBindingImpl.java:12)
         at etrade.services.atmdebitsrv.ProcessCardBindingSkeleton.processCard(ProcessCardBindingSkeleton.java:56)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
         at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
         at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
         at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
         at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
         at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:568)

    Please post us the code for us to debug.

  • Split String at delimiter into table.

    Hi Experts,
    I have a requirement wherein i need to split aaaa#bbbbbbbbbbbb#ccc#dddddddddddddddddddddd#e# into internal table as below:
    Header 1
    Header 2
    1
    aaaa
    2
    bbbbbbbbbbbb
    3
    ccc
    4
    dddddddddddddddddddddd
    5
    e
    how can this be done.
    Thanks & Regards,
    Anil

    Hi Ashok,
    split <string> at '#' into table it.  -Doesn't work
    split <string> at SPACE into table it. - Works
    But same statement with '#' is not working.
    Feeling strange.
    Thanks,
    Anil

  • Programmatically setting SQL Query string?

    Post Author: JoeM
    CA Forum: Data Connectivity and SQL
    Hi,
    I recently updated to Crystal Reports 11 from 8.5 and am having some problems getting my reports to properly function.  I need to set the SQL query string in the report at runtime in our C++ based program when the user selects what report they want to print.  So to do this I first open the report and connect to our database and that works fine, here is the code for that - 
    pReport = pCRPApp->OpenReport(TmplFName, dummy) ;
    pReport ->Database->LogOnServer("crdb_odbc.dll", ODBC_FILEDSN, DatabaseName, DatabaseUsrNm, DatabasePwd);
    but when I use PutSQLQueryString to set the custom sql query that I've made it does not appear to work because when I use GetSQLQueryString right after that, the returned string is not the one I just set. Here is the code for that part -
    pReport->PutSQLQueryString(SQLExprBuf);
    sprintf(TestSQL, pReport->PutSQLQueryString());
    TestSQL is not the same as SQLExprBuf
    So my question is how do I properly set the SQL query string programmatically, is there some setting in my report that needs to be turned on or am I using the wrong function?  I read somewhere that you can use the Add command option in the report to set the query string as well, is there a way to programmatically do that?

    In Access create a View showing the information you want, then in design mode click View, SQL to see teh SQL you need. now make sure the SQL you build in VBA is exactly the same. so in the Immediate window type a ? then copy paste your code then press Enter
    to see the result, EG:
    ?"UPDATE Lan_landmeter " _
            & "SET OpleidingsBedrijf =" & bedrijf & " ,Opleiding_startdatum =#" & startdatum & "#,Opleiding_einddatum =#" & einddatum & "#,Aantal_opleidingsuren_vast=20,Aantal_gevolgde_uren
    =" & gevolgde_uren & ",Aantal_resterende_uren=0" _
            & "WHERE  Id_landmeter =" & naam & ""
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • SCOM 2012 - SQL Connection strings

    Hey SCOM gurus
    Wonder if you can help?
    I need to change my SCOM 2012 Management Server 'SQL Connection strings' to use a load balancer dns name of 'sql-listener'. Can anyone suggest how this might be done? (basically we now have a SQL 2014 Cluster in the background).
    thanks
    Karen

    Hello,
    You must change the database name in the registry, more information : https://technet.microsoft.com/en-us/library/hh278848.aspx?f=255&MSPPError=-2147217396

  • Split String into two

    HI,
    How to Split String into two parts at delimiter

    HI,
    REPORT ZSTRING.
    DATA: LENGTH TYPE I,    
          REMAINING_LENGTH TYPE I ,   
          NEXT_POINTER TYPE I    ,   
          FIRST_HALF(20)  TYPE C ,    
          SECOND_HALF(20) TYPE C ,    
          TEMP TYPE I .
    PARAMETER: WORD(35) TYPE C . "INPUT WORD
    START-OF-SELECTION.
    LENGTH = STRLEN( WORD ).      "Length of the input String
    SEARCH WORD FOR '/'.
        IF SY-SUBRC = 0 .  
          IF SY-FDPOS > 0.   
          MOVE WORD+0(SY-FDPOS) TO FIRST_HALF.  
          ENDIF.  
       TEMP = SY-FDPOS + 1. 
       IF TEMP <> LENGTH.    
       NEXT_POINTER = SY-FDPOS + 1.    
       REMAINING_LENGTH = ( LENGTH - SY-FDPOS ) - 1.    
       MOVE WORD+NEXT_POINTER(REMAINING_LENGTH) TO SECOND_HALF.  
       ENDIF.
    ENDIF.
    WRITE:/'Input String:', WORD .
    WRITE:/'First  Half:', FIRST_HALF.
    WRITE:/'Second Half:', SECOND_HALF.
    *-- End of Program
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Function module to split strings

    Hi,
    I have a string value ' DBTABLE-FIELDNAME'. I need to split this into 2 strings - The first one is the database table name and the second one is the fieldname. So, the character '-' is the point where the split needs to be done. How can this be achieved. Any FM that I could use?
    Thanks for your help!
    Regards,
    Divyaman Singh Rawat

    Use FM 'STRING_SPLIT'
    REPORT ZEXAMPLE.
    DATA: V_HEAD(10), V_TAIL(10).
    PARAMETERS: P_STR(20),
                P_DEM.
    CALL FUNCTION 'STRING_SPLIT'
         EXPORTING
              DELIMITER = P_DEM
              STRING    = P_STR
         IMPORTING
              HEAD      = V_HEAD
              TAIL      = V_TAIL
         EXCEPTIONS
              NOT_FOUND = 1
              NOT_VALID = 2
              TOO_LONG  = 3
              TOO_SMALL = 4
              OTHERS    = 5.
    IF SY-SUBRC EQ 0.
      WRITE:/ 'HEAD:', V_HEAD,
            / 'TAIL:', V_TAIL.
    ELSE.
      WRITE:/ 'ERROR SPLITTING STRING'.
    ENDIF.
    Regards,
    Joy.

  • Split string into two based on end of word and max length

    I have the following procedure, which is passed a comma separated string as it input, and it has to split it into two, and the split has to occur at the end of a word, and the first split part can't be more than 15 in length.
    Is there an more efficient way of achieving this? I have a loop in my main code that calls this procedure and in effect a nested loop has been created here.
    e.g. Hello, everyone, welcome, to, split, string' would be split into 'Hello' and 'everyone, welcome, to, split, string'
    create or replace procedure split_str
                   (pi_str  in  varchar2,
                    po_str1 out nocopy varchar2,
                    po_str2 out nocopy varchar2) is
      i number;
    begin
      if (len(pi_str) <= 15) then
        po_str1 := pi_str;
        po_str2 := NULL;
      else
        i := 1;
        loop
          exit when len(SUBSTR(pi_str, 1 ,INSTR(pi_str, ',', 1, i)-1)) > 15;
          po_str1 := SUBSTR(pi_str, 1 ,INSTR(pi_str, ',', 1, i)-1);
          po_str2 := SUBSTR(pi_str, INSTR(pi_str, ',', 1, i)+2);
          i := i+1;
        end loop;
      end if;
    end split_str; 

    You want to find the last space character before the 15th character.
    x := INSTR ( SUBSTR ( pi_str, 1, 15) , ' ' , -1)Then the first string is SUBSTR(pi_str,1,x) and the second string is SUBSTR(pi_str,x+1)

Maybe you are looking for

  • I don't know what to do.

    I'm not sure wether this is the right spot to post this or not because this is my first time posting here. I've had my Video Ipod since Feb of this year and have barely been able to use it. During around July my Ipod froze up and wouldnt even turn on

  • Why does my iPad 2 no longer work on Apple TV? My iPhone 5 works fine.

    When I try to use Apple TV with my iPad, it starts then stops after a few seconds. The Apple TV is working fine as it works with my iPhone 5.

  • Page break doesn't work in my BI Publisher template

    Hi! I have been to build a RTF template in Word. My BI Publisher version is 10.1.3.4. In my template I have three conditional groups (for-each-group) and I would like to do a page break in each of them. My template is something like this: group ROW b

  • Server-Side email Script Needed

    I have a fill-in pdf form on my website. I want the user to submit the form to me via email. I need a cgi (or php) script to do do this

  • Error in price change

    Hello, I keep getting this error when tying to change material price using MR21: "Account 7201013 requires an assignment to a CO object." Help is appreciated. Regards