[firebase-br] Tesouro escondido FB2.0

Jeudí Prando jeudiprando em gmail.com
Qua Set 13 00:27:00 -03 2006


sei que muita gente pode ja conhecer...
mas...
eu ouvia falar muito na pasta doc que esta dentro da pasta de instalacao 
do Firebird2.0
bom nunca tinha nem se quer dado uma olhada... hoje resolvi ver o que 
esta la dentro

e olha o que eu achei...
documentacao para varios comandos sql e psql

README.aggregate_tracking.txt
README.case.txt
README.coalesce.txt
README.context_variables.txt
README.context_variables2.txt
README.current_time.txt
README.cursors.txt
README.data_types.txt
README.data_type_results_of_aggregations.txt
README.ddl.txt
README.default_parameters.txt
README.derived_tables.txt
README.distinct.txt
README.exception_handling.txt
README.execute_block.txt
README.execute_statement.txt
README.explicit_locks.txt
README.expression_indices.txt
README.iif.txt
README.isc_info_xxx.txt
README.keywords.txt
README.leave_labels.txt
README.length.txt
README.nullif.txt
README.null_value.txt
README.order_by_expressions_nulls.txt
README.plan.txt
README.PSQL_stack_trace.txt
README.returning.txt
README.rows.txt
README.savepoints.txt
README.select_expressions.txt
README.sequence_generators.txt
README.set_transaction.txt
README.trim.txt
README.universal_triggers.txt
README.view_updates.txt

exemplo:

README.cursors.txt


---------------------
PSQL cursors (FB 2.0)
---------------------

  Function:
    Allows explicit cursor operations.

  Author:
    Dmitry Yemanov <dimitr em users.sf.net>

  Syntax rules:
    DECLARE [VARIABLE] <cursor_name> CURSOR FOR ( <select_statement> );
    OPEN <cursor_name>;
    FETCH <cursor_name> INTO <var_name> [, <var_name> ...];
    CLOSE <cursor_name>;
    
  Example(s):
    1. DECLARE RNAME CHAR(31);
       DECLARE C CURSOR FOR ( SELECT RDB$RELATION_NAME
                              FROM RDB$RELATIONS );
       BEGIN
         OPEN C;
         WHILE (1 = 1) DO
         BEGIN
           FETCH C INTO :RNAME;
           IF (ROW_COUNT = 0) THEN
             LEAVE;
           SUSPEND;
         END
         CLOSE C;
       END

    2. DECLARE RNAME CHAR(31);
       DECLARE FNAME CHAR(31);
       DECLARE C CURSOR FOR ( SELECT RDB$FIELD_NAME
                              FROM RDB$RELATION_FIELDS
                              WHERE RDB$RELATION_NAME = :RNAME
                              ORDER BY RDB$FIELD_POSITION );
       BEGIN
         FOR
           SELECT RDB$RELATION_NAME
           FROM RDB$RELATIONS
           INTO :RNAME
         DO
         BEGIN
           OPEN C;
           FETCH C INTO :FNAME;
           CLOSE C;
           SUSPEND;
         END
       END

  Note(s):
    1. Cursor declaration is allowed only in the beginning of a PSQL 
block/procedure/trigger
       (like a regular local variable declaration).
    2. Cursor names are required to be unique in the given context. They 
cannot interfere
       with FOR SELECT cursor (declared via the AS CURSOR clause) names. 
But a cursor can
       share its name with any variable in this context, as possible 
operations are different.
    3. Positioned updates and deletes with cursors using the WHERE 
CURRENT OF clause are allowed.
    4. Attempts to fetch from or close a FOR SELECT cursor are prohibited.
    5. Attempts to open cursor which is already open, as well as to 
fetch from or close cursor
       which is already closed, will fail.
    6. All cursors which were not explicitly closed will be closed 
automatically on exit of
       the current PSQL block/procedure/trigger.
    7. ROW_COUNT system variable can be used to check whether the last 
FETCH statement returned
       any row.

  See also:
    README.context_variables

com exemplos e observacoes... estou nadando em informacao

espero ter ajudado alguem...

boa sorte!




Mais detalhes sobre a lista de discussão lista