Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql]

The tag has no usage guidance.

0
votes
0answers
34 views

Is possible to execute sql query direct in org mode?

windows 10, emacs 26.1 I know that in org mode I can insert source code and execute them. Nice. But what about sql: Here in my.org file: #+name: some_query #+BEGIN_SRC sql SELECT * FROM ...
1
vote
1answer
30 views

org-babel-execute:sql: reciving erros and no returns

#+name: Part 1 Task 1 #+header: :engine mysql #+header: :dbhost localhost #+header: :dbuser subject #+header: :dbpassword 1234 #+header: :database hmsec #+begin_src sql SELECT sensorId, type, ...
0
votes
0answers
15 views

servicename in sql-oracle (without tnsnames.ora)

I would like to use emacs to connect to Oracle, and run sql code from a buffer as I do using Oracle SQL Developer. I was able to trick sql-mode into connecting me to Oracle by using the minibuffer ...
3
votes
0answers
118 views

can emacs be taught what tables exist in a sql database

In emacs (in whatever mode you recommend for accessing a Postgres database) is it possible to type select * from foo_<tab> and somehow get autocomplete/help as to what tables are available ...
1
vote
1answer
127 views

Aggressive SQL indentation in emacs

I want an emacs SQL indentation function with the following properties: Upcase { select, from, as, where, group by, order by, asc, desc, and, or }. - EDIT: there are sqlup-mode.el and sql-upcase.el ...
1
vote
0answers
16 views

How do I insert code block header :var in exported code block in org-mode for SQL

I cannot repeat solution mentioned in 27610 for SQL. Seems there is no org-babel-variable-assignments:sql function in org.el.
0
votes
0answers
75 views

Open multiple *SQL* buffers (same product)

I connect to postgres by placing the following in a file on a remote server, opening over tramp, and executing: (setq sql-connection-alist '((pool-my_db (sql-product 'postgres) ...
2
votes
0answers
152 views

Org sql header args dont seem to work why?

Can anyone explain why this does not work, i want to set the parameters global to the current document using PROPERTY but this does not work and results in this error. (wrong-type-argument stringp ...
1
vote
2answers
626 views

less psql, more emacs

I was listening to this song today - https://www.youtube.com/watch?v=ajy71xw351E Don't Wanna Leave You Now 🎵 🎶 and I realized how much I don't want to leave emacs. I often do this after ...
0
votes
0answers
172 views

How do you perform sql queries in emacs-lisp scripts?

I am building a database application to index org-mode files (http://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/). The first iteration used emacsql, which worked well ...
2
votes
1answer
159 views

What's the proper new-style form for passing header args to all sql code blocks?

I guess I've been out of the loop for a while. I used to have this at the end of my org-mode SQL files: #+PROPERTY: engine mysql #+PROPERTY: dbhost xx.xx.xx.xx #+PROPERTY: dbuser xxxxxx #+PROPERTY: ...
2
votes
0answers
59 views

How to use company-transform to uppercase SQL keywords

company-transform seems can be used to apply function on candidates. How to uppercase all SQL keywords which are in company complete candidates? only apply this transform function in SQL/NoSQL ...
1
vote
2answers
127 views

Avoid to create a new window in sql mode

I use a monitor and a laptop screen as my multimonitor setup. Unfortunately the monitor and the laptop differs in resolution. So I use 2 frames, one frame on the monitor and one frame on the laptop ...
2
votes
2answers
959 views

How to change the indentation of major mode (SQL-mode)?

Configuration: Emacs 25.0.50 on Ubuntu 15.04. How to produce? Do emacs -Q, then M-x sql-mode. Paste the following in the buffer: SELECT SUM(T01.foobar) FROM db_foo.bar T01 WHERE T01.fooID = ...
1
vote
0answers
44 views

Edit Joomla Articles with Emacs

Editing Joomla articles in the web interface is the most pain the world. The articles in Joomla are stored in a mysql database. I'd like to figure out how I can connect a buffer to a "value" in ...
2
votes
1answer
126 views

How do I make multiple buffers use a single sql connection?

I am using sql mode. Is there a way to connect multiple buffers to a single sql connection? When I try to connect an existing buffer to a database, it always creates a new connection instead of ...
1
vote
0answers
156 views

sql-connect: (setting-constant nil)

I am using latest Helm from MELPA on Emacs GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-11 When I issue sql-connect I see this: The only connection I have saved (in ...
0
votes
1answer
129 views

Switch syntax highlighting of open buffer from web-mode (freemarker) to sql

we use web-mode (freemarker engine) to edit source files that contain freemarker directives and a lot of SQL. Editing in web-mode (freemarker engine) works fine. It would be very helpful if we could ...
6
votes
2answers
1k views

org-babel and remote sql commands

I'm using org-babel to do litterate programming and I find it very convenient. I am able to execute shell commands on remote hosts, and local database commands with the postgres client. To open a file ...
5
votes
2answers
738 views

How to indent SQL code just 4 spaces, without alignment &c?

SQL mode has some cool stuff set up for indenting with aligned keywords and such. Normally, I'd think it was cool. The problem is that at my new job, the people who wrote our mountains of sql did not ...
0
votes
1answer
240 views

Emacs connect to MySQL (MariaDB) non-interactively

I am looking into sql.el, and I can't find a way to bypass creating comint buffer and setting some global variables in order to connect to the database. This is less than ideal because I know the ...
14
votes
4answers
3k views

Automatically formatting SQL code

There are some general well-known coding standards and styles for SQL (e.g. capitalizing reserved words, placing main keywords in different lines, etc.). Does Emacs come with any modes for this, or ...