The db2 tutorial is: DB2 programming skills (7 ). 3.4 view the tables used by the sp
Select bname from syscat. packagedep where btype = 'T' and pkgname in (select bname from sysibm. sysdependencies where dname in (select specificname from syscat. procedures where procname = 'pr _ CLEAR_MATCH_DIVIDE_SHA '))
3.5 check which sp uses the function
Select PROCNAME from SYSCAT. PROCEDURES where SPECIFICNAME in (select dname from sysibm. sysdependencies where bname in (select PKGNAME from syscat. packagedep where bname in (select SPECIFICNAME from SYSCAT. functions where funcname = 'get _ CURRENT_DATE ')))
When using a function, note that if you want to drop the function, you must first drop all other stored procedures that call the function.
You must first create a function. The sp that calls this function can be created successfully.
3.6 Modify Table Structure
Add multiple fields to a table at a time
Db2 "alter table tb_test add column t1 char (1) add column t2 char (2) add column t3 int"
4 DB2 System Management
4.1 DB2 Installation
Install db2 7.1 or another version in Windows 98. If a Jdbc error occurs or Windwos 98 cannot be started, replace the content in autoexec. bat with the following content:
C: \ PROGRA ~ 1 \ TRENDP ~ 1 \ PCSCAN. exe c: \ WINDOWS \ COMMAND \/NS/WIN95
Rem C: \ WINDOWS \ COMMAND. COM/E: 32768
REM [Header]
REM [CD-ROM Drive]
REM [Miscellaneous]
REM [Display]
Set PATH = % PATH %; C: \ MSSQL \ BINN; C: \ PROGRA ~ 1 \ SQLLIB \ BIN; C: \ PROGRA ~ 1 \ SQLLIB \ FUNCTION; C: \ PROGRA ~ 1 \ SQLLIB \ SAMPLES \ REPL; C: \ PROGRA ~ 1 \ SQLLIB \ HELP
If exist c: \ PROGRA ~ 1 \ IBM \ IMNNQ \ IMQENV. bat call c: \ PROGRA ~ 1 \ IBM \ IMNNQ \ IMQENV. BAT
If exist c: \ PROGRA ~ 1 \ IBM \ IMNNQ \ IMNENV. bat call c: \ PROGRA ~ 1 \ IBM \ IMNNQ \ IMNENV. BAT
Set DB2INSTANCE = DB2
Set CLASSPATH =.; C: \ PROGRA ~ 1 \ SQLLIB \ java \ db2java.zip; C: \ PROGRA ~ 1 \ SQLLIB \ java \ runtime.zip; C: \ PROGRA ~ 1 \ SQLLIB \ java \ sqlj.zip; C: \ PROGRA ~ 1 \ SQLLIB \ bin
Set MDIS_PROFILE = C: \ PROGRA ~ 1 \ SQLLIB \ METADATA \ PROFILES
Set LC_ALL = ZH_CN
Set INCLUDE = C: \ PROGRA ~ 1 \ SQLLIB \ INCLUDE; C: \ PROGRA ~ 1 \ SQLLIB \ LIB; C: \ PROGRA ~ 1 \ SQLLIB \ TEMPLATES \ INCLUDE
Set LIB = C: \ PROGRA ~ 1 \ SQLLIB \ LIB
Set DB2PATH = C: \ PROGRA ~ 1 \ SQLLIB
Set DB2TEMPDIR = C: \ PROGRA ~ 1 \ SQLLIB
Set VWS_TEMPLATES = C: \ PROGRA ~ 1 \ SQLLIB \ TEMPLATES
Set VWS_LOGGING = C: \ PROGRA ~ 1 \ SQLLIB \ LOGGING
Set VWSPATH = C: \ PROGRA ~ 1 \ SQLLIB
Set VWS_FOLDER = IBM DB2
Set ICM_FOLDER = Information Directory Manager
Win
<