! sqrsh (sqr shell) ! Copyright (C) 1997 Ray Ontko & Company ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! !++ ! ! sql ! ! sql rest_of_line ! ! treats rest_of_line a a sql command (non-select) and ! executes it. ! ! note: we should modify this to allow multi-line. ! in order to do this, we should simply keep prompting until ! we get a line that ends in a semi-colon, which we will strip ! off. This should be captured in a separate routine, which we ! can use for a number of other commands (explain plan, select, etc). ! !-- ! ! Author ! ! Ray Ontko ! Ray Ontko & Company ! Richmond, In 47375 ! ! ! Modification History ! ! Name Date Comment ! ---------------- ---------- ---------------------------------------- ! Ray Ontko 1997/06/01 Added this header ! Ray Ontko 1997/06/11 Modified to work with SQR 2.5.x ! !-------------------------------------------------------------------- sql begin-procedure sql local #if {SQR-DATABASE}=ORACLE let $_p1 = substr($_command,5,length($_command)-4) begin-sql on-error=sql_error [$_p1] end-sql #else show 'sqrsh: "sql" is only available for ORACLE at the present time' #endif end-procedure ! sql !-------------------------------------------------------------- sql_error begin-procedure sql_error show 'sqrsh: Unable to excute "' $p1 '"' show $sql-error end-procedure ! sql_error