Dynamic Sql and Ingres Report Writer 
Author Message
 Dynamic Sql and Ingres Report Writer

I would like to know if it is possible to have dynamic SQL statements
in a report specification.

There are large number of tables and columns, and I would like to
be able to prepare the select statements. But is it possible to
mix dynamic sql and report writer? If so, how do you pass the select
string to the report function?



Tue, 30 May 1995 04:42:30 GMT
 Dynamic Sql and Ingres Report Writer


Quote:

>I would like to know if it is possible to have dynamic SQL statements
>in a report specification.

>There are large number of tables and columns, and I would like to
>be able to prepare the select statements. But is it possible to
>mix dynamic sql and report writer? If so, how do you pass the select
>string to the report function?

You cannot do Dynamic SQL in the report writer, but you can use parameters
for many parts of the select statement, and pass these in at run-time.  This
includes using parameters for table names, column names, the where clause, and
the order by clause.  For example, the following report allows the user to
pass in the table name and a column name and header.  The output is tunable
because the user can specify much of the select statement.

.NAME    empdyn
.DECLARE
         table_name   = VARCHAR(32)
                        WITH PROMPT 'Please input employee table name:'
        ,where_clause = VARCHAR(80)
                        WITH PROMPT 'Please input Where Clause:'
        ,order_clause = VARCHAR(80)
                        WITH PROMPT 'Please input Order Clause:'

.QUERY
         SELECT emp_id
               ,lname
               ,fname
               ,$column_name as column_value
               ,'$column_heading' as column_header
         FROM   $table_name
         WHERE  $where_clause
         $order_clause

.NEWPAGE
.HEADER  page
   .NL 8 .CE          .PR   "LIST OF EMPLOYEES"  .NL 3
   .UNDERLINE
   .RT   emp_id       .PR   "ID"
   .TAB  fname        .PR   "NAME"
   .TAB  column_value .PR   column_header        .NL 2
   .NOUNDERLINE

.DETAIL    
   .NULLSTRING "N/A"
   .TAB 1   .PR   emp_id("zzz")
   .TAB 8   .PR   fname(c0) " " lname(c0)
   .TAB 35  .PR   column_value
   .NL

--

Steve Caswell           |   (404) 448-7727    |  "The opinions expressed are my

The Palmer Group        |   uunet!tpghq!sfc   |   but they're all I've got."



Wed, 31 May 1995 00:05:47 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Dynamic Sql and Ingres Report Writer

2. Ingres report writer + Ingres 6.4

3. ** URGENT!! Ingres report writer script - date format problem ***

4. Ingres II 2.0 Report Writer Problem

5. Ingres Report Writer on NT

6. INGRES Report-Writer Reference Manual

7. Ingres Report Writer Problem

8. Report Writer for Ingres

9. Ingres 6.4/06 - Report Writer

10. Where is INGRES Report Writer mannul?

11. Ingres Report Writer/W4GL Problem

12. Newbie question - Ingres Report Writer


 
Powered by phpBB® Forum Software