emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Help with Babel and using SQL


From: yesare
Subject: Re: [Orgmode] Help with Babel and using SQL
Date: Sun, 13 Feb 2011 09:20:02 -0600

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 <address@hidden> wrote:
Hi Yesare,

I'm not familiar enough with Babel to give you useful guidance,
but others on the list may help you.

yesare <address@hidden> 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


reply via email to

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