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

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;

 
cross posting, thread1177-1405591

Please confine your question to one Oracle forum at Tek-Tips;
people reading them will be mostly the same.
And in your other thread you stated that it is a problem of Oracle 10g. [ponder]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top