Found 21 Articles for PL/SQL

Count no. of characters and words in a string in PL/SQL

Sunidhi Bansal
Updated on 15-May-2020 10:21:54

2K+ Views

We are given a string of any length and the task is to calculate the count of characters and words in a string using PL/SQL.PL/SQL is a combination of SQL along with the procedural features of programming languages.It was developed by Oracle Corporation in the early 90's to enhance the capabilities of SQL. PL/SQL is one of three key programming languages embedded in the Oracle Database, along with SQL itself and Java.In PL/SQL block, we have DECLARE block which is used to declare the variables used in programming and we have BEGIN block where we write the logic for the ... Read More

Convert distance from km to meters and centimeters in PL/SQL

Sunidhi Bansal
Updated on 15-May-2020 08:27:43

406 Views

The task is to convert the distance from kilometers to meters and centimeters in PL/SQL.PL/SQL is the extension of SQL which combines the Data manipulation of SQL with the working of procedural language.According to the problem we should have distance in kilometers whose value we have to convert in meters and centimeters.As per the conversion rule −1km = 1000 meters1km = 100000 centimetersAccording to this conversion rule we want the distance to be converted by a logic in PL/SQL.ExampleInput: kilometer = 10 Output: meter = 10000    Centimeter = 1000000 Input: kilometer = 9 Output: meter = 9000    Centimeter ... Read More

Database Wars: MSSQL Server, Oracle PL/SQL and MySQL

Samual Sam
Updated on 16-Jan-2020 07:56:19

2K+ Views

With so many databases in the market, the mind wars have begun and it is the right time to understand the difference and importance of top 3 relational databases in the market – Microsoft SQL Server, Oracle PL/SQL, and MySQL. The relational database management systems have currently become the backbone of the industry and with so many options available, it is difficult to figure out which one to choose.The relational database management systems was introduced in 1980’s. This article is focussing on exploring the history and features of three popular RDBMS in the industry: Microsoft SQL Server, Oracle, and MySQL. ... Read More

Difference between SQL and PL/SQL

Mahesh Parahar
Updated on 27-Nov-2019 07:32:03

14K+ Views

SQL, Structural Query Language is a standard database language which is used create, maintain and retrieve the relational database whereas PL/SQL, Procedural Language extension to SQL, it extends SQL and provide it procedural capabilities.Following are the important differences between SQL and PL/SQL.Sr. No.KeySQLPL/SQL1DefinitionSQL, is Structural Query Language for database.PL/SQL is a programming language using SQL for a database.2VariablesSQL has no variables.PL/SQL has variables, data types etc.3Control StructuresSQL has no FOR loop, if control and similar structures.PL/SQL has FOR loop, while loop, if controls and other similar structures.4OperationsSQL can execute a single operation at a time.PL/SQL can perform multiple operation at ... Read More

Check if a number is Palindrome in PL/SQLs

Arnab Chakraborty
Updated on 27-Sep-2019 10:42:03

7K+ Views

In this section we will see how to check whether a number is Palindrome or not using the PL/SQL. In PL/SQL code, some group of commands are arranged within a block of related declaration of statements.A number is palindrome if the number, and the reverse of that number are same. Suppose a number 12321, this is palindrome, but 12345 is not a palindrome.ExampleDECLARE    n number;    m number;    temp number:=0;    rem number; BEGIN    n :=12321;    m :=n;    while n>0    loop       rem := mod(n, 10);       temp := (temp*10)+rem; ... Read More

Check if a given year is leap year in PL/SQL

Arnab Chakraborty
Updated on 27-Sep-2019 07:46:15

2K+ Views

Here we will see how to check given year is leap year or not, using PL/SQL. In PL/SQL code, some group of commands are arranged within a block of related declaration of statements.The leap year checking algorithm is like below.AlgorithmisLeapYear(year): begin    if year is divisible by 4 and not divisible by 100, then       it is leap year    else if the number is divisible by 400, then       it is leap year    else       it is not leap year endExampleDECLARE    year NUMBER := 2012; BEGIN    IF MOD(year, 4)=0   ... Read More

Program for Fibonacci numbers in PL/SQL

Sunidhi Bansal
Updated on 20-Sep-2019 14:39:12

9K+ Views

Given with ‘n’ numbers the task is to generate the fibonacci numbers in PL/SQL starting from 0 to n where fibonacci series of integer is in the form0, 1, 1, 2, 3, 5, 8, 13, 21, 34Where, integer 0 and 1 will have fixed space, after that two digits are added for example, 0+1=1(3rd place) 1+1=2(4th place) 2+1=3(5th place) and So onSequence F(n) of fibonacci series will have recurrence relation defined as −Fn = Fn-1 + Fn-2 Where, F(0)=0 and F(1)=1 are always fixedPL/SQL is an Oracle product which is a combination of SQL and Procedural language(PL) introduced in early ... Read More

Print pyramid of tutorialspoint in PL/SQL

Sunidhi Bansal
Updated on 09-Aug-2019 06:19:06

711 Views

PL/SQL stands for “Procedural Language extension to SQL” . It is the mixture of SQL and Procedural features provided by programming language. It was developed by Oracle Corporation in the late 1980s as procedural extension language for SQL and the Oracle relational database.PL/SQL programs consists of blocks that can be nested and a block structure look likes this −DECLARE    -- it contains declaration statements BEGIN    -- It contains executable statements EXCEPTIONS    -- It contains exception handling statements END;ExampleIn PL/SQL single-line comments begin with double hyphen(--) and Multi-line comments begin with a slash-asterisk ( /* ) and end ... Read More

How to use SUM function for NUMC type field?

Johar Ali
Updated on 30-Jul-2019 22:30:20

497 Views

NUMC is numeric text. As this is text, SUM function cannot be implemented as it is of type varchar in the database.There is no simple solution to do it. The one method is to copy the data to internal tables, convert the NUMC data into DEC by looping through all the rows, SUM and GROUP them and then convert back the DEC values back to NUMC values.

Can’t create a Dictionary Object: View by adding two db tables

Amit Sharma
Updated on 30-Jul-2019 22:30:20

69 Views

When you create a view, it is created on top of multiple database tables using an inner join. Note that basis table of database views should be transparent tables.To create a view on 2 tables, you have to enter the primary table you want to maintain and place the cursor in that field and click on the button below the list of tables and select the other table to add the view. If you are not getting this option, it means Relationship is wrong.To know more about database Views: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenddic_database_views.htmRead More

Advertisements