emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* orgtbl-to-sqlinsert
@ 2014-02-02 20:09 Thomas S. Dye
  2014-02-02 21:19 ` orgtbl-to-sqlinsert Thierry Banel
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas S. Dye @ 2014-02-02 20:09 UTC (permalink / raw)
  To: Org-mode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-04 22:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02 20:09 orgtbl-to-sqlinsert Thomas S. Dye
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).