Adding polars to Python3
MacLochlainns Weblog
by maclochlainn
2w ago
Just a quick note to correct the Polars instruction, you should install using pip3 with the following command: pip3 install polars You’ll get something like the following: Defaulting to user installation because normal site-packages is not writeable Collecting polars Downloading polars-1.21.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 31.6/31.6 MB 11.5 MB/s eta 0:00:00 Installing collected packages: polars Successfully ..read more
Visit website
Using Python’s getopt
MacLochlainns Weblog
by maclochlainn
2M ago
A couple of my students wanted me to write a switch and parameter handler for Python scripts. I wrote it just to show them it’s possible but I also show them how to do it correctly with the Python getopt library, which was soft-deprecated in Python 3.13 and replaced by the Python argparse library. The ..read more
Visit website
Sqlplus on Ubuntu
MacLochlainns Weblog
by maclochlainn
2M ago
With the release of Oracle Database 23c Free came the ability to update components of the container’s base operating system. Naturally, I took full advantage of that to build my development machine on an Ubuntu 22.0.4 VMware instance with a Docker implementation of the Oracle Database 23c Free container. Unfortunately, there were changes from that ..read more
Visit website
SQL Calculations #1
MacLochlainns Weblog
by maclochlainn
3M ago
This was principally written for my SQL students but I thought it might be useful to others. SQL calculation are performed row-by-row in the SELECT-list. In its simplest form without even touching a table, you can add two literal numbers like this: SELECT 2 + 2 AS result; It will display the result of the ..read more
Visit website
SQL Statement Management
MacLochlainns Weblog
by maclochlainn
4M ago
It’s very difficult explaining to students new to relational databases how SQL works. There are many parts that seem intuitive and then there are others that confuse and confound. For beginners, the idea that a SQL statement is simply a text string that you must dispatch to a SQL statement processing engine is new. That’s ..read more
Visit website
Troubleshoot Oracle Errors
MacLochlainns Weblog
by maclochlainn
7M ago
It’s always a bit difficult to trap errors in SQL*Developer when you’re running scripts that do multiple things. As old as it is, using the SQL*Plus utility and spooling to log files is generally the fastest way to localize errors across multiple elements of scripts. Unfortunately, you must break up you components into local components, like a when you create a type, procedure, function, or package. This is part of my solution to leverage in-depth testing of the Oracle Database 23ai Free container from an Ubuntu native platform. You can find this prior post shows you how to setup Oracle*Client ..read more
Visit website
Updating Nested ADTs
MacLochlainns Weblog
by maclochlainn
9M ago
The first part of this series showed how you can leverage Oracle’s SQL syntax with UDT columns and collection columns. It would be nice if Oracle gave you some SQL to work with the elements of ADT collections, but they don’t. After all, that’s why you have this article. While you could change the setup of the prior example table, it’s easier to create a new customer table. The new customer table drops the address column. There’s also a new pizza table. The pizza table includes an ingredient ADT collection column, which by design holds a unique set of ingredients for each pizza. Realistically ..read more
Visit website
Updating Nested Tables
MacLochlainns Weblog
by maclochlainn
9M ago
This two-part series covers how you update User-Defined Types (UDTs) and Attribute Data Types (ADTs). There are two varieties of UDTs. One is a column of a UDT object type and the other a UDT collection of a UDT object type. You update nested UDT columns by leveraging the TABLE function. The TABLE function lets you create a result set, and access a UDT object or collection column. You need to combine the TABLE function and a CROSS JOIN to update elements of a UDT collection column. ADTs are collections of a scalar data types. Oracle’s scalar data types are DATE, NUMBER, CHAR and VARCHAR2 (or ..read more
Visit website
Oracle23ai Ubuntu Install
MacLochlainns Weblog
by maclochlainn
10M ago
What to do with a Late 2015 iMac with an i7 Quad CPU running at 3.4 GHz, 32 GB or RAM, a 5K Display and an almost warn out hybrid 1 TB hard disk? You could sell it to Apple for pennies, but why enrich them. I opted to upgrade it with an OWC kit that had a 2 TB SSD Disk. Then, I installed Ubuntu 22.0.4 and built a DaaS (Database as a Service) machine with Oracle Database 23ai in a Docker container, and MySQL 8 and PostgreSQL 14 natively. I’ve posted on installing MySQL 8 and PostgreSQL 14 on Ubuntu before when I repurposed my late 2014 MacBook Pro. This post covers the installation of Docker an ..read more
Visit website
Learning SQL Exercise
MacLochlainns Weblog
by maclochlainn
11M ago
I’ve been using Alan Beaulieu’s Learning SQL to teach my SQL Development class with MySQL 8. It’s a great book overall but Chapter 12 lacks a complete exercise. Here’s all that the author provides to the reader. This is inadequate for most readers to work with to solve the concept of a transaction. Exercise 12-1 Generate a unit of work to transfer $50 from account 123 to account 789. You will need to insert two rows into the transaction table and update two rows in the account table. Use the following table definitions/data: Account: account_id avail_balance last_ ..read more
Visit website

Follow MacLochlainns Weblog on FeedSpot

Continue with Google
Continue with Apple
OR