From: Kyle R. B. <mo...@vo...> - 2003-08-06 21:38:16
|
> A few days back I posted to ask how you could use mdb-tools command line > utilities from within perl. A few folks replied but I didn't really follow > alot of it, Im not that familar with perl or mdb-tools. Just bang the > following snippit of code into your perl script: > > > open AFILE, "|mdb-sql db1.mdb>fred.txt"; > > print AFILE <<"ENDOFQUERY" ; > > list tables > go > quit > > ENDOFQUERY > > close(AFILE); > > the lines btw print AFILE <<"ENDOFQUERY" ; and ENDOFQUERY are just as you would > enter them at the command line. So I hope this helps someone in future. I am > guessing these emails are stored somewhere online. > > I do have another question. I want to select all the contents of two columns > from a table. But at the moment I can't select anything from the table because > the table name has an underscore in it! Anybody know the correct way to format > such a query? You can try enclosing it in single or double quotes: select 'col_1','col2' from table go select "col_1","col2' from table go The patch that was sent in for sql/lexer.l fixes the underscore issue - it makes more characters valid in table and column names, and in strings, specifically the patch allows any alphanumerics and the underscore in a bare (un-quoted) name, and additionaly allows spaces in a double quoted string. MS Access allows a surprising variety of characters in table names, so these additions alone are not enough to cover all the possibilities. I've seen table or column namess with the following characters in them: ~@#$%&*()-_=+,<>/\{} Hope this helps. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |