Joel Rees wrote:

>Should we guess that he wants to be able to log into a database with csh,
>run ls and get a list of tables, run cat on a table and get a
>tab-delimited listing of the contents of the table?
>
>On the surface it didn't seem like such an unreasonable question, ...
>
The easiest way would probably be to write an sh-like 'shell' that 
executed commands it didn't recognize via a 'real' shell, but filtered 
the rest.  It would take 'ls' and use it to show a list of databases, cd 
'databasename' as 'use databasename', then 'ls' would show tables and 
'cd tablename' would push "FROM tablename" onto the stack in some form.

The only problem I see is the reading of data in any complex way ... SQL 
queries can do things that no 'ls' command could ever do without using 
`ls -l --query="select name, address from cust left join custorders on 
cust.id = custorders.custid left join orders on custorders.orderid = 
orders.id left join orderstatus on orders.statusid = orderstatus.id 
where orderstatus.name in ('invoiced', 'shipped')"`

-- 
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to