小编use*_*778的帖子

我可以使用默认的空参数执行过程吗?

我最近创建了一个定义如下的过程:

create or replace
PACKAGE
pkg_dml_legal_transactions
AS
  PROCEDURE spm_update_court_cost(
    p_court_state     IN legal_court_cost.state%TYPE,
    p_tran_code       IN legal_court_cost.transaction_code%TYPE,
    p_legal_court     IN legal_court_cost.court%TYPE default null,
    p_end_date        IN legal_court_cost.end_date%TYPE,
    p_cost_min        IN legal_court_cost.cost_range_min%TYPE,
    p_cost_max        IN legal_court_cost.cost_range_max%TYPE,
    p_bal_min         IN legal_court_cost.bal_range_min%TYPE DEFAULT NULL,
    p_bal_max         IN legal_court_cost.bal_range_max%TYPE DEFAULT NULL);

end pkg_dml_legal_transactions;
Run Code Online (Sandbox Code Playgroud)

当我尝试execute该过程时,我收到一个错误,指出:

PLS-00306: wrong number or types of arguments in call to 'SPM_UPDATE_COURT_COST'
Run Code Online (Sandbox Code Playgroud)

这是我的execute语句的样子:

execute pkg_dml_legal_transactions.spm_update_court_cost('NJ',1,sysdate,1000,40000);
Run Code Online (Sandbox Code Playgroud)

现在我明白了错误意味着什么,但我想如果参数默认为null然后我可以跳过它们,但显然不是.有没有解决的办法?

oracle plsql procedure

10
推荐指数
2
解决办法
5万
查看次数

C#从字符串中删除括号

对于C#用户来说,这似乎是一个常见的问题,经过研究和多次尝试后,我无法从字符串中删除一对括号.我遇到问题的字符串是Service (additional).

在做完我的研究之后,我理解括号的处理方式不同Regex.Replace.我的研究也得到了我尝试的多个答案,但似乎没有任何效果.以下是我尝试删除这些括号的一些方法.

cleanValue = Regex.Replace(intVal, " ", "").Replace("(", "").Replace(")", "").Replace(",", "").Replace("/", "").Replace("-", "");

cleanValue = Regex.Replace(intVal, " ", "").Replace(@"\(", "").Replace(@"\)", "").Replace(",", "").Replace("/", "").Replace("-", "");

cleanValue = Regex.Replace(intVal, " ", "").Replace("[()]", "").Replace(",", "").Replace("/", "").Replace("-", "");

cleanValue = Regex.Replace(intVal, " ", "").Replace(@"[^a-zA-Z]", "").Replace(",", "").Replace("/", "").Replace("-", "");
Run Code Online (Sandbox Code Playgroud)

这些都没有奏效,在单步执行代码后,我只看到'e'和'之间的空格('删除了.我错过了什么?

如果有人想看到function这里使用的是:

    public static string CleanExtra(string intVal)
    {
        string cleanValue;
        if (intVal == null)
        {
            throw new System.ArgumentException("Value cannot be null", "original");
        }
        else
        {
            //cleanValue = Regex.Replace(intVal, " …
Run Code Online (Sandbox Code Playgroud)

c# regex parentheses

8
推荐指数
2
解决办法
1万
查看次数

将true值传递给布尔值

我正在尝试学习C#,我是一个使用布尔值的例子.对于我的生活,我无法弄清楚为什么程序没有注意到我试图将值传递给布尔值.这是Form.cs中的代码:

namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button2_Click(object sender, EventArgs e)
    {
        HappyBirthday birthdayMessage = new HappyBirthday();
        string returnedMessage;

        birthdayMessage.PresentCount = 5;
        birthdayMessage.MyProperty = "Adam";
        birthdayMessage.hasParty = true;
        returnedMessage = birthdayMessage.MyProperty;

        MessageBox.Show(returnedMessage);

    }
}
}
Run Code Online (Sandbox Code Playgroud)

这是我创建的类:

class HappyBirthday
{

//====================
//  CLASS VARIABLES
//====================
private int numberOfPresents;
private string birthdayMessage;
private bool birthdayParty;

//===========================
//  DEFAULT CONSTRUCTOR
//===========================
public HappyBirthday()
{
    numberOfPresents = 0;
    //birthdayParty = false;
}

//=========================== …
Run Code Online (Sandbox Code Playgroud)

c# constructor boolean

4
推荐指数
1
解决办法
2917
查看次数

ORA-00904解码别名上的无效标识符

当我尝试decode在我的select语句中使用a的别名时,我遇到了标题中声明的错误.这是代码:

SELECT DISTINCT rl.complaint_date, 
                  decode(rl.judgement_date,null,rl.complaint_amt,rl.judgement_amt) as account_amt, 
                  rl.date_served1, 
                  rl.date_served2,
                  rl.judgement_date,         
                  rl.skip_locate,
                  rl.case_no,
                  lcc.bal_range_min, 
                  lcc.bal_range_max, 
                  lcc.cost_range_min, 
                  lcc.cost_range_max, 
                  lcc.court,
                  lcc.county AS lcc_county,
                  ah.ACCOUNT, 
                  ah.transaction_code, 
                  ah.transaction_date, 
                  ah.rule_id, 
                  ah.amount, 
                  ah.description,                    
                  r.state, 
                  r.zip_code, 
                  z.county AS ah_county,
                  z.county_2,
                  z.county_3,
                  z.county_4
  FROM legal_address_skip las,
       racctrel r, 
       ziplist z, 
       legal_court_cost lcc, 
       racctlgl rl,
       legal_transaction_review ah
  WHERE ah.ACCOUNT = rl.ACCOUNT
  AND ah.ACCOUNT = las.ACCOUNT(+)
  AND ah.ACCOUNT = r.ACCOUNT
  AND nvl(lpad(substr(r.zip_code,0,instr(r.zip_code,'-')-1),5,0), substr(r.zip_code,1,5)) = z.zip 
  AND r.state = lcc.state
  AND (REPLACE(lcc.county,' ','') = REPLACE(upper(z.county),' ','') 
       OR REPLACE(lcc.county,' …
Run Code Online (Sandbox Code Playgroud)

sql oracle alias decode

2
推荐指数
2
解决办法
5564
查看次数

80040154未注册类(HRESULT异常

编辑:该程序尝试使用C#读取excel文件,然后将数据添加到sql developer中的表中.

我遇到了一个我似乎无法弄清楚的错误.当我尝试将excel数据加载到消息框中时,我得到了这个:

Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Run Code Online (Sandbox Code Playgroud)

此错误出现在:

Microsoft.Office.Interop.Excel.Workbook workbook = new Microsoft.Office.Interop.Excel.Workbook();
Run Code Online (Sandbox Code Playgroud)

我已经对这个特定错误进行了研究,并尝试了我发现的所有内容.我曾试图改变Platform Target的属性x86像有些人取消选中一起说Prefer 32-bit,离开Platform TargetAny CPU.我想我可能会错过一个重要的参考,但注意到我已经有了.NET Microsoft.Office.Interop.Excel,当我尝试添加COM等效时,它没有帮助.作为参考,我使用的是32位Windows操作系统.

任何关于为什么会出现此错误的帮助将不胜感激.谢谢.

以下是该类中的完整代码:

namespace ReadExcel
{
    public partial class Form1 : Form
    {
    public Microsoft.Office.Interop.Excel._Application excelApp = new Microsoft.Office.Interop.Excel.Application() { DisplayAlerts = false, Visible = false };

    public List<Attorney> listOfAttys …
Run Code Online (Sandbox Code Playgroud)

c# com import runtime-error

1
推荐指数
1
解决办法
1万
查看次数

类型或命名空间定义,或具有相同括号数的文件结束预期错误

嗨,我在将VB程序转换为C#后得到了这个提到的错误,但我似乎无法找到丢失的右括号.我多次计算它们,在我看来,我有相同数量,但我也一直在寻找.这是我正在使用的代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;
using System.Text.RegularExpressions;

public class Class1
{
public Class1()
{
    private void exportData(DataTable dt, string workpath, string tabName, bool isStmt = false)
    {
        if (dt.Rows.Count > 0 && IO.File.Exists(workpath)) 
        {
            //export data to excel
            exportExcel = true;

            Microsoft.Office.Interop.Excel.Workbook NewWorkbook = default(Microsoft.Office.Interop.Excel.Workbook);
            Microsoft.Office.Interop.Excel.Style style = default(Microsoft.Office.Interop.Excel.Style);
            Microsoft.Office.Interop.Excel.Worksheet CurrentSheet = new Microsoft.Office.Interop.Excel.Worksheet();
            Microsoft.Office.Interop.Excel.Worksheet totalWorkSheets = default(Microsoft.Office.Interop.Excel.Worksheet);
            string excelSheetNames = null;

            if (IO.File.Exists(workpath)) …
Run Code Online (Sandbox Code Playgroud)

c#

1
推荐指数
1
解决办法
7245
查看次数

标签 统计

c# ×4

oracle ×2

alias ×1

boolean ×1

com ×1

constructor ×1

decode ×1

import ×1

parentheses ×1

plsql ×1

procedure ×1

regex ×1

runtime-error ×1

sql ×1