Home | Features | F A Qs | Download | Purchase | Links | Support | Contact us  


Boffin Examples
 

The Dinosaur Database

 

Dino_Excel_Email_Example1.sql  

/* This is a Email example */

/* This example runs 3 queries and outputs them to one Excel spreadsheet called DINO.XLS as 3 separate sheets called PERIODS, FEEDER_TYPE and DINOSAURS. The spreadsheet is created automatically. 
*/
/* NOTE always precede the query with the Spool commands making the query the last part of each block. Terminate each query with a semicolon (;) */

/* The Email address below will send you a reply to confirm that it is working */

Emailto = "test@boffin.org.uk"
-- there should be only one Email address. 
-- if there is more than one than the last one takes precedence.
SpoolExcel = "C:\Temp\Dino.xls"
SpoolSheet = "Periods"
Select 
DINO_PERIOD.PERIOD "Period",
DINO_PERIOD.PERIOD_DESCRIPTION "Description" 
From DINO_PERIOD 
Order by DINO_PERIOD.PERIOD;

SpoolSheet = "Feeder Type"
Select 
DINO_FEEDER.FEEDER "Type of Feeder",
DINO_FEEDER.FEEDER_MEANING "Meaning" 
From DINO_FEEDER 
Order by DINO_FEEDER.FEEDER;

SpoolSheet = "Dinosaurs"
Select 
DINOSAURS.DINO_NAME "Name",
DINOSAURS.MEANING "Meaning",
DINOSAURS.PERIOD "Period",
DINOSAURS.LIVED "Lived",
DINOSAURS.FOUND "Found In",
DINOSAURS.BODY_LENGTH "Body Length (m)",
DINOSAURS.BODY_HEIGHT "Body Height (m)",
DINOSAURS.BODY_WEIGHT "Body Weight (kg)",
DINOSAURS.MOVED "Moves on",
DINOSAURS.FEEDER_TYPE "Type of Feeder",
DINOSAURS.FOOD "Eats",
DINOSAURS.DESCRIBED_BY "Described By",
DINOSAURS.YEAR_DESCRIBED "Year Described",
DINOSAURS.UPDATE_DATE "Last Updated On"
From DINOSAURS
Order by DINOSAURS.PERIOD,
DINOSAURS.DINO_NAME;

This example creates an Excel spreadsheet called DINO.XLS with 3 worksheets on for each query called  'Period', 'Feeder Type' and 'Dinosaurs'. 

The spreadsheet is Emailed to test@boffin.org.uk

To return to the list of examples click here
 


Copyright © Boffin Associates, 2005
Oracle® is a registered trademark of the Oracle Corporation 
Microsoft®,  Excel®  and Access® are registered trademarks of Microsoft Corporation