[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Shallow Parser for t-SQL

Shashank Date

4/9/2005 9:31:00 PM

Shallow Parser for t-SQL
------------------------

A library to shallow parse t-SQL statements and generate a simple
data-structure (array of TSQLStmt objects) for further consumption.
t-SQL is the procedural language for Microsoft SQL Server 2000.

Version
-------

0.0.1 (2005/04/09) *** alpha ***

Installation
------------

Download and unzip the zip file in any temporary directory.
Execute the included "install.rb" script:

C:\temp\release\> ruby install.rb

License
-------

Ruby's

Dependencies
------------

None

URL
---

http://rubyforge.org/projects/tsql...

Example Usage
-------------

require 'tsql_shparser'

shp = TSQL_ShParser.new.parse("select col1, col2, col3 from Table1")

p shp[0].all_columns.to_arr #-> ['COL1','COL2','COL3']
p shp[0].all_tables.to_arr #-> ['TABLE1']

shp[0].list_select_expressions.map{|e| p e.to_arr}
#-> [["COL1", ","], ["COL2", ","], ["COL3"]]

Warning
-------

This is an alpha release. Plenty of bugs !

BUG REPORTS
-----------

Please make sure that the t-SQL script that exposes a bug, parses
correctly under Query Analyzer before submitting a report.

Author
------

Shashank Date
shanko_date@yahoo.com