Thanks.

I opened up ob-sql.el and read the code to see if I can figure it out.

I think I have answered my first question.  I wrote the following and hit
C-c C-c and I got the result set back.

#+srcname: sampsql
#+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D
dbname
select * from tablename;
#+end_src

regarding my 2nd question (reading orgtables), I am thinking that one can't
read orgtables in the same way as you read a db table.  But you can use an
org table to extract data snippets to pass as variables to a sql or build a
dynamic sql. Is my understanding correct?


I was also experimenting on passing variables.  I modified the above example
as shown below but I did not get any results

#+srcname: sampsql
#+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D
dbname :var table="tablename"
select * from $table;
#+end_src







On Sun, Feb 13, 2011 at 3:08 AM, Bastien <bastien.gue...@wikimedia.fr>wrote:

> Hi Yesare,
>
> I'm not familiar enough with Babel to give you useful guidance,
> but others on the list may help you.
>
> yesare <email....@gmail.com> writes:
>
> > I am trying to do two things.
> >
> >
> >  1. Query a mysql or oracle table and post results in orgtable format
> >  2. Select data from an existing orgtable in current buffer and do
> >     further processing with them (example: insert them into Oracle).
> >
> > I am sorry if this is vague but I am just looking for some initial
> > guidance on how to get around.
>
> Can you post the code your tried?  What you expected?  What happened
> instead?   This will help people to know where and why you're stuck.
>
> Thanks!
>
> --
>  Bastien
>
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to