× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



<snip>
RENAME TABLE IAMMORETHAN10
  to system name MY10CHRNAM;
</snip>

This is from the read me for my compile utility showing example of
creating SQL table using Create table and rename. 

I don't know if it has already been said but my number one reason for
preferring SQL over DDS is that I have a graphical interface in Ops Nav
that is wonderful to build tables. I can build everything graphically
and then if I need a script for install, I just generate and edit for
the below.

I absolutely hate typing DDS.

I recommend V5R3 or V5R4 of Client Access and Ops. Huge changes in Ops
Nav and database in these releases. 

Neat thing to look at too is the Database Diagramming. If you setup
databases with referential integrity, let's you create a diagram showing
all the relationships, index, etc. Just wish we had databases set with
referential integrity.   

Note the short name on the create table and then the two renames. In
this way, the record format name is correct.  

/*   *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3)                       */
/*   *_> RUNSQLSTM SRCFILE(@2/@1) SRCMBR(@3) +                      */
/*   *_>   DFTRDBCOL(@5) CLOSQLCSR(*ENDMOD) ERRLVL(20)              */
/*   *--------------------------------------------------------------*/
/*   * SQL File: OIMACROPGM         Project.....:                   */
/*   * Author..: A. Campin          Date written: 06/07/2006        */
/*   * Purpose.: Create SQL Table OI_MACRO_PROGRAMS.                */
/*   * ------------------------------------------------------------ */
/*   * Revision history:                                            */
/*   *  Proj#  Pgmr         Date    Desc                            */
/*   *                                                              */
/*   *  End Revision History                                        */
/*   *------------------------------------------------------------- */

DROP TABLE OI_MACRO_PROGRAMS;

CREATE TABLE OIMACROPGM (
  MACPGM_MACRO_NUMBER FOR COLUMN MPMACRONUM DECIMAL(3, 0) NOT NULL ,
  MACPGM_TYPE FOR COLUMN MPMACROTYP CHAR(1) CCSID 37 NOT NULL ,
  MACPGM_RUN_SEQ FOR COLUMN MPRUNSEQ   SMALLINT NOT NULL ,
  MACPGM_PROGRAM_NAME FOR COLUMN MPPGMNAM   VARCHAR(10) CCSID 37 NOT
NULL ,
  MACPGM_PROGRAM_LIBRARY FOR COLUMN MPPGMLIB   VARCHAR(10) ALLOCATE(5)
   CCSID 37 NOT NULL DEFAULT  '*LIBL' ,
  MACPGM_ACTIVE FOR COLUMN MPACTIVE CHAR(1) CCSID 37 NOT NULL
   DEFAULT 'Y',
  CONSTRAINT OIMACROPGM_MPMACRONUM_00001 PRIMARY KEY(
MACPGM_MACRO_NUMBER ,
          MACPGM_TYPE , MACPGM_RUN_SEQ ) ) ;

RENAME OIMACROPGM TO OI_MACRO_PROGRAMS;

RENAME OI_MACRO_PROGRAMS TO SYSTEM NAME OIMACROPGM;

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPMACRONUM_00002
        CHECK( MACPGM_MACRO_NUMBER <> 0 ) ;

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPPGMLIB_00001
        CHECK( MACPGM_PROGRAM_LIBRARY
           NOT IN('*CURLIB','*USRLIBL','*ALL','*ALLUSR'));

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPRUNSEQ_00001
        CHECK(MACPGM_RUN_SEQ <> 0);

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPMACROTYP_00001
        CHECK(MACPGM_TYPE IN ('F','R'));

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPPGMNAM_00001
        CHECK( MACPGM_PROGRAM_NAME <> ' ' ) ;

ALTER TABLE OI_MACRO_PROGRAMS
        ADD CONSTRAINT OIMACROPGM_MPACTIVE_00001
        CHECK(MACPGM_ACTIVE IN ('Y','N'));

LABEL ON TABLE OI_MACRO_PROGRAMS
        IS 'Qualcomm Macro Processing Programs.' ;

LABEL ON COLUMN OI_MACRO_PROGRAMS
( MACPGM_MACRO_NUMBER IS 'Macro               Number' ,
  MACPGM_TYPE IS 'Macro               Type' ,
  MACPGM_RUN_SEQ IS 'Run                 Seq' ,
  MACPGM_PROGRAM_NAME IS 'Program              ' ,
  MACPGM_PROGRAM_LIBRARY IS 'Program              ',
  MACPGM_ACTIVE IS 'Active               ');

LABEL ON COLUMN OI_MACRO_PROGRAMS
( MACPGM_MACRO_NUMBER TEXT IS 'Macro Number' ,
  MACPGM_TYPE TEXT IS 'Macro Type Forward or Return' ,
  MACPGM_RUN_SEQ TEXT IS 'Program Run Sequence' ,
  MACPGM_PROGRAM_NAME TEXT IS 'Program to Run.' ,
  MACPGM_PROGRAM_LIBRARY TEXT IS 'Program to Run.',
  MACPGM_ACTIVE TEXT IS 'Record Active Y/N.');



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.