问题列表 - 第37250页

ORACLE PL/SQL:函数和可选参数,如何?

我正在寻找创建一个不接受任何参数并返回所有结果的函数的最佳方法,但也接受参数并返回这些结果.

我在工作中一直在处理的标准是:

FUNCTION get_records (
  i_code                                 IN records.code%type := NULL,
  i_type                                 IN records.type%type := NULL
) RETURN results
Run Code Online (Sandbox Code Playgroud)

问题是我想返回类型为NULL的记录,并使用:

WHERE type = nvl(i_type, type)
Run Code Online (Sandbox Code Playgroud)

由于显而易见的原因,它只返回具有实际类型而不是空记录的记录.我只是想知道是否有一种标准的方法可以在我们使用的所有功能中实现.巧合的是,如果我提供参数...我不想要该字段的NULL值.

oracle plsql

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

缺少默认构造函数参数的成员

以下类具有辅助构造函数,以不可变的方式更改一个属性.

class AccUnit(size: Long, start: Date, direction:Direction, protocol:String) {
    def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
}
Run Code Online (Sandbox Code Playgroud)

编译器返回错误:

AccUnit.scala:26: error: value start is not a member of trafacct.AccUnit
        def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
                                                           ^
AccUnit.scala:26: error: value direction is not a member of trafacct.AccUnit
        def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
                                                                       ^
AccUnit.scala:26: error: value protocol is not a member of trafacct.AccUnit
        def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
Run Code Online (Sandbox Code Playgroud)

为什么会这样认为,没有这样的成员?

scala

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

确保该列遵循Oracle中的序列

有没有办法约束一个列(比如说"ID")来跟随一个创建的序列(比如"ID_SEQ")?

如果没有自动约束,手动插入可能会使整个序列失控.可以做些什么来解决这个问题?只需拨打NextVal两次?

oracle constraints sequence

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

我可以在init()方法中取消Zend Controller操作吗?

在期间Zend_Controller_Action::init(),有没有办法取消行动(因此不会被调用)?

<?php
class JsonApiController extends Zend_Controller_Action {
    function init()
    {
        // try JSON decoding the raw request body
        if ($jsonDecodingFailed) {
            echo '{"error":"invalid JSON"}';
            $this->_cancelAction(); // something like this exist?
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我目前的解决方法是创建一个空nullAction()方法并调用$this->_forward('null')转发它.

php model-view-controller zend-framework controller

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

什么是Java的ArrayList的C++版本

刚回到使用C++并试图转换我最近写的一个简单的Java程序.

什么是C++中Java ArrayList的首选等价物?

c++ java arraylist

70
推荐指数
2
解决办法
13万
查看次数

Notepad ++非贪婪的正则表达式

Notepad ++是否支持非贪婪的正则表达式?

例如文字:

abcxadc
Run Code Online (Sandbox Code Playgroud)

我想用模式获取零件:

a.+c
Run Code Online (Sandbox Code Playgroud)

现在我得到整个字符串而不是2个部分.我试过用'?' 运营商但没有成功.

regex notepad++ regex-greedy

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

linq中的左外连接

我有以下查询,但我不知道如何在表1上进行左外连接.

var query = (from r in table1
             join f in table2
                 on r.ID equals f.ID
             select new
             {     
                 r.ID, 
                 r.FirstName,
                 r.LastName,
                 FirstNameOnRecord = 
                     (f != null ? f.FirstName : string.Empty),
                 LastNameOnRecord = 
                     (f != null ? f.LastName : string.Empty),
                 NameChanged = 
                     (f != null 
                         ? (f.FirstName.CompareTo(r.FirstName) == 0 
                             && f.LastName.CompareTo(r.LastName) == 0) 
                         : false)
             }).ToList();
Run Code Online (Sandbox Code Playgroud)

c# linq outer-join

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

UIImagePicker和AVCaptureSession同时访问摄像头

我想知道是否可以有一个实例AVCaptureSessionUIImagePicker同时访问相机.

我想创建一个应用程序,将环境光度计/指示器显示为UIImagePicker相机处于活动状态时的叠加视图.我之前使用过这个UIGetScreenImage(),但Apple现在不允许使用这个私有API AVCaptureSession.在我的实验中,AVCaptureSessionUIImagePicker显示摄像机视图时似乎被暂停.有任何想法吗?谢谢!

iphone uiimagepickercontroller avcapturesession

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

位字段如何与字符类型一起使用?

   struct stats
   {
       char top         : 1; 
       char bottom      : 1;
       char side        : 2;
   } MyStat;  
Run Code Online (Sandbox Code Playgroud)

我用整数看过这种格式,但上面的char位字段是如何工作的以及它代表什么?

谢谢.

c c++ bit-manipulation char

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

单击电话号码文本时如何显示电话呼叫窗口

我在屏幕上显示联系人详细信息.当用户点击联系人详细信息中的电话号码时,我需要显示电话呼叫窗口.

请告诉我如何才能做到这一点

提前致谢

android

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