[Index]

sql-results-sheet


Writes SQL results to an output stream.

Property Summary

dataOnly Don't display headings.
empty  
name  
output The output stream to write results to.
to  

Example Summary

Example 1 A result sheet for multiple statements.

Property Detail

dataOnly

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo. Defaults to showing headings.

Don't display headings.

empty

AccessREAD_ONLY

name

Configured ByATTRIBUTE
AccessREAD_WRITE

output

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo. Defaults to stdout.

The output stream to write results to.

to

Configured ByELEMENT
AccessREAD_WRITE


Examples

Example 1

A result sheet for multiple statements.

<oddjob>
  <job>
    <sql>
      <connection>
        <connection driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:mem:SQLResultsSheet_Example" username="sa" password=""/>
      </connection>
      <input>
        <buffer>
create table FRUIT(
  TYPE varchar(16),
  VARIETY varchar(16),
  COLOUR varchar(32),
  SIZE double);
insert into FRUIT values ('Apple', 'Cox', 'Red and Green', 7.6);
insert into FRUIT values ('Orange', 'Jaffa', 'Orange', 9.245);

select * from FRUIT;

shutdown;
        </buffer>
      </input>
      <results>
        <sql-results-sheet/>
      </results>
    </sql>
  </job>
</oddjob>
This writes the following to the console:
 [0 rows affected, 16 ms.]
 
 [1 rows affected, 0 ms.]
 
 [1 rows affected, 0 ms.]
 
 TYPE    VARIETY  COLOUR         SIZE
 ------  -------  -------------  -----
 Apple   Cox      Red and Green  7.6
 Orange  Jaffa    Orange         9.245
 
 [2 rows, 212 ms.]
 
 [0 rows affected, 0 ms.]
 
 


(c) R Gordon Ltd 2005 - Present