If you have invoked a database, you have the necessary privileges to use the DECLARE_STREAM statement. Use the DECLARE_STREAM statement in conjunction with the declared START_STREAM statement. The DECLARE_STREAM statement will not work in conjunction with the undeclared START_STREAM statement. Rdb recommends that all programs use the DECLARE_STREAM statement (with the declared START_STREAM statement) instead of the undeclared START_STREAM statement. The declared START_STREAM statement provides all the functions of the undeclared START_STREAM statement and provides more flexibility in programming than the undeclared START_STREAM statement. Put the DECLARE_STREAM statement before the associated declared START_STREAM, FETCH, and END_STREAM statements. The DECLARE_STREAM statement allows the use of fewer or more END_STREAM statements than START_STREAM statements within the same module, as long as at execution time exactly one END_STREAM statement is executed for each START_STREAM statement. RDO does not allow a record stream from which data values cannot be fetched by DBKEY (views that retrieve values from streams defined using the SQL GROUP BY or UNION clauses) to be declared or started. Such attempts produce the following exception: VWNOFETCH view 'view-name' cannot be fetched within a stream