emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] orgtbl-to-sqlinsert


From: Thomas S. Dye
Subject: [O] orgtbl-to-sqlinsert
Date: Sun, 02 Feb 2014 10:09:10 -1000

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]