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 […]

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

The code in Example 1-1 loops from 1 to 20 and checks if the numbers are even or odd. The latter is done using the MOD function and the result is written into a table called temp. A cursory glance at the listing allows us to figure most of this out. Some confusion might also […]

Reusability: Score = 2 – Resilient Software and PL/SQL

Reusability: Score = 2 Because the Example 1-4 code isn’t structured as a procedure or function, it’s not easily reusable. One of the merits of writing reusable code is that you must aim for more generality in terms of structure, parameter names, and so on. So rather than just solving the problem at hand, your […]

A Virtualized Oracle Database Installation – Installation of a Containerized Oracle Database Instance and SQL Developer

A Virtualized Oracle Database Installation Rather than just doing a native installation of Oracle Database onto your machine, I instead opt to use a virtualized approach. This has many merits, not the least of which is the educational benefit. It’s a good thing to come to grips with containers and images because they represent what […]

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 […]

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

Use the same credentials as for the container registry login page in Figure 2-3. If the login succeeds, then copy the docker pull command from the Pull Command for Latest section in the lower right of Figure 2-4. The command is shown here for version 19: docker pull container-registry.oracle.com/database/enterprise:19.3.0.0 Figure 2-4. Oracle container registry page […]

Running Some PL/SQL Code – Installation of a Containerized Oracle Database Instance and SQL Developer

Running Some PL/SQL Code Let’s now review one of the earlier PL/SQL examples, as shown in Example 2-8. Example 2-8. Cursor use in PL/SQL DECLARECURSOR c1 isSELECT ename,empno,salFROMemp         ORDER BY sal DESC;— start with highest paid employeemy_ename VARCHAR2(10);my_empno NUMBER(4);my_sal  NUMBER(7,2); BEGINOPEN c1;   FOR i IN 1..5 LOOPFETCH c1 INTOmy_ename,my_empno,my_sal;EXIT WHEN c1%NOTFOUND; /* in case the number requested *//* is more than the total       *//* number of employees          */ INSERTINTOtempVALUES(my_sal,my_empno, my_ename);COMMIT;END LOOP;CLOSE c1;END; To run the code in […]

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: […]

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

An Alternative to the Command-Line Use of Docker The Docker-based setup we’re using has a number of merits. One is that it’s quite quick to get it working and it requires a minimal amount of installed software. I mentioned that there are a range of options to choose from if using Docker from the command […]

Executing the PL/SQL Procedure 2 – Taking SQL Developer for a Drive

The idea of shift-left has become increasingly popular as teams face pressure to deliver software more frequently and with higher quality. Shift-left potentially speeds up development efficiency and helps reduce costs by detecting and addressing software defects as early as possible in the development cycle, ideally long before such defects get to production. “Fixing the […]