Command line options:
- -h or --help
- Shows a little help.
- Used to define as integer (number) the maximum output length for fields shown in database, and so possibly speed up the process if there exist long fields like memo or longbinary in a given table.
- Produces output in HTML format instead of default CSV (Comma Separated Values, RFC 4180).
- Produces output of binary fields in C escapes format.
- Used to specify that input for SQL commands is standard input instead of command line. This is useful if you want to include a double quote (") in a given SQL command, since double quotes are trimmed by the wscript engine (ask Microsoft...). If you use unicode version of the program consider that you must encode standard input in unicode, obviously.
- Allows to specify as data protection password the given one, used to create a new database with it or read one that has it assigned.
- To generate encrypted databases.
- To (try) repair database.
- To (try) compact database.
Let's go to some examples:
A "trivial" one:
youaccess mydatabase "SELECT * FROM [mytable]"
It outputs something like:
"id", "text" "1", "hola" "2", "que" "5", "tal"
A simple one (outputs html and limits field output length to 40 characters):
youaccess ---html -short=40 mydatabase "SELECT * FROM [mytable]" > mytable.html
Is recommended to put table names and field names between brackets, for example, to prevent collision with internal (reserved) SQL identifiers.
A more complex one, but doing the same thing as previous one, with reading from standard input (substitute echo SELECT * FROM gh with type file where file is a file name with the SQL command, to perceive a more realistic and dramatic approach):
echo SELECT * FROM [mytable] | youaccess --html --short=40 --stdin mydatabase > mytable.html
Both result in this output (saved in file mytable.html), with a somewhat simplistic table:
About character encoding:
youaccess outputs in a charset fashion following of your OS configuration. Usually (at least in western OSes) is codepage 850, also known as CP850, CP 850, 850, CP-850, IBM-850 or something similar.
youaccess_unicode outputs using unicode, as its name indicates, more exactly UTF-16 (little endian), at least in my OS configuration (Windows XP, western language).
About binary and null fields:
Binary fields are printed out (when --bin option is specified) using the classic format of C programming language, that is, as the integer value of each byte preceded by backslash. For example, to represent byte value 0:
...or to represent the ASCII string 'hola':
Binary fields (when --bin option is not used) and null valued fields, come unquoted in CSV (default) format as <Binary> and <Null>, respectively. This allows some flexibilty in its use (postprocesing using a programming language, for example) with the objective of being more precise at management of different types of data values.
About output format:
Take into consideration that the default output format for SQL queries that return results is CSV, that is Comma Separated Values, to try to maximize compatibility. This means that in our case values of table fields go between double quotes and separated by commas, and that double quotes inside them are expressed repeating them, that is, this is a double quote: " and this is a double quote in CSV: "". So, as a synopsis, a double quote in CSV is a double double quote.
YouAccess is donationware, being its source code public domain.
That means you must make a donation to adquire the rights to use the software. The donations can be done via PayPal (www.paypal.com) or via SourceForge (http://sourceforge.net/projects/youaccess). PayPal is the preferred way, making the donation to the following address:email@example.com
Or directly using the following link.
Nothing more. Greetings and enjoy the app.