You are here: SQL Generator « MsSQL Server « IT news, forums, messages
SQL Generator

Posted by Bit Byter on 10/02/02 11:53

Hi,

This may be a little OT, but I don't know exactly where else to post
it. I am writing a little parser that generates valid SQL using
"English like" text. I want to use this to allow non-technical users to
be able to quickly write their own queries, to search through a
database that stores information about the sales of different
companies. I can provide more information for anyone who wants to help.

Currently, the syntax is :

Select ALL PRODUCT_FILTER from COMPANY where funcname(params) conditon
.... and ITEM_DATE date_condition


Where:

product_filter specifies the product type to be included in the search
company specifies the company whose data is to be searched
funcname is an aggregate function
condition specifies the criteria for the aggregate function (i.e. a
HAVING clause)
date_condition specifies the criteria for the dates to be used in the
search

Note: there can be more than 1 aggregate function

A typical query then may look like this:

Select all 'toys' from 'Walmart' where average_sales(100) > 100000 and
avaerage_cost(100,10) <= 1 and item_date between "01-Jan-00" and
"01-Jan-06"


I would like to know what the underlying SQL statement will look like,
so that I can use this knowlege to build a generic parser that creates
SQL statements from the "English like" text, using the syntax I
described above.

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация