Specify multiple lines value in WebChart defination

Links: http://www.dbatools.net/mytools/webchart_multi_lines_value.html

    WebChart plays more and more important role in my team, now all of the production DBAs are able to create pages on it. And they gave some good suggestions to make it better. It's easier to specify multiple lines value (SQL query) in WebChart defination files now.

    In previous releases, you must use a reverse slash character to combine next line, such as follwoing.

WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
  extract(month from trade_month) month, \
  extract(year from trade_month) year1, \
  trade_count+0 as count1 \
  from trade_summary_monthly
WEBCHART.CROSSTAB_1=month|year1,year2|count1,count2
WEBCHART.LENGTH=50|135|135

    Now you don't need to use the reverse slash character, if the next line starts with white space (space, tab), it will be treated as a continue line of current line, for example.

WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select
  extract(month from trade_month) month,
  extract(year from trade_month) year1,
  trade_count+0 as count1
  from trade_summary_monthly
WEBCHART.CROSSTAB_1=month|year1,year2|count1,count2
WEBCHART.LENGTH=50|135|135

    It's quite unconvinent to use reverse slash character. But now you can just copy and paste whole SQL query without any modification between WCML files and database interactive utilities.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36