Monday, September 29, 2008

I can plot that data in two keystrokes

(plus a carriage return)

One of the ideas I most gleefully stole from YASQL for sqlpython is special terminators, sequences like \g and \c that replace a SELECT statement's ending semicolon. When a query ends with a special terminator, the output is specially formatted: \c gives CSV, \h gives HTML, \t gives transposed (columns as rows / rows as columns), etc. Type help terminators for details.

sqlpython 1.5.0 is out today, with the most demented special output format yet: CHARTS! Instant ad-hoc grapical goodness direct from your query, no tedious mucking around in spreadsheets or exporting to another program. Just terminate your query with \l (line graph), \L (scatter graph - no lines), \p (pie chart), or \b (bar graph).

Also, as of 1.5.0, it's pretty easy to define your own special terminators and formats. Just install sqlpython in uncompressed form (easy_install -UZ will do that), open up, and follow the pattern.


Steve said...

Good stuff--thanks for sharing.

Luca Canali said...

Hi Catherine,

I really like this latest addition to sqlpython. Very well done!


Paul Moore said...

Instant thought - sqlpython doesn't seem to display stuff printed with dbms_output. Have I just missed an option that I need to set? (The documentation seems a bit hard to locate).

Unknown said...

You're right, Paul, dbms_output isn't working yet. Sadly, I don't even know how to make it work. I'm eager for any suggestions...

Luca Canali said...

Indeed that's an interesting question. I see from this post on asktom a possible solution related to the jdbc clients which may give some ideas: