Sawadee Posted January 7, 2017 Posted January 7, 2017 Hello everyone, today we will be looking at PL/SQL the basic syntax into the SQL programming language.PL-SQL is a block-structure language.. this means that the actual program that you write is splitted into diffirent parts.Every PL/SQL block is split into 3 parts: Declarations Executable Commands Exception Handling The declaration section will start with the keyword DECLARE this section is not required as you don't always need variables in your PL/SQL program.The Executable section is enclosed between The BEGIN and the END. this section is required as this is the core of your SQL program.A simple example of a PL/SQL program: DECLAREmessage varchar2(20) := 'Hello MaxCheaters;BEGINdbms_output.put_line(message);END; As you see in the exampe, we decalre a variabele called message as a varchar with a length of 20. the := means that your gonna give the variabele a value, 'Hello MaxCheaters' in our example. Dbms_output.put_line(); dbms_output.put_line(); will print a line, as of our example, the dbms_output.put_line() has a variabele passed within the () which holds our text. The dbms will show 'Hello MaxCheaters' in our sql terminal. You can compare the dbms_output.put_line() with a System.out.println() or a Console.writeLine(); in java or C#. Cheers! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.