Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > sql interface

Reply
Thread Tools

sql interface

 
 
mpeters@nospammers.com
Guest
Posts: n/a
 
      02-24-2009
Hello,

I am sure this has been done lots of times but I can't seem to find some
examples. I need to write an SQL interface that allows the user to
specify fairly straightforward conditional clauses. Like,


first_name='john' and age < 30


I imagine I would have a list of field names on one side and a list of
entry fields on the other where the user could specify the data. I
guess the trick is how to let the user specify the connectors like
"and", "or", or even put them in parentheses. I am thinking some
Javascript library would come in handy here.


Is there something like this that I can re-use or take as a starting point?



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-24-2009
wrote on 24 feb 2009 in comp.lang.javascript:

> Hello,
>
> I am sure this has been done lots of times but I can't seem to find
> some examples. I need to write an SQL interface that allows the user
> to specify fairly straightforward conditional clauses. Like,
>
>
> first_name='john' and age < 30


yes that can be part of a sql string

> I imagine I would have a list of field names on one side and a list of
> entry fields on the other where the user could specify the data. I
> guess the trick is how to let the user specify the connectors like
> "and", "or", or even put them in parentheses. I am thinking some
> Javascript library would come in handy here.
>
> Is there something like this that I can re-use or take as a starting
> point?


You will first have to specify the platform you use.

Serverside javascript, under ASP?
Cscript/wscript?
probably not clientside in a browser?
on an open inernet connection?

etc.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
mpeters@nospammers.com
Guest
Posts: n/a
 
      02-24-2009
Evertjan. wrote:
>
> You will first have to specify the platform you use.
>
> Serverside javascript, under ASP?
> Cscript/wscript?
> probably not clientside in a browser?
> on an open inernet connection?
>



This is on Windows XP, using MySQL as the database. The trick is that
the condition will be specified by the user on the client side through
the browser. Most of the action will take place on the client side.
So, the interaction is:

- user logs in
- user sees a list of columns
- with the browser, user enters simple "x=y" type conditions or combines
those simple ones into larger ones using parentheses, "and", "or", etc.
- user clicks on a button then, the whole condition gets processed, and
results returned to the user via the browser.


I guess the challenge is that we do not want to simply provide the user
with a large text field to type in. We want to simplify it so that they
can just click and enter a few data elements.


We can use HTML, CSS, Javascript and AJAX.



 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      02-24-2009
On Feb 24, 12:32*pm, "Evertjan." <(E-Mail Removed)>
wrote:
> *wrote on 24 feb 2009 in comp.lang.javascript:
>
> > Hello,

>
> > I am sure this has been done lots of times but I can't seem to find
> > some examples. *I need to write an SQL interface that allows the user
> > to specify fairly straightforward conditional clauses. *Like,

>
> > first_name='john' and age < 30

>
> yes that can be part of a sql string
>
> > I imagine I would have a list of field names on one side and a list of
> > entry fields on the other where the user could specify the data. *I
> > guess the trick is how to let the user specify the connectors like
> > "and", "or", or even put them in parentheses. *I am thinking some
> > Javascript library would come in handy here.

>
> > Is there something like this that I can re-use or take as a starting
> > point?

>
> You will first have to specify the platform you use.
>
> Serverside javascript, under ASP?
> Cscript/wscript?
> probably not clientside in a browser?


Webkit has it. I use it in lieu of cookies whenever possible. Adds a
lot of possibilities for offline apps.

I imagine others will follow as it is part of some proposed standard.
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-24-2009
wrote on 24 feb 2009 in comp.lang.javascript:

> Evertjan. wrote:
>>
>> You will first have to specify the platform you use.
>>
>> Serverside javascript, under ASP?
>> Cscript/wscript?
>> probably not clientside in a browser?
>> on an open inernet connection?
>>

>
>
> This is on Windows XP, using MySQL as the database. The trick is that
> the condition will be specified by the user on the client side through
> the browser. Most of the action will take place on the client side.
> So, the interaction is:
>
> - user logs in
> - user sees a list of columns
> - with the browser, user enters simple "x=y" type conditions or combines
> those simple ones into larger ones using parentheses, "and", "or", etc.
> - user clicks on a button then, the whole condition gets processed, and
> results returned to the user via the browser.
>
>
> I guess the challenge is that we do not want to simply provide the user
> with a large text field to type in. We want to simplify it so that they
> can just click and enter a few data elements.
>
>
> We can use HTML, CSS, Javascript and AJAX.


Sorry, clientside databases are not my piece of cake.

Perhaps David Mark, see the other post, can help you on?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
David Segall
Guest
Posts: n/a
 
      02-25-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>Hello,
>
>I am sure this has been done lots of times but I can't seem to find some
>examples. I need to write an SQL interface that allows the user to
>specify fairly straightforward conditional clauses. Like,
>
>
>first_name='john' and age < 30
>
>
>I imagine I would have a list of field names on one side and a list of
>entry fields on the other where the user could specify the data. I
>guess the trick is how to let the user specify the connectors like
>"and", "or", or even put them in parentheses. I am thinking some
>Javascript library would come in handy here.
>
>
>Is there something like this that I can re-use or take as a starting point?


Unless your users are similar to programmers, engineers or actuaries I
think you should provide something much simpler. The filters in your
news reader (Thunderbird) provide a good model. They have reduced the
AND/OR/NOT and parentheses to a simple "match all" or "match any" of
the following rules. The rules consist of a drop-down list of fields,
a drop-down list of conditions and a value field. Augmented with a
"search in results" facility I believe that you will satisfy any
likely query. If anyone complains, provide the option to input the SQL
I'm sorry, I don't know of any existing code that you can use to
implement this.

P.S. Are you aware that the cybersqatters at nospammers.com are
dealing with the spam that this post might generate? If not, perhaps
you should change your Usenet email address to conform with RFC2606
<http://tools.ietf.org/html/rfc2606>.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Reference, SQL Queries, SQL help ecoolone ASP .Net 0 01-03-2008 10:58 AM
PCI interface or USB interface David Wireless Networking 4 09-16-2004 01:01 PM
allow ssh only on outside interface, but telnet on inside interface of router no-one Cisco 0 07-28-2004 04:17 PM
PIX: how to allow 1 host from outside interface to access another host on the inside interface? jonnah Cisco 1 04-21-2004 02:26 PM
static nat between phisical interface and virtual interface on same ethernet Andrea Cisco 0 04-19-2004 09:37 AM



Advertisments