Structured Query Language (SQL)
Structured Query Language (SQL) is a standard computer language for relational database management and data manipulation. SQL is used to query, insert, update and modify data
Some co-workers started using Apache Kafka con a bunch of our Customers. Apache Kafka is a community distributed event streaming platform capable of handling trillions of events a day. Initially conceived as a messaging queue, Kafka is based on an abstraction of a distributed commit log[*]. To get this goal, Apache Kafka needs a complex …
SQL: One of the most valuable skills – Craig Kerstiens
I admit it. I suffered from an “algebra narcoleptic syndrome” during my relational database lessons at University (1996 circa). Ok it is a fake. But it seems so real on these days. I was unable to avoid sleeping. I learned to love SQL after some years and now I think SQL is the most powerful, …
SQL: One of the most valuable skills – Craig Kerstiens Read More »
Outer full and inner SQL joins: you are wellcome
For a complete description see https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins
SQLite Oracle Compatibility Layer
It aims to provide a minimal compatibility with Oracle. The need was having some regular expression functions, and I do not like to work with risky C code, like this university project did
Removing duplicate rows in PostgreSQL, Oracle and SQLite
Sometimes you need to remove nasty duplicate on a table, based on a subset of the column. On every big database there is something called “rowid” which can be used to indentify a column in a unique way. On PostgreSQL is called ctid, as we shall see: Oracle way: DELETE FROM your_table WHERE rowid not …
Removing duplicate rows in PostgreSQL, Oracle and SQLite Read More »
Italian Accent Oracle fix
In Italian language we have accent words like àèéìòù They are quite important because for instance “is” is spelled è whereas “and” is spelled e Accent are bad guys even today: if you copy them from MS-Word inside an Oracle sql script you can end up with different UTF-8 values. Also the accent are likely …
Oracle SQL Developer Keep Alive plugin
On some environment, on some customers, Oracle connections are drop after some idle time (i.e. 2 minutes). I have found a small plugin for Sql Developer to solve this issue: it is very handy and logs its usage. Code is also very clean https://github.com/scristalli/sql-developer-keepalive 19 forks. 115 stars. 3 open issues. Recent commits: Update README.md, GitHub …
Oracle Auto increment trigger HOWTO
Oracle SQL Developer is full of nice feature, damned by a overwhelming options pane, like the one I will describe to you right now. Even if Oracle databases (<12) does not support auto increment, you can easily ask to your sql data modeler to generate for you a sequence and a trigger in a automatic …
Oracle Database Sync
Oracle SQL Developer is full of nice feature, damned by a overwhelming options pane, like the one I will describe to you right now. I will show here a very fast way of comparing different database and auto-generate migration script. Reverse engineer the source database using Oracle Data Modeler Now select the right arrow shown …
Oracle Invalid number ORA-01722
I stumbled upon a very brain-f**k error on Oracle 10g on these days. Context: the following query [sql]SELECT * FROM ( SELECT TO_NUMBER(CUSTOMER_ID) AS SNDG FROM BAD_CODES_TABLE WHERE AND I_LIKE=UPPER(‘STATIC_CONDITION’) AND CUSTOMER_ID NOT LIKE ‘%P%’ ) S WHERE TO_NUMBER(S.SNDG) >2000[/sql] could trigger a Invalid number if CUSTOMER_ID column contains invalid numbers. Why? Well…if you ask …
Come evitare iniezioni SQL lato DB in SQLServer, Oracle, MySQL
Come evitare iniezione SQL: lato SQL Server (SP_EXECUTESQL) In generale va evitato nel modo più assoluto la scrittura di query sql diamiche. Va evitato cioè l’uso lato SQL Server di sp_executesql e EXEC Di seguito mostriamo come trasformare una query “dinamica” in una “statica” CREATE PROCEDURE search_orders @custid nchar(5) = NULL, @shipname nvarchar(40) = …
Come evitare iniezioni SQL lato DB in SQLServer, Oracle, MySQL Read More »
SQL Server Backup & Restore
E’ facile fare un backup con sql server: Basta selezionare tasto destro Tasks>>Backup su un db. Ma come fare il restore?… Ecco un semplice script che chiarisce la cosa (non sempre lampante dallo wizard di restore….): [sql] — Usare il seguente comando per recuperare i parametri sorgente da usare nella MOVE — Nel nostro caso …
Help Daitan find a Sql solution for codezauker
In my code ramblings during the developement of Code Zauker, I ended up studing a bit NoSql database. Code zauker started using Redis, because Redis is a very bold memory-based no-sql db. Redis also support complex data type like sorted set, lists and so on, which was very userful. Anyway I needed a very fast …
dapper-dot-net – Simple SQL object mapper for SQL Server – Google Project Hosting
Dapper is a single file you can drop in to your project that will extend your IDbConnection interface. […] A key feature of Dapper is performance. The following metrics show how long it takes to execute 500 SELECT statements against a DB and map the data returned to objects. The performance tests are broken …
dapper-dot-net – Simple SQL object mapper for SQL Server – Google Project Hosting Read More »
NoSQL Rocks? We try to understand
At Gioorgi.com we was never a SQL fan. In 2000 we thinked SQL was boring, mostly because sql algebra could be a bit boring. Then we found this book written by one of the father of SQL. Years ago Google and then Facebook popped out with new incredible ideas, for improved and super fast scalability, which eventually …