Text FormattingSQL Language Definition

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
duboismathieu
Posts: 18
Joined: Tue Apr 01, 2008 1:09 pm

SQL Language Definition

Post by duboismathieu »

Hello,

I'm using TeX Live 2012 on Ubuntu 12.04 and I recently started to (formally) learn SQL and therefore wrote a document containing SQL code. I use the listings package (Version 1.4 2007/02/22 according to the manual).

I found that a lot of keywords are not recognized because they are not present in the SQL language definition (in lstlang1.sty file). I'm not a SQL expert but some of them are really basic. For instance, REFERENCES (mandatory for foreign keys) is not recognized.

Modifying the file is not very hard. I have found a list of SQL keywords here which contains more the 800 entries. Maybe some of them are not really used. I don't know how listings will handle such a long list of keywords.

So I was wondering:
  1. if it was a decision to not include some keywords (but it seems strange to forget REFERENCES) or if it is just a mistake?
  2. what will happen if we put the 800 keywords in the file?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

SQL Language Definition

Post by cgnieder »

duboismathieu wrote:So I was wondering:
  1. if it was a decision to not include some keywords (but it seems strange to forget REFERENCES) or if it is just a mistake?
  2. what will happen if we put the 800 keywords in the file?
  1. You'll have to ask whoever has written that file in the first place...
  2. If you do that on your computer nothing special will happen. You should place it in you local texmf tree, though, as otherwise it will be overwritten with the next update of the listings package
You could try to contact the maintainer of the listings package and offer your assistance in updating the definition. That way it may become an official part of the package and other users could benefit as well.

Regards
site moderator & package author
Post Reply