Help write PL/SQL queries using Oracle Database (please format your syntax to wo
ID: 3665724 • Letter: H
Question
Help write PL/SQL queries using Oracle Database (please format your syntax to work with Oracle!)
There's a template below I've included that is the template I have to use.
Please follow up: I will comment if there are any syntax errors or wrong outputs. I will also rate 'thumbs up' if you are correct.
Specific Database Information: http://imgur.com/a/i1HQy (Link to my Imgur album, including DESC/SELECT * of each 5 tables)
Question (please don't alter it in any way):
The image you are requesting does not exist or is no longer available mgur comExplanation / Answer
This program connects to Oracle, prompts the user for an employee number, queries the database for the employee's name, salary, and commission, then displays the result. The program ends when the user enters a zero employee number.
Sample Program 2: Cursor Operations
This program connects to Oracle, declares and opens a cursor, fetches the names, salaries, and commissions of all salespeople, displays the results, then closes the cursor.
Sample Program 3: Fetching in Batches
This program logs on to Oracle, declares and opens a cursor, fetches in batches using arrays, and prints the results using the subroutine PRTRES.
Sample Program 4: Datatype Equivalencing
After connecting to Oracle, this program creates a database table named IMAGE in the SCOTT account, then simulates the insertion of bitmap images of employee numbers into the table. Datatype equivalencing lets the program use the Oracle external datatype LONG RAW to represent the images. Later, when the user enters an employee number, the number's "bitmap" is selected from the IMAGE table and pseudo-displayed on the terminal screen.
Sample Program 5: Oracle Forms User Exit
This user exit concatenates form fields. To call the user exit from a Oracle Forms trigger, use the syntax
where user_exit is a packaged procedure supplied with Oracle Forms and CONCAT is the name of the user exit. A sample CONCAT form invokes the user exit. For more information about Oracle Forms user exits, see Chapter 11 of the Programmer's Guide to the Oracle Precompilers.
Note: The sample code listed is for a Oracle*Forms user exit and is not intended to be compiled in the same manner as the other sample programs listed in this chapter.
Sample Program 6: Dynamic SQL Method 1
This program uses dynamic SQL Method 1 to create a table, insert a row, commit the insert, then drop the table.
Sample Program 7: Dynamic SQL Method 2
This program uses dynamic SQL Method 2 to insert two rows into the EMP table, then delete them.
Sample Program 8: Dynamic SQL Method 3
This program uses dynamic SQL Method 3 to retrieve the names of all employees in a given department from the EMP table.
Sample Program 9: Calling a Stored Procedure
Before trying the sample program, you must create a PL/SQL package named calldemo, by running a script named CALLDEMO.SQL, which is supplied with Pro*FORTRAN and shown below. The script can be found in the Pro*FORTRAN demo library. Check your Oracle system-specific documentation for exact spelling of the script.
The following sample program connects to Oracle, prompts the user for a department number, then calls a PL/SQL procedure named get_employees, which is stored in package calldemo. The procedure declares three PL/SQL tables as OUT formal parameters, then fetches a batch of employee data into the PL/SQL tables. The matching actual parameters are host tables. When the procedure finishes, row values in the PL/SQL tables are automatically assigned to the corresponding elements in the host tables. The program calls the procedure repeatedly, displaying each batch of employee data, until no more data is found.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.