Assume that you have a product code that has the following format: XXXXNNN  Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero).     Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be:    Product Name is: ABC  Serial Number is: 031    Hints: Use the following functions if needed:  instr( string1, string2 [, start_position [, nth_appearance ] ] )  substr( string, start_position, [ length ] )  length( string )  DBMS_OUTPUT.PUT_LINE( )

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 2.11CP
icon
Related questions
Question

Assume that you have a product code that has the following format: XXXXNNN 

Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero).  

 

Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be: 

 

Product Name is: ABC 

Serial Number is: 031 

 

Hints: Use the following functions if needed: 

  • instr( string1, string2 [, start_position [, nth_appearance ] ] ) 
  • substr( string, start_position, [ length ] ) 
  • length( string ) 
  • DBMS_OUTPUT.PUT_LINE( ) 

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Data Binding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr