使用编译错误创建的函数

时间:2016-08-22 15:24:49

标签: sql function oracle11g

我正在尝试创建一个功能

var development = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');
var precss       = require('precss');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var cssnano = require('cssnano');
var autoprefixer = require('autoprefixer');


var extractCSS = new ExtractTextPlugin('style.css');


module.exports = [
  {
  name: 'app-bundle',
  entry: "./src/js/main.js",
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules|bower_components)/,
        loader: 'babel-loader',
      },
    ]
  },
  output: {
    path: "",
    filename: "bundle.min.js"
  },
  plugins: development ? [
  ]: [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
  ],
},


{
  name: 'css/scss',
  entry:  './src/sass/style.scss',
  module: {
  loaders:
    [
      {
      test: /\.scss$/,
      loader: extractCSS.extract('style', 'css!postcss!sass')
      }
    ]
  },
  postcss: function(webpack)
    {
    return [
      cssnano({
         autoprefixer: {
           add: true,
           remove: false,
           browsers: [
            'last 2 versions',
            'ie >= 9'
          ]
         },
         discardComments: {
           removeAll: true
         },
         discardUnused: false,
         mergeIdents: false,
         reduceIdents: false,
         safe: true,
         sourcemap: true
     })
   ]
 },
  output: {
    path: "",
    filename: "style.css"
  },
  plugins: development ? [
    extractCSS
  ] : []
}
];

但它出现错误:使用编译错误创建的函数。请帮忙

1 个答案:

答案 0 :(得分:2)

您无法为函数的返回值指定任何约束,因此您需要从该子句中删除(4,2)

CREATE OR REPLACE FUNCTION late_return_fee
(number_of_books IN NUMBER, days_of_late_return IN NUMBER)
RETURN DEC  -- note no size constraint
IS
fee DEC(4,2);   
BEGIN
fee := number_of_books *(days_of_late_return*0.50);
RETURN fee;
END;
/

Function LATE_RETURN_FEE compiled

show errors

No errors.

不确定为什么您在这里使用DEC[IMAL]而不是NUMBERNUMBER(4,2)