Specifications

20 – Using PlantScape Data in Other Applications
432 R400
SQL Report Example
The following example is written for Microsoft SQL Server. Some of the SQL
syntax is specific to Microsoft SQL Server, for example, getdate().
SQL Input Data Reference File
/* insert values from Points "01SQLANA","01SQLSTA" to ODBC-compliant database
"testtable"*/
insert into testtable
values(
"@ Pointref Pointname 01SQLANA parameter name @",
getdate(),
"@ Pointref Pointname 01SQLANA parameter PV @",
"@ Pointref Pointname 01SQLSTA parameter PV @",
"@ Pointref Pointname 01SQLANA parameter A1 @",
"@ Pointref Pointname 01SQLSTA parameter H1H @",
"@ Pointref Pointname 01SQLANA parameter OP @");
/* read from ODBC-compliant database "testtable" to Points
"01SQLANA","01SQLSTA"""*/
select distinct testint from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLSTA parameter PV @"
select distinct testsmall from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLANA parameter A1 @"
select distinct smallfloat from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLSTA parameter H1M @"
select distinct testint from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLSTA parameter OP @"
select distinct smallfloat from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLANA parameter SP @"
select distinct name from testtable where name=’01SQLANA’;
"@ Pointref Pointname 01SQLSTA parameter DESC @"
/* read from a user table 4 (file 254) to ODBC-compliant database "testtable"*/
insert into testtable
values(
‘New Record’,
"@ tableref tablenum 254 record 1 word 1 datetime @",
"@ tableref tablenum 254 record 1 word 2 float double 4int 2int bit 0 size 8@"
);
/* read from user table 4 to ODBC-compliant database "testtable" with record
offset */
insert into testtable
values(
plscpcg.book Page 432 Monday, May 28, 2001 10:11 AM