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!

Create a Function with Random Social Security Number With Dashes

Dj SteeleDec 3 2017 — edited Dec 8 2017

Hello,

I am building a Simple Transactions App utilizing APEX 5.1 ; This question is more in Regards to SQL and Creating a Function "RANDOM"

but implementing a To_Char Character String to implement "Dashes" into Random SS# (Column : Social_Security_Number DataType: Varchar2(11) )

The purpose is to generate Random Numbers Utilizing If..Then Block

begin

if :P4\_CUSTOMER\_ID is null then

    select "#OWNER#".F\_RANDOM

      into :P4\_CUSTOMER\_ID

      from sys.dual;

end if;

end;

**********************************************************************************************************************************************************************************

See Function Below Here is the String looking to implement into Function to Create Random SS#

SELECT TO_CHAR(012345678, '000g00g0000','nls_numeric_characters=.-') ssn from dual; SSN ----------- 012-34-5678

pastedImage_0.png

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2018
Added on Dec 3 2017
23 comments
3,488 views