Home InterBase Firebird Community About us Search Help English Russian
Everything about Borland InterBase and Firebird
Get Firebird power with FIBPlus
 
Anonymous Login / Register
Site News
Third-party Product News
Programming
Miscellaneous
Encyclopedia
FAQ


Search the site


Subscribe the site news

Sections:
News
E-mail:


InterBase World is a Full Member of Firebird Foundation



Login


Hits 2622398
2528
Hosts 152101
808
Visitors 771522
1134

3



Powered by Bitrix Site Manager - Content Management & Portal Solutions

Home / Article archives / Programming

"Active" Editor keeps your code safe.


01/25/2007  | Views: 1775

Nowadays SQL code editor with syntax highlighting is available in any database-oriented development tool. Although only in the Interbase/Firebird Development Studio the editor not only passively highlights keywords – it but also checks the code for syntax rules compliance. In case of any error the editor underlines an erroneous place with the red line, like any text processor does when it checks your text for grammar. That’s why we call this editor “active”. Syntax rules checking allows to wipe out typos and small syntax errors. As for me, when I’ve spent a lot of time coding in Delphi, my hand always tries to type semicolon everywhere. As you know, in the Interbase/Firebird SQL language there is no semicolon after END. And now I’m immediately notified about this.

Moreover, besides the syntax rules the editor checks for some logical errors. The different number of columns and variables in the select statement is a good example of such checking. Another example is checking for column’s ambiguity.

Your code will be also checked for potential data loss. For example, you have a column defined as VARCHAR(200) and your stored procedure code contains the following statement:

SELECT xxx FROM mytable
INTO :MyVar

Where MyVar defined as VARCHAR(100). These places are underlined by dark-yellow color (these are the warnings).

You can even check the whole database for code errors and warnings at any time (click on Database menu and select “Check database for code errors”).

Code completion example:

Syntax analyzer code allows doing other interesting things. For example, more intellectual code completion. The completion list will contain only necessary things – when only two keywords may appear at this place of code only these keywords will be visible in the completion list. When only table name is suitable here – you will see the list of tables and nothing more.

The next exciting use for syntax analyzer is code formatting. If you already wrote some procedure without keeping code style standards or you have to fix someone’s code, you’d better to format the code in your favorite style before working with it.

Even a simple search may be more intellectual with syntax analyzer. Check the example from Employee database – you can see the select statement that uses “Customer” column from the “Customer” table that puts the data into the variable with the same name. With a special command you can ask editor to highlight only the variable. By the way, at any time you can rename a variable if its name is poor. The variable will be renamed in your procedure code automatically.

I hope these small things will greatly improve your day by day performance and significantly reduce the number of bugs in your code.

Pavel Kutakov

Source

Back to the news section


 Last articles 
09/24/2007 IBSurgeon would like to inform you about a series of free Firebird technical seminars

09/23/2007 Firebird System Tables (Parts II+III)

09/20/2007 Firebird Maestro 7.9 released

09/19/2007 And the Winner is —

09/19/2007 Unable to access fireruby lib - with firebird 2.0.x and ror

news archive