home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!uswnvg!nv6.uswnvg.com!mmcgreg
- From: mmcgreg@uswnvg.com (Mark McGregor)
- Newsgroups: comp.databases.oracle
- Subject: Re: How to print something in PL/SQL
- Message-ID: <2676@uswnvg.uswnvg.com>
- Date: 8 Sep 92 16:33:11 GMT
- References: <2662@uswnvg.uswnvg.com>
- Sender: news@uswnvg.uswnvg.com
- Organization: U S WEST NewVector Group, Inc.
- Lines: 47
- X-Newsreader: Tin 1.1 PL5
-
- : Oracle, in their infinite wisdom, has deemed it appropriate that PL/SQL
- : have no native print utilities. A rather hideous means of "printing"
- : is to write results to a table and then print them out with a select
- : statement following the PL/SQL script. But this is horrible (and costly
- : in terms of extra database access) alternative to a print statement.
- :
-
- It was correctly pointed out by various people that PL/SQL has no print
- statements because it is implemented in the DB kernel.
-
- So, I apologize for getting on the soapbox, but, I still think that
- something could be done. Sybase has already implemented stored procedures
- as part of there kernel and also includes a message and error facility
- with the following specifications:
-
- Sybase PRINT command
-
- example:
-
- if exist (select * from table) where something = something
- print "something"
-
- This allows you to send up to a 255 character message. The application
- message handler then can determine what to do with the message.
-
- The other form of generating a message is the Raiserror.
-
- This form has the syntax:
-
- Raiserror #### 'message'
-
- It works the same as print, but it also sets the @@ERROR variable to
- ####. The message can be accessed by the application programs message
- handler.
-
- These commands can be placed directly in stored procedures which can
- be accessed by various applications which can either do something
- with the message or ignore the message.
-
-
- Although this is not the worlds greatest feature, at least it allows the
- user to do messaging from within the procedural language. I think that the
- key thing here is that the application message handler determines what to
- do with the message.
-
- Mark McGregor -- mmcgreg@uswnvg.com
-
-