Developers Club geek daily blog

Sublime text for the developer's PL/SQL

2 years, 7 months ago
There was a wish to tell about how many favourite Sublime Text can be used as quite good means for development on PL/SQL.

It would be desirable to begin with for what this bicycle was necessary, there are, it seems, many other IDE for work with SQL and in particular Oracle PL/SQL, such as Toad for Oracle, SQL Navigator, PL/SQL Developer and even free Oracle SQL Developer, however the majority of them has several shortcomings in comparison with text editors like Emacs, SciTe, Vim, Notepad ++, Sublime Text, etc.

I will list some of them, this list especially subjective:

  • "Ponderousness" of each IDE, it is expressed not only in the amount of a distribution kit, but also the general feelings, existence of a set not of the necessary functions, buttons, responsiveness, etc.
  • The majority of acceptable IDE are paid, or conditionally free with limited functionality.
  • It would be desirable a krossplatformennost, under this requirement from the given IDE only Oracle SQL Developer gets.
  • Functionality of text editing. In the majority of them there are only basic methods on work with the text: it is text typing, copy-paste, syntax highlighting. About any "CTRL+D" as speech Sublime Text also does not go.
  • Simplicity of expansion, practically all IDE are closed, any support of samopisny pagin, etc.

There is one more point, but it belongs to the organization of projects and tasks on a workplace more. It would be desirable to touch a little upon this subject as the organization on projects left the mark on the Sublime Text setup.

Read more »


Data record in Teradata with the help of DML

2 years, 7 months ago
If to go straight all yes directly, far you will not leave …
(Little prince, Antoine de Saint-Exupéry)


Recently the colleague somehow appealed to me to help with Teradata. It is actively implemented now and the first step of this implementation is data loading on a daily basis. It is necessary to fill in much and as soon as possible. Some alternative methods of data loading asked to find me in Teradata which not strongly would depend on the resources selected to the user. In the course of this work I had to become more closely acquainted with .NET Data Provider for Teradata. An input of acquaintance some curious parts which knowledge, in my opinion, can be very useful became clear. As not all know about Teradata, I will begin with its short description.

Read more »


We use TSQL for game in "Head"

2 years, 7 months ago
Recently I remembered the remarkable intellectual game "Head" with which I got acquainted in school days.

The other day I asked a question – it will be how difficult to implement algorithm of this game for the computer rival?

As I most of all like to work with relational data and my favourite language SQL is, I decided to combine business with pleasure and to try to write this algorithm using only TSQL. It is my first attempt to write AI using only possibilities of SQL.

The archive with files can be downloaded at the following link – scripts.
All words in the dictionary in an uppercase, and also in it is mute letters "E" and "Yo" are considered for one (as "Е").

The following scheme was as a result created:

Read more »


How to implement SOAP-service for work with tables of Google through SQL

2 years, 8 months ago
There was a task — during preparation of a demo of one of solutions it was necessary to show that client information can be saved anywhere — in a simple case, for example, in tables of Google, in more difficult (after semi-annual "implementation" and the multimillion budget) in the client's CRM. In WSO2 ESB used by us there is a connector to tables of Google — but to implement required functionality on it it was not really simple task — and then I chucked in it.

But recently, dealing with new features of WSO2 Data Services Server found out that in it it is possible to implement easily SOAP service for work with tables of Google (which can be picked up then anywhere). And work with data in the table is carried out through usual by all SQL.
How to make it, and I want to tell under a cat.

Read more »


Instant File Initialization – the killer feature for SQL Server

2 years, 8 months ago
When SQL Server reserves the new place on a disk, it initializes it in zero. This behavior can be disconnected and as a result to reduce runtime of some operations and to lower load of a disk subsystem.

The possibility of reservation of the place on a disk without initialization is called Instant File Initialization (instant initialization of files). This feature is not strongly known though its use became possible since SQL Server of 2005.

What advantages can be got from Instant File Initialization:

1. To accelerate creation of the new database
2. To reduce delays and to reduce time necessary for increase in data files
3. To reduce time of start of SQL Server as initialization of tempdb will be faster
4. To reduce time at recovery from a backup copy as before recovery of SQL Server reserves the space for files, and then transfers to them information from a backup.

Read more »


How to find the most long continuous line of events by means of SQL

2 years, 8 months ago
The problem of search of continuous sequences of events is quite easily solved with the help of SQL. Let's specify that these sequences are.

For an example we will take Stack Overflow. He uses cool system of reputation with awards for certain achievements. As well as in many social projects, they encourage users daily to visit a resource. Let's pay attention to these two awards:



It is easy to understand what they mean. Visit the website in the first day. Then for the second day. Then on the third (perhaps several times, it does not matter). Did not come on the fourth? We begin to consider again.

Read more »


Official Firebird 3.0 Release Candidate 1 and beta of documentation for Firebird 3.0

2 years, 8 months ago
The official Firebird 3.0 Release Candidate 1 version to Windows and Linux (and also source codes) is available to downloading on www.firebirdsql.org.

The list of new functions and opportunities can be found in Firebird Release Notes (go as a part of archive of Firebird installers).

For the Russian users Firebird "Moscow Exchange" and our company (IBase/IBSurgeon) prepared special, very pleasant bonus — a beta of documentation on the Firebird 3.0 (PDF) language.
The complete version of documentation is expected together with Firebird 3.0 release.
And still — there will be the second candidate release, approximately in a month.

Read more »


Game with the list of conditions

2 years, 8 months ago
I will show in this article as as it is possible to make with the list of conditions. I will formulate a small test problem on the basis of the AdventureWorks2008R2 base and one of options of its solution.

Example of a task:

To calculate delivery cost upon on the following conditions (a normal task for the logistic companies).

List of conditions:

  • Delivery to Berlin and Bonn of bikes
  • Delivery to Berlin and Bonn of other goods
  • Delivery to other cities

Read more »


The plan of service "for every day" – Part 3: Automatic creation of backups

2 years, 8 months ago
There is a great quantity of posts in which persistently call for one simple truth – it is necessary to do backups on a permanent basis. But people will always be divided into two categories: who does not do backups yet, and who already does them. The first category which scorns such opinion it is often possible to meet at profile forums with approximately identical questions:

– at me disks / kto-to departed deleted my base … as to me to recover my data?
– you have a fresh backup?
– no

Not to become the hero of such situation, it is necessary to spend a minimum of efforts. First, to select the disk array on which to put backup copies. As to store backups together with the DB files – obviously not our choice. The second … it to create the plan of service for backup of databases.

What we will also make further, and later we will discuss some subtleties connected with backups.

Read more »


Parameter passing in dynamic request in T-SQL

2 years, 8 months ago
I faced need of creation of dynamic request more than once and there is a number of reefs about which I will tell below. Example of dynamic request:

declare @sql varchar(100) = 'select 1+1'
execute( @sql)

1. Start of a line through Execute creates the separate block of a code in which the current variables will not be visible, but all temporary tables are visible.

2. Pay attention to transfer of variables with NULL value. Any merge to NULL as a result will give NULL, therefore, instead of request, you can receive blank line.

declare @i int
declare @sql varchar(100) = 'select ' + cstr(@i)
execute( @sql ) -- Ошибка

3. Transfer of dates and time. It is better to transfer dates in the GGGGMMDD format. At parameter passing it is necessary to pay attention to loss of accuracy over time. For saving of accuracy of value it is better to transfer through the temporary table.

Read more »