(You don’t run a separate CALL command to execute the block. The BEGIN statement that defines the block also executes the block. You define the block as a separate, standalone SQL statement. When I look at the Debug window and run the statement with -/ and /, I see the following output:ġ5:23:01 executing "select sys_context( 'userenv', 'current_schema' ) from dual"ġ5:23:01 DefaultEditor-5: T4CConnection.createStatement()ġ5:23:01 DefaultEditor-5: OracleStatementWrapper.executeQuery("select sys_context( 'userenv', 'current_schema' ) from dual")ġ5:23:01 Executing.ġ5:23:01 DbConnection='Timesloot Booking - robbram-vm as timeslot' Catalog='null' Schema='null' NewCatalog='null'ġ5:23:01 DbConnection='Timesloot Booking - robbram-vm as timeslot' Catalog='null' Schema='TIMESLOT' NewSchema='TIMESLOT'ġ5:23:01 DefaultEditor-5: OracleStatementWrapper.execute("-/ġ5:23:01 DefaultEditor-5: EXCEPTION -> 圎rrorException: ORA-00911: invalid characterġ5:23:01 DefaultEditor-5: OracleStatementWrapper. An anonymous block is a block that is not part of a stored procedure. PUTLINE, instead it gives you the anonymous block completed in the script output tab. I confirm that in Tools->Tool Properties, select the General->SQL Editor->Statement Delimiters > SQL Block Identifiers: Begin and End identifiers are "-/" and "/". For example: BEGIN dbmsoutput. To Display: try using a output statement. The basic unit of a PL/SQL source program is the block, which groups related declarations and statements. 'anonymous block completed' means your PL/SQL code was successfully executed. PUTLINE not printing anonymous block completed DBMSOUTPUT. I am running it against an Oracle XE 10 db. PL/SQL, the Oracle procedural extension of SQL, is a portable, high-performance transaction-processing language that is tightly integrated with SQL. In SQL Developer, go to Menu View > DBMS Output and to enable the DBMS Output window. When I remove -/ and /, SQL > Execute works but SQL > Execute Buffer fails. A block without a name is an anonymous block. 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec A named block is stored into the Oracle Database server and can be reused later.
0 Comments
Leave a Reply. |