There Is a Better Way 3 – Resilient Software and PL/SQL

Example 1-2 illustrates a slightly different style of writing PL/SQL, which might be more familiar to developers used to mainstream languages. Again, some comments (which start with the characters “–”) are added to help in understanding it. As before, try to figure out what the code is doing before reading on. Example 1-2. A more […]

Understanding the Need for a PL/SQL Learning and Development Environment – Resilient Software and PL/SQL

Understanding the Need for a PL/SQL Learning and Development Environment As with other programming languages, PL/SQL code should be written and maintained using some sort of software tool. The tool I’ll be using in the book is the venerable SQL Developer from Oracle, which has many powerful features. SQL Developer will be introduced in the […]

Getting Started with Docker 3 – Installation of a Containerized Oracle Database Instance and SQL Developer

Example 2-3. Checking the log for the container again Prepare fordboperation8%completeCopyingdatabasefiles31%completeCreatingandstartingOracleinstance 32%complete 36%complete 40%complete 43%complete 46%completeCompletingDatabaseCreation When the container creation is complete, you should see log content similar to Example 2-4. Example 2-4. Checking the log for the container one last time ALTERSYSTEMSETlocal_listener=”SCOPE=BOTH;ALTERPLUGGABLEDATABASEORCLPDB1SAVESTATECompleted:ALTERPLUGGABLEDATABASEORCLPDB1SAVESTATE 2022–12–30T19:28:54.854962+00:00XDB initialized.2022–12–30T19:37:53.816824+00:00 ORCLPDB1(3):Resize operation completed for file# 10, old size 337920K,newsize348160K If the log looks like the text […]

Configuring Your Oracle Database – Installation of a Containerized Oracle Database Instance and SQL Developer

Configuring Your Oracle Database In order to get the containerized Oracle Database instance to work with SQL Developer, you now need to make a few changes to the configuration. Run the following (rather complicated-looking) command to modify your database. As usual, please ensure that you supply the container ID that matches your own setup: docker exec –it <container_id> bash \–c “source […]

Updating the User Password – Installation of a Containerized Oracle Database Instance and SQL Developer

Updating the User Password There may come a point in the future where you will need to change your Oracle Database password. For example, if you don’t use the Docker image for a long time, the user password may expire. If this happens, then it’s simple enough to update the password using a very similar […]

Running SQL Developer – Installation of a Containerized Oracle Database Instance and SQL Developer

Running SQL Developer At this point, you can use SQL Developer to interact with the database. If SQL Developer is open, right-click the Oracle connection you created earlier. In the case of Figure 2-9, the connection is called OracleDockerNew. This name is just text, so you can use whatever name you configured for your database. […]

Three Docker Gotchas – Installation of a Containerized Oracle Database Instance and SQL Developer

Three Docker Gotchas As we’re on the topic of errors, when you’re using Docker commands, make sure not to enter the wrong parameter string. 1. Docker Case-Sensitivity For example, here in Example 2-10, the user incorrectly supplies an uppercase letter in the Container parameter. Example 2-10. Docker is case-sensitive C:\Users\Stephen>docker Container ls -aunknown shorthand flag: […]

Another Alternative to the Command-Line Use of Docker – Installation of a Containerized Oracle Database Instance and SQL Developer

Another Alternative to the Command-Line Use of Docker Docker Desktop also provides some pretty decent container management features. In Figure 2-16 you see the container listing, which comprises the Oracle Database container. In Figure 2-16, you can also look at the container image by clicking the Images option, as shown in Figure 2-17. As the […]

Fixing the Pesky PL/SQL Error – Taking SQL Developer for a Drive

Fixing the Pesky PL/SQL Error In the previous chapter, we encountered the error shown in Example 3-1 during the PL/SQL run. Example 3-1. An error is born! Errorreport–ORA–01722: invalid number ORA–06512: at line 15 01722. 00000 –“invalid number” *Cause:Thespecified number wasinvalid.*Action:Specify a validnumber. Let’s look a little more closely at Example 3-1. Notice that there’s an error on line 15. I need to locate that line […]

Installing a PL/SQL Procedure in the Database – Taking SQL Developer for a Drive

Installing a PL/SQL Procedure in the Database I’ve made a small change to the PL/SQL code in the form of adding a PROCEDURE name, as shown in Example 3-2. Example 3-2. Completing the declaration of the PL/SQL procedure CREATE OR REPLACE PROCEDURE update_employees IS   CURSOR c1 is SELECT ename, empno, sal FROM emp         ORDER BY sal DESC;  — start with highest paid employee  my_ename VARCHAR2(10);my_empno NUMBER(4);my_sal  NUMBER(7,2); BEGINOPEN c1; FOR i IN 1..5 LOOPFETCH c1 INTO my_ename, my_empno, my_sal; EXIT WHEN c1%NOTFOUND; /* in case the number requested*//* is more than […]