INDEX - CR/LF
Chris Sharman
Chris.Sharman@ccagroup.co.uk
Tue, 3 Oct 2000 11:31:59 +0100
>In Oracle I have a field declared as long, containing lines of text separated with
>CR/LF.
>I need to split this field into separate fields, one for each of the first 3 lines.
>I was hoping this could be done this way;
>
>DEFINE CRN INTEGER SIZE 2 = 13
>DEFINE CRC CHARACTER SIZE 1 = CHARACTERS(CRN) 2:1
>DEFINE CRINDX INTEGER SIZE 2 = INDEX(TEXT,CRC)
>DEFINE LINE1 CHARACTER SIZE 60 = TEXT 1:CRINDX -1
>......
>
>but the CRINDX is always 0, indicating that the CRC was not found.
crc should be characters(crn)[2:1] on big-endian machines (most), or [1:1] on
VMS - you don't say what platform you're on.
The square brackets are missing from your posted code, for crc and line1.
Don't know Oracle: is "a field declared as long" text or numeric ? It must be
text for your code sample to make any sense at all.
Aside from that, your code is correct & should work. If it doesn't, then the
text field doesn't have ascii CR in it: possibly just lf, or ebcdic or
something weird.
Chris
_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk http://www.ccagroup.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
-----------------------------------------------------------------------
The opinions expressed are those of the individual and not the company.
Internet communications are not secure and therefore the company does
not accept legal responsibility for the contents of this message. If
the reader of this message is not the intended recipient, or the
employee responsible for delivering this communication to the intended
recipient, you are hereby notified that any disclosure, distribution or
copying of this communication is strictly prohibited.
* This message has been processed by MailGuard SMTP from NET-TEL
* Computer Systems Ltd. See <http://www.mailguard.co.uk>.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.