Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Checking the Resultant is Numeric or not in PL SQL

User_FRTCMApr 17 2014 — edited Apr 18 2014

Hi,

I am doing this VB project where I am migrating codes from VB to PL SQL constructs. I have a doubt here, I want to know how to write the below piece of code in PL SQL construct.

IF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = TRUE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = TRUE) THEN

      GETCPL := '0' || SUBSTR(RST2(3), 4, 4);

ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = FALSE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = TRUE) THEN

      GETCPL := '0' || SUBSTR(RST2(3), 3, 1) || SUBSTR(RST2(3), 5, 3);

ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = FALSE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = FALSE) THEN

      GETCPL := '0' || SUBSTR(RST2(3), 3, 2) || SUBSTR(RST2(3), 6, 2);

ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = TRUE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = FALSE) THEN

      GETCPL = '0' || SUBSTR(RST2(3), 4, 4);

END IF;

In VB basically it means that the resultant is numeric, any such function to check the same in SQL construct ?

Thanks

Mrinal (mridulmrinal@gmail.com)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2014
Added on Apr 17 2014
7 comments
3,825 views