dbTalk Databases Forums  

[OT] An Emacs sql mode that emphasizes on coding?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss [OT] An Emacs sql mode that emphasizes on coding? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
* Tong *
 
Posts: n/a

Default [OT] An Emacs sql mode that emphasizes on coding? - 09-03-2010 , 05:36 PM






Hi,

Do you know of or use any Emacs sql mode that emphasizes on coding?
Ie, an editing mode for Emacs that supports the appropriate indentation
and hilighting for SQL editing with strict Sql Coding Style [1]?

I found that the default Emacs' sql mode is geared more towards
interactive debugging, instead of sql coding. E.g., I simply wasn't able
to indent my sql code the same way as any other programming language.

UTSL reveals that AbbrevMode is also not used, let alone using abbrevs in
code only so as NOT show capitalization you do NOT expect to use FOR [2].

What's your solution?

Thanks

[1] E.g.,

http://c2.com/cgi/wiki?SqlCodingStyle

1. Capitalize SQL keywords.
2. Put separate constraints and column names on separate lines.
3. Indent equally detailed expressions equally.
4. Use a monospace font.
5. Right align equally important SQL keywords equally.

SELECT Person.name AS firstName,
Family.name AS lastName,
Person.age
FROM Person, Family
WHERE Person.familyID = Family.ID
AND Person.gender = 'M'
ORDER BY lastName ASC, familyID ASC, firstName ASC, age DESC;

http://www.remote-dba.net/t_plsql_coding_standards.htm

Incorrect:

DaysBetween (dStartDate => dEnrolledDate,
dEndDate => dGraduationDate,
nGPA => nFinalGPA,
nDaysBetween => nDuration);

Correct:

DaysBetween (dStartDate => dEnrolledDate,
dEndDate => dGraduationDate,
nGPA => nFinalGPA,
nDaysBetween => nDuration);

[2] http://www.emacswiki.org/emacs/AbbrevMode

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.