/* ************************************************************************** */
/* EXCSQL: Execute SQL request                                                */
/* Copyright (C) 2001  Martin Rowe  <martin@dbg400.net>                       */
/*                                                                            */
/* 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 */
/* ************************************************************************** */
             CMD        PROMPT('Execute SQL statement')

             PARM       KWD(SQL) TYPE(*CHAR) LEN(825) MIN(1) +
                          EXPR(*YES) CASE(*MIXED) PROMPT('SQL +
                          statement')
             PARM       KWD(OUTPUT) TYPE(*CHAR) LEN(1) RSTD(*YES) +
                          DFT(*) SPCVAL((* 1) (*PRINT 2) (*OUTFILE +
                          3)) EXPR(*YES) PROMPT('Output')
             PARM       KWD(SRTSEQ) TYPE(Q3) DFT(*SAME) SNGVAL((*SAME) +
                          (*USRPRF) (*SYSVAL) (*HEX) (*LANGIDUNQ) +
                          (*LANGIDSHR)) PROMPT('Sort sequence')
             PARM       KWD(PRTF) TYPE(Q2) DFT(*EXCSQL) +
                          SNGVAL((*EXCSQL)) PMTCTL(P2) +
                          PROMPT('Printer file')
             PARM       KWD(OUTFILE) TYPE(Q1) FILE(*OUT) +
                          CHOICE(*NONE) PMTCTL(P1) PROMPT('File +
                          to receive output')
             PARM       KWD(OUTMBR) TYPE(E1) CHOICE(*NONE) +
                          PMTCTL(P1) PROMPT('Output member options')

 E1:         ELEM       TYPE(*CHAR) LEN(10) RSTD(*YES) DFT(*FIRST) +
                          SPCVAL((*FIRST)) EXPR(*YES) PROMPT('Member')
             ELEM       TYPE(*CHAR) LEN(8) RSTD(*YES) DFT(*REPLACE) +
                          SPCVAL((*REPLACE) (*ADD) (*UPDADD)) +
                          EXPR(*YES) PROMPT('Replace, add or update +
                          records')
 Q1:         QUAL       TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES)
             QUAL       TYPE(*NAME) LEN(10) DFT(*LIBL) +
                          SPCVAL((*CURLIB) (*LIBL)) +
                          EXPR(*YES) PROMPT('Library')
 P1:         PMTCTL     CTL(OUTPUT) COND((*EQ '3'))
             DEP        CTL(&OUTPUT *EQ '3') PARM((&OUTFILE *EQ ' +
                          ')) NBRTRUE(*EQ 0) MSGID(CPD9861)
             DEP        CTL(&OUTPUT *NE '3') PARM((&OUTFILE *NE ' +
                          ')) NBRTRUE(*EQ 0) MSGID(CPD9862)
 Q2:         QUAL       TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES)
             QUAL       TYPE(*NAME) LEN(10) DFT(*LIBL) +
                          SPCVAL((*LIBL) (*CURLIB *CURLIB)) +
                          EXPR(*YES) PROMPT('Library')
 P2:         PMTCTL     CTL(OUTPUT) COND((*EQ '2')) +
                          NBRTRUE(*GT 0)
 Q3:         QUAL       TYPE(*SNAME) LEN(10) MIN(1) EXPR(*YES)
             QUAL       TYPE(*SNAME) LEN(10) DFT(*LIBL) +
                          SPCVAL((*LIBL) (*CURLIB)) EXPR(*YES) +
                          PROMPT('Library')

-- MartinRowe - 24 Jun 2005
Topic revision: r3 - 15 Jun 2016 - 14:21:27 - MartinRowe
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DBG/400? Send feedback