sql

Procedure in PLSQL

Procedure in PLSQL

Procedure in PLSQL In PL/SQL, a procedure is a subprogram that performs a specific task and can be called to execute its statements. Procedures can take parameters (inputs and outputs) and are typically used to encapsulate and organize code to perform a specific action, but they do not return values directly like functions. Here’s a basic overview of a procedure:Syntax: CREATE OR REPLACE PROCEDURE procedure_name ( parameter_name [IN | OUT | IN OUT] datatype ) IS -- Declaration section BEGIN -- Executable section -- Code to perform some action END procedure_name; Enter fullscreen mode Exit fullscreen mode IN: Used to…
Read More
Understanding and Configuring Oracle Access Control Lists (ACLs) for Email Sending Using UTL_MAIL

Understanding and Configuring Oracle Access Control Lists (ACLs) for Email Sending Using UTL_MAIL

Introduction This article is based on real problems I had in a production environment in Oracle 11g. Oracle Database provides powerful networking capabilities, allowing PL/SQL programs to interact with external systems over the network. To enhance security, Oracle introduced Access Control Lists (ACLs) starting from Oracle Database 11g. ACLs enable fine-grained control over network access, ensuring that only authorized users and programs can communicate with specified external hosts and services. This article provides a comprehensive guide to understanding ACL capabilities in Oracle, how to configure them, and how to send emails using the UTL_MAIL package. We will walk through the…
Read More
SQL, get median of all columns in each row #eg21

SQL, get median of all columns in each row #eg21

In PostgreSQL database, table T has multiple numeric columns: We want to find the median of all column values in each row. Below is the expected result: Write the following SPL code: new()function creates a new two-dimensional table; ~ represents the current record; array() function converts field values of a record to a sequence. Source link lol
Read More
SQL, split values of two columns respectively and count members of their intersection #eg20

SQL, split values of two columns respectively and count members of their intersection #eg20

In PostgreSQL database’s table T, items_current_order field and items_next_order field contain comma-separated strings having duplicate characters and enclosed by braces: We need to add a computed column named count to the table. Rule: Split items_current_order field and items_next_order field respectively into a set having duplicate members and count members of their intersection. Write the following SPL code: derive() function adds a computed column to A1’s table. #3 represents the 3rd field; we can also use name to represent the field. split() function splits each string; @c option means using the comma to separate the string. ^ is the operator for…
Read More
How to Display All Databases in Various Ways

How to Display All Databases in Various Ways

Essential duties in daily database management include viewing the entire list of databases on a server, retrieving their pertinent information, and swiftly recognizing certain databases. In order to undertake security audits, integrate databases, monitor sizes and performance, and carry out several other areas of database construction, maintenance, and administration, these actions are essential. Existing databases can be effectively displayed using a number of techniques provided by contemporary database management systems, such as Microsoft SQL Server. For example, SQL Server has various methods for listing databases, which are comparable to the manner in which tables are viewed within databases. These techniques…
Read More
Conquering Your First Database: Essential SQL Queries for Newbies

Conquering Your First Database: Essential SQL Queries for Newbies

Congratulations! You've embarked on the exciting journey of learning SQL, the language that unlocks the secrets hidden within databases. Whether you're a budding data analyst, a curious developer, or simply someone who wants to wield the power of data, understanding SQL is a game-changer. This blog post serves as your essential guide to conquering your first database, equipping you with the fundamental SQL queries you'll need to navigate its terrain. Along the way, we'll explore how these skills can be leveraged in the fascinating world of data science (with a nudge towards exploring an SQL Data Science course!). Unveiling the…
Read More
SQL generation: Golang’s builder pattern vs Clojure’s persistent map

SQL generation: Golang’s builder pattern vs Clojure’s persistent map

I worked on a TODO code assignment for showing off my skills, and more importantly, showing my weak points. I coded in Golang and Masterminds/squirrel. Later, I ported only the SQL generation part to Clojure to compare and discuss why I prefer Clojure, which I have usually been asked about or even met with opposition for. I will discuss function by function and type by type. The first function is makeStatement. func (repo *TodoRepoPg) makeStatement(orders []entity.Order, filters []entity.Filter) (string, []any, error) { builder := repo.Builder.Select("id, title, description, created, image, status") if err := buildOrders(&builder, orders); err != nil { return…
Read More
Resolving the “Length of LOB Data (78862) to be Replicated Exceeds Configured Maximum 65536” Error

Resolving the “Length of LOB Data (78862) to be Replicated Exceeds Configured Maximum 65536” Error

Understanding the Error The error indicates that the LOB data size (78862 bytes) exceeds the configured maximum limit (65536 bytes) set for replication in SQL Server. This typically happens during the replication process, leading to the failure of data transfer. Common Causes Default Configuration Limits: SQL Server has default settings for the maximum size of LOB data that can be replicated. Large Data Inserts: Inserting large multimedia files or extensive text data can exceed the default LOB size limit. Inadequate Configuration Settings: The database settings might not be optimized for handling large LOB data, resulting in replication issues. Solutions to Resolve…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.