Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing a String (10g)

Status
Not open for further replies.

fibonaccii

Technical User
Sep 5, 2007
14
CA
I have come accross a roadblock. I need to parse a string that is passed to a variable. I need to parse two seperate strings from one string to be compared.

The 1st string to be parsed can have either 6,7,or 8 characters in the initial part of the string. The second is always constant to '5-4' characters, whish is to be distinguished from the 1st.

String Ex: 1) 123456..-12-CON or 2) 12345-1234

Currently my Stored Procedure looks something as below which only takes care of the 2nd string:

L_DEPT_CODE := substr(inpdata,1,5);
L_ACC_CODE := Substr(inpdata,7);

Begin

SELECT ACC_NAME, DEPT_NAME
INTO L_ACCOUNT_NAME,L_DEPT_NAME
From DA.ACCDEP_TABLE@TC10 A, DA.ACCOUNT@TC10 B, DA.DEPT@TC10 C
WHERE A.ACC_CODE = L_ACC_CODE
AND A.DEPT_CODE = L_DEPT_CODE
AND A.DEPT_CODE = C.DEPT_CODE
AND A.ACC_CODE = B.ACC_CODE;
 
fib,

can you please be a little more explicit. Is the first value to be parsed 6-8 characters, or 6-8 integers? I want to find out if the values can be distinguished by choosing just numbers.

Is there always a hyphen "-" between the first and second parts?

Is your problem separating the parts of the string, or plugging the separated parts into a stored procedure?

Grinding away at things Oracular
 
Hey Tharg,

Thanx for the concern but I got the issue related to the Parsing of a string figured out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top