Skip to Content.
Sympa Menu

baslinux - Re: [BL] dbf to sql convertor, was Re: Spanish dollybase,

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] dbf to sql convertor, was Re: Spanish dollybase,
  • Date: Mon, 14 Jul 2008 10:18:20 GMT


> > select * from postamt;
> select was not mentioned in the .help output.
>

This is because it is standard SQL (Structured Query Language), rather than
a sqlite command.

> This displays all fields (as columns of information, one record per line)
>
> If I have fields A B C D....
>
> >select A, B from postamt displays just columns A and B
> (Space optional after the comma)
>
> I can start with:
> sqlite -header postamt
>
> Displays column headers but they are not lined up with the columns.
> I could pad the headers to have spaces at their ends.
>
> Maybe sqlite3 fixes this.
>
> A|B|
> Entry |Entry
> Entry |Entry

if you use column mode (by starting with -column, or entering

.mode column

column headers line up

>
> sqlite -column postamt
> Displays in columns, one record per line
>
> sqlite -row postamt
> Displays one field per row (similar to what dbf filename.dbf displays).
>
> Up arrow works even within sqlite to repeat a previous command (including
> commands made during a previous usage, after quitting and restarting).
> Nice.
>
> Minor drawback:
>
> Unlike my DOS database programs (where hitting right arrow moves you
> to the next column and it is all lined up neatly, with some entries
> offscreen), if I have more than 80 columns it wraps instead of letting me
> scroll to the right. I could get 160 columns by using a framebuffer kernel
> and vga 793 (or a matrox video card that you can use fbset with). Any
> other ideas?

Run in a batch file, and view the results in an editor.

e.g create a file select.sql:

.header on
.mode column
select * from postamt;

and then run

sqlite < select.sql > output.txt

and view output.txt with the editor of your choice.

>
> For some unknown reason my large database just now imported properly into
> a db file. I must have done something wrong before. I did not see 'syntax
> error' scroll by this time, but it does complain about \ (or was it /?)
> not being an acceptable character (in \' inside words, as opposed to '
> that delimits field entries). But they don't seem to show up in the
> output (what you see onscreen with sqlite).
>
> All I need to learn now is to edit, append, insert, copy, and sort
> entries, which are also not in the help output but may be in sqlite.gz man
> page.

You want to find an SQL tutorial. There are loads of them online.

e.g.

http://www.sql-tutorial.net/

http://www.dbbm.fiocruz.br/class/Lecture/d17/sql/jhoffman/sqltut.html

SQL is a standard language for querying databases. It takes a bit more time
to
learn than the point and click type things you can do with access or other
simple databases, but is way more powerful.

Cheers

Ian




Archive powered by MHonArc 2.6.24.

Top of Page