小编arm*_*ock的帖子

包规范中的NVARCHAR2常量

我尝试使用nvarchar2数据类型在包规范中添加一个常量,但在编译之后它会在数据库中存储类似的东西???.例如,我尝试为亚美尼亚语单词添加常量???

x constant nvarchar2(3) default '???';
Run Code Online (Sandbox Code Playgroud)

任何人都可以建议解决这个问题或者不可能这样做吗?

oracle plsql

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

带游标参数的管道函数 oracle

例如,如果我有这种功能

function test_pipe(p_source in t_cursor)
return t_tab
pipelined
as --some code goes here
Run Code Online (Sandbox Code Playgroud)

t_cursor 是一个引用游标。我知道我可以这样调用这个函数

select * from table(test_pipe(cursor(select 1 from dual)));
Run Code Online (Sandbox Code Playgroud)

但是如果我在包中声明游标并希望将其作为参数传递,该怎么办?像这样的东西。

procedure test is
v_ct pls_integer;
cursor main_cur is select 1 from dual;
begin
select count(*) into v_ct from table(test_pipe(main_cur));
--some code
end;
Run Code Online (Sandbox Code Playgroud)

我得到 main_cur 无效标识符 - pl/sql:ORA00904 错误。我应该如何编码才能将 main_cur 作为参数传递给 test_pipe?

oracle plsql

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

Spring mvc:在 URL 末尾添加斜杠时 css 不起作用

我是 Spring MVC 的新手,我遇到了 CSS 问题。当 URL 以斜线结尾时 CSS 不起作用。
链接像这样
<link rel="stylesheet" href="themes/style.css">
mvc:resources mapping
<mvc:resources mapping="/themes/**" location="/WEB-INF/themes/"/>
和 requestMapping 像这样

@RequestMapping("/login")
public ModelAndView loginPage() {

    ModelAndView model = new ModelAndView("login");

    return model;
}
Run Code Online (Sandbox Code Playgroud)

所以问题是当我输入一个像../logincss 正常加载的 URL时,但是当我输入../login/结尾斜杠时,css 不会加载。好吧,这里有很多类似的问题,但没有一个是针对 Spring MVC 的。

css url spring spring-mvc

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

PL / SQL中的重载问题

伙计们,我正在尝试在Oracle 11gR2的程序包中重载函数。函数是这样的。

Function is_h2h(p_param in number) return boolean
is
 begin
 --some code here
return true;
end; 
Run Code Online (Sandbox Code Playgroud)


Function is_h2h(p_param in number) return number
is
 begin
 --some code here
return 1;
end;
Run Code Online (Sandbox Code Playgroud)

所以问题是if,例如当我在另一个过程中编写语句 时

if is_h2h(some_param) then --code goes 
end if;
Run Code Online (Sandbox Code Playgroud)

编译器返回PLS-00307: Too many declarations of 'IS_H2H' match this call
那么如何实现这种重载呢?

oracle plsql overloading

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

没有处理Django渠道websocket.receive

我正在尝试通过文档实现Django频道.
就像我正在制作的文档一样consumers.py

def ws_message(message):
    message.reply_channel.send({
        "text": message.content['text'],
})
Run Code Online (Sandbox Code Playgroud)

routing.py作为

from channels.routing import route
from my_proj.consumers import ws_message

channel_routing = [
    route("websocket.receive", ws_message),
]
Run Code Online (Sandbox Code Playgroud)

在我的settings文件中我添加了channel_layers

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "asgi_redis.RedisChannelLayer",
        "CONFIG": {
            "hosts": [("localhost", 6379)],
        },
        "ROUTING": "my_proj.routing.channel_routing",
    },
}
Run Code Online (Sandbox Code Playgroud)

因此,当我运行server并在chrome控制台中发送以下内容时

socket = new WebSocket("ws://" + 192.168.4.177:8000");
socket.onmessage = function(e) {
    alert(e.data);
}
socket.onopen = function() {
    socket.send("something");
}
Run Code Online (Sandbox Code Playgroud)

我可以在manage.py控制台中看到Websocket连接工作并建立了连接,但是receive部件未被处理,并且在控制台中看不到,因此不会引发来自js代码的警报.那么我做错了什么?

python django websocket django-channels

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