zoukankan      html  css  js  c++  java
  • 调整Oracle数据库print_bill表字段BillMKID的顺序,并判断表print_bill是否存在及字段billMKID是否存在

    declare
    existFlag int;
    existColFlag int;
    begin 
        select count(1) into existFlag from user_tables where table_name = upper('Print_Bill');
        select count(1) into existColFlag from user_tab_columns where table_name=upper('Print_Bill') and column_name=upper('BillMKID');   
        IF   existFlag>0   THEN
          IF existColFlag=0 THEN
             execute immediate 'alter table PRINT_BILL add BillMKID   varchar(4) default '' '' not null';
          END IF;
          execute immediate 'alter table PRINT_BILL rename to PRINT_BILLTEMP';
          execute immediate '
       CREATE table PRINT_BILL
        (BillMKID    varchar(4) not null,  /*单据所属模块ID*/
        BillID      varchar(50)  primary key not null, /*单据逻辑名称*/
        BillName    varchar(50)  not null,  /*单据显示名称*/
        RecordsPath varchar(200) null ,
        ParamCount  int default 0 /*生成的XML中的参数个数*/
        )';
       execute immediate 'insert into Print_Bill(BillMKID,BillID,BillName,RecordsPath,ParamCount) select BillMKID,BillID,BillName,RecordsPath,ParamCount from Print_Billtemp';
       execute immediate 'drop table Print_Billtemp';
        ELSE
            execute immediate '
              CREATE table PRINT_BILL
          (
            BillMKID    varchar(4) not null,  /*单据所属模块ID*/
          BillID      varchar(50)  primary key not null, /*单据逻辑名称*/
          BillName    varchar(50)  not null,  /*单据显示名称*/
          RecordsPath varchar(200) null ,
          ParamCount  int default 0 /*生成的XML中的参数个数*/
          )';             
        END IF;
    END;
  • 相关阅读:
    Excel 小技能
    Socket,ServerSocket,WebSocket
    浅谈Java中的关键字
    线程 学习教程(一): Java中终止(销毁)线程的方法
    OpenGL — GLFW — 颜色
    解决PCL MLS : error LNK2019; error LNK2001 virtual MovingLeastSquares process performProcessing问题
    获取显示屏的个数和分辨率
    Window 显示鼠标的坐标
    OpenCV 鼠标手动绘制掩码图像
    Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境
  • 原文地址:https://www.cnblogs.com/inspurhaitian/p/1273859.html
Copyright © 2011-2022 走看看