HELPLIB.HLB  —  RDML72  Statements  Undeclared START STREAM
    Declares and opens a record stream. The undeclared START_STREAM
    statement:

    o  Forms a record stream from one or more relations. The record
       selection expression determines the records in the record
       stream.

    o  Places a pointer for that stream just before the first record
       in this stream.

    You must then use the FETCH statement to advance the pointer one
    record at a time through the stream and other RDML statements
    (for example, MODIFY and ERASE) to manipulate each record.

1  –  Examples

    The following programs:

    o  Create a record stream, CURRENT_INF_STREAM, consisting of the
       CURRENT_INFO record sorted by highest salary first

    o  Fetch the first record, thereby fetching the CURRENT_INFO
       record with the highest salary

    o  Display a message about that record

1.1  –  C Example

    #include <stdio.h>
    DATABASE PERS = FILENAME "PERSONNEL";

    main()
    {
    READY PERS;
    START_TRANSACTION READ_ONLY;

    START_STREAM CURRENT_INF_STREAM USING
       CI IN CURRENT_INFO SORTED BY DESC CI.SALARY;
       FETCH CURRENT_INF_STREAM;
          printf ("%s makes the largest salary!\n", CI.LAST_NAME);
    END_STREAM CURRENT_INF_STREAM;

    COMMIT;
    FINISH;
    }

1.2  –  Pascal Example

    program record_stream (input,output);
    DATABASE PERS = FILENAME 'PERSONNEL';

    begin
    READY PERS;
    START_TRANSACTION READ_ONLY;

    START_STREAM CURRENT_INF_STREAM USING
       CI IN CURRENT_INFO SORTED BY DESC CI.SALARY;
       FETCH CURRENT_INF_STREAM;
          writeln (CI.LAST_NAME, ' makes the largest salary!');
    END_STREAM CURRENT_INF_STREAM;

    COMMIT;
    FINISH;
    end.

2  –  Format

  (B)0START_STREAM qqqwqq>qqqqqqqqqqqqqqqqqqwqqq> stream-name qqqqqqk
                  mqq> handle-options qqj                       x
                                                                x
  lqqqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
  x
  mqqqqqqqq>  USING  qqqq>  rse  qqqqwqqqqqqqqqqqqqqqwqqqqqqqqqq>
                                     mqq> on-error qqj

  (B)0on-error =

  ON ERROR qqwqqq> statement qqqqwqqq> END_ERROR
             mqqqqqqqqq<qqqqqqqqqj

  (B)0handle-options =

  q> ( qwqqqqqq>  REQUEST_HANDLE  qqqqq>  var qqqqqqqqwq> ) q>
        tqqqqqq> TRANSACTION_HANDLE qqq>  var qqqqqqqqu
        mqqqqqq> REQUEST_HANDLE q> var q> , qqqqqqqk  x
          lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  x
          mqqqq> TRANSACTION_HANDLE q> var qqqqqqqqqqqj

2.1  –  Format arguments

    stream-name            The stream that you create. The stream-
                           name must be a valid operating system
                           name.

    rse                    A record selection expression. A phrase
                           that defines specific conditions that
                           individual records must meet before
                           Oracle Rdb includes them in a record stream.

    on-error               The ON ERROR clause. Specifies host
                           language statement(s) to be performed
                           if an error occurs during the START_STREAM
                           operation. For more information see the
                           entry on ON ERROR.

    handle-options         A request handle, a transaction handle, or
                           both.

    REQUEST_HANDLE var     The REQUEST_HANDLE keyword followed by a
                           host language variable. A request handle
                           identifies a compiled Oracle Rdb request.
                           If you do not supply a request handle
                           explicitly, RDML associates a unique
                           request handle for the compiled request.

    TRANSACTION_HANDLE     The TRANSACTION_HANDLE keyword followed by
    var                    a host language variable. A transaction
                           handle identifies a transaction. If
                           you do not supply a transaction handle
                           explicitly, RDML uses the default
                           transaction handle.
Close Help