From: tsd@tsdye.com (Thomas S. Dye)
To: Org-mode <emacs-orgmode@gnu.org>
Subject: orgtbl-to-sqlinsert
Date: Sun, 02 Feb 2014 10:09:10 -1000 [thread overview]
Message-ID: <m1ha8hz389.fsf@tsdye.com> (raw)
Aloha all,
I'm expecting column names in the "foo( )" part of the INSERT statement.
I've done my best to understand
http://orgmode.org/worg/org-tutorials/multitarget-tables.org.html but
appear to have failed.
Can someone help?
*** Experiment with orgtbl-sqlinsert
#+name: test-table
| one | two |
|-----+--------|
| 1 | Buckle |
| 2 | Shoe |
| 3 | Open |
| 4 | Door |
#+name: test-bed
#+header: :var x=test-table
#+begin_src emacs-lisp
(require 'orgtbl-sqlinsert)
(orgtbl-to-sqlinsert x '(:sqlname "foo" :fmt (1 "%s")))
#+end_src
#+results: test-bed
: BEGIN TRANSACTION;
: INSERT INTO foo( ) VALUES ( 1 , 'Buckle' );
: INSERT INTO foo( ) VALUES ( 2 , 'Shoe' );
: INSERT INTO foo( ) VALUES ( 3 , 'Open' );
: INSERT INTO foo( ) VALUES ( 4 , 'Door' );
: COMMIT;
All the best,
Tom
--
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com
next reply other threads:[~2014-02-02 20:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 20:09 Thomas S. Dye [this message]
2014-02-02 21:19 ` orgtbl-to-sqlinsert Thierry Banel
2014-02-02 23:47 ` orgtbl-to-sqlinsert Thomas S. Dye
2014-02-04 21:18 ` orgtbl-to-sqlinsert Thierry Banel
2014-02-04 22:00 ` orgtbl-to-sqlinsert Thomas S. Dye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1ha8hz389.fsf@tsdye.com \
--to=tsd@tsdye.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.