cancel
Showing results for 
Search instead for 
Did you mean: 

Does a SQL Syntax Formatter exist for ASA online?

Former Member
6,837

I need a SQL Syntax Formatter for ASA online. Does exists specific for ASA?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

There are a couple of vim plugins that may be what you want:

http://www.vim.org/scripts/script.php?script_id=356

and also script_id=1572

Former Member
0 Kudos

Thank you for answer.

Answers (6)

Answers (6)

thomas_duemesnil
Participant

For documentation purposes I use Notepad++ with syntax highlighting. You can export the colored source as RTF to a clipboard and past it directly into Word, Notes, ....

0 Kudos

Have you found a specific SQL Anywhere plugin for Notepad ++ or are you using the default SQL language packaged with the program? I find the default misses some things like the // for comments or the endif.

thomas_duemesnil
Participant
0 Kudos

I have used the standard sql plugin. Was enough for my needs.

Former Member

Hi

You may want to try this one helpful: http://www.dpriver.com/pp/sqlformat.htm

While they don't have special SQL Anywhere mode, SQL Server or Generic mode is pretty much sufficient in my experience.

Hope it helps


Leonid's suggestion is excellent! A truly easy-to-use interface, based on (apparently) some pretty powerful software. I threw what I thought was a deal-breaker at it, a funkadelic UPDATE from inside the Foxhound database monitor, and all it did was object to the ORDER BY in the LIST function. Apparently the desktop (for money?) version has an "ignore syntax errors" option. Anyway, here is the original code, followed by the output from dpdriver.com after the LIST ORDER BY was removed..

UPDATE rroad_group_2_property_pivot
          INNER JOIN ( SELECT temp_lock.blocked_connection_number,
                              temp_lock.blocker_connection_number,
                              temp_lock.blocker_owner_name,
                              temp_lock.blocker_table_name,
                              LIST ( STRING (
                                 temp_lock.blocker_lock_class, ' ',
                                 temp_lock.blocker_lock_duration, ' ',
                                 temp_lock.blocker_lock_type ),
                                 ', ' ORDER BY temp_lock.blocker_lock_type ) AS blocker_reason,
                              temp_lock.blocker_row_identifier
                         FROM temp_lock
                        GROUP BY temp_lock.blocked_connection_number,
                              temp_lock.blocker_connection_number,
                              temp_lock.blocker_owner_name,
                              temp_lock.blocker_table_name,
                              temp_lock.blocker_row_identifier ) AS temp_lock
             ON  temp_lock.blocked_connection_number = rroad_group_2_property_pivot.connection_number
             AND temp_lock.blocker_connection_number = rroad_group_2_property_pivot.BlockedOn
   SET rroad_group_2_property_pivot.blocker_owner_name     = temp_lock.blocker_owner_name,
       rroad_group_2_property_pivot.blocker_table_name     = temp_lock.blocker_table_name,
       rroad_group_2_property_pivot.blocker_reason         = temp_lock.blocker_reason,
       rroad_group_2_property_pivot.blocker_row_identifier = temp_lock.blocker_row_identifier
 WHERE rroad_group_2_property_pivot.sample_set_number = @sample_set_number;

Formatted:

UPDATE rroad_group_2_property_pivot
       INNER JOIN (SELECT   temp_lock.blocked_connection_number,
                            temp_lock.blocker_connection_number,
                            temp_lock.blocker_owner_name,
                            temp_lock.blocker_table_name,
                            List(String(temp_lock.blocker_lock_class,' ',temp_lock.blocker_lock_duration,
                                        ' ',temp_lock.blocker_lock_type),', ') AS blocker_reason,
                            temp_lock.blocker_row_identifier
                   FROM     temp_lock
                   GROUP BY temp_lock.blocked_connection_number,
                            temp_lock.blocker_connection_number,
                            temp_lock.blocker_owner_name,
                            temp_lock.blocker_table_name,
                            temp_lock.blocker_row_identifier) AS temp_lock
         ON temp_lock.blocked_connection_number = rroad_group_2_property_pivot.connection_number
            AND temp_lock.blocker_connection_number = rroad_group_2_property_pivot.blockedon
SET    rroad_group_2_property_pivot.blocker_owner_name = temp_lock.blocker_owner_name,
       rroad_group_2_property_pivot.blocker_table_name = temp_lock.blocker_table_name,
       rroad_group_2_property_pivot.blocker_reason = temp_lock.blocker_reason,
       rroad_group_2_property_pivot.blocker_row_identifier = temp_lock.blocker_row_identifier
WHERE  rroad_group_2_property_pivot.sample_set_number = @sample_set_number;
Former Member

There are a couple of vim plugins that may be what you want:

dbext.vim : Provides database access to many dbms (Oracle, Sybase, Microsoft, MySQL, DBI,..)

script_id=356

SQLComplete.vim : SQLComplete is a SQL code completion system using the omnifunc framework

script_id=1572

Actually, the above 2 do not format the SQL, but this Vim plugin does:

SQLUtilities : SQL utilities - Formatting, generate - columns lists, procedures for databases

http://www.vim.org/scripts/script.php?script_id=492

Dave

Former Member
0 Kudos

Here is one more useful tool for SQL code formatting, which helps me to make my code more readable and beautifies SQL statements instantly and convert code into well formatted script.

0 Kudos

I use this from Werysoft, I found it after following a link on here to their query builder, I don't think it has a Sybase option but the generic SQL mode seems to work quite nice. Werysoft SQLFormatter

How old is this thread !!!

Former Member
0 Kudos

You could also look at SQL Assistant. There is an old version available that is free. It come preconfigured to itergrate with a number of tools like Toad and ultraEdit( must be 15 on the list). The version I found was 3.5.1 and it said it was free but the about page is indicating it only has 14 days left on trail. Oh well it is something to look at.