小编mik*_*utu的帖子

Vt-x / AMD-V硬件加速在您的系统上不可用

我从Oracle导入了VM,然后尝试将其打开。当我尝试运行VM时,出现以下消息:

VT-x / AMD-V硬件加速在您的系统上不可用。您的64位guest虚拟机将无法检测到64位CPU,并且将无法启动。

从配置可以看出,VT-x在我的机器上可用:

在此处输入图片说明

有人可以告诉我要启动他的VM还要做什么吗?

谢谢,

virtualization virtualbox

11
推荐指数
2
解决办法
4万
查看次数

如何动态获取记录中的字段名称和值

我有一个过程,它接收170列的记录作为输入参数(它基于表的结构).

在该过程中,我想调用一个调试过程,其中一个参数是一个包含该记录的所有字段名称和值的文本字符串.

例如:

CREATE OR REPLACE PROCEDURE xxx (pi_record IN table_name%ROWTYPE) as
    text VARCHAR2(10000) := NULL;
BEGIN
    ...
    text := 'pi_record.column1 = ' || pi_record.column1 || CHR(13) ||
            'pi_record.column2 = ' || pi_record.column2 || CHR(13) ||
            ...
            'pi_record.column170 = ' || pi_record.column170;
    logging_procedure (text);
    ...
END;
Run Code Online (Sandbox Code Playgroud)

有没有简单的方法以动态方式实现这一点(循环记录字段名称和值)而不枚举所有这些?

也许是这样的:

CREATE OR REPLACE PROCEDURE xxx (pi_record IN table_name%ROWTYPE) as
    text VARCHAR2(10000) := NULL;
BEGIN
    ...      
    LOOP in pi_record.columns
        text := text || CHR(13) || pi_record.column.name || ' : ' || pi_record.column.value
    END …
Run Code Online (Sandbox Code Playgroud)

oracle plsql record

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

PLS-00222:此范围内不存在名称为"INFO_TYPE"的函数

我试图在两种情况下返回一个记录表:

  1. 使用功能
  2. 使用匿名块

当我使用该功能时,一切正常,但当我试图将其转换为匿名块时,我收到上述错误.以下是代码:

对于功能:

create or replace 
function get_info(p_city varchar2) return info_type_table
as
l_info info_type_table := info_type_table();
begin
    for i in (select  e.employeeid, 
                      e.lastname, 
                      c.customerid,
                      c.companyname,
                      o.orderid,
                      o.orderdate
              from  ntw_employees e
                inner join 
                    ntw_orders    o
                    on e.employeeid = o.employeeid
                inner join 
                    ntw_customers c
                    on o.customerid = c.customerid
              where e.city  = p_city)
    loop
        l_info.extend;
        l_info(l_info.count)  :=  (info_type(i.employeeid, i.lastname, i.customerid, i.companyname, i.orderid, i.orderdate));
    end loop;
    return l_info;
end;
Run Code Online (Sandbox Code Playgroud)

这是匿名块:

declare
type info_type is record 
(
    emp_no    number(3),
    lastname  varchar2(26),
    cust_no   varchar2(5), …
Run Code Online (Sandbox Code Playgroud)

sql oracle plsql

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

具有“WITH FUNCTION”定义的 MERGE 语句

我正在尝试将WITH 子句中声明的函数使用到MERGE 语句中。这是我的代码:

create table test
  (c1 varchar2(10),
   c2 varchar2(10),
   c3 varchar2(10));



insert into test(c1, c2) values ('a', 'A');
insert into test(c1, c2) values ('b', 'A');

select * from test;

begin
with function to_upper(val varchar2) return varchar is
begin
    return upper(val);
end;
merge into test a
    using (select * from test) b
on (upper(a.c1) = upper(b.c2))
when matched then 
    update set a.c3 = to_upper(a.c1);
end; 
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

错误报告 - ORA-06550:第 2 行,第 15 列:PL/SQL:ORA-00905:缺少关键字 ORA-06550:第 2 行,第 1 列:PL/SQL:忽略 SQL 语句 …

sql oracle plsql oracle12c

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

无法将文件移动到其他文件夹中

我试图将少量XML文件的内容插入到Oracle数据库中,然后将文件移动到存档文件夹中,但在移动步骤中失败并显示错误:

该进程无法访问该文件,因为该文件正由另一个进程使用.

这是代码:

conn.Open()

For Each oFile As String In Directory.GetFiles("D:\files")

    Dim cmd As New OracleCommand
    cmd.Connection = conn

    filename = New FileInfo(oFile).Name

            ' integrarea de delivery notes
            XML_File = XmlReader.Create(oFile, New XmlReaderSettings())
            DataSet.ReadXml(XML_File)

            cmd.CommandText = "pkg_erp.insert_delnote"
            cmd.CommandType = CommandType.StoredProcedure

            cmd.Parameters.Add("p_delnote_id", OracleDbType.Int64).Direction = ParameterDirection.Input
            cmd.Parameters.Add("p_order_id", OracleDbType.Int64).Direction = ParameterDirection.Input
            cmd.Parameters.Add("p_product_id", OracleDbType.Int64).Direction = ParameterDirection.Input
            cmd.Parameters.Add("p_quantity", OracleDbType.Int64).Direction = ParameterDirection.Input
            cmd.Parameters.Add("p_confirm", OracleDbType.Int16).Direction = ParameterDirection.Output

            For i As Integer = 0 To DataSet.Tables(0).Rows.Count - 1

                cmd.Parameters("p_delnote_id").Value = Convert.ToInt32(DataSet.Tables(0).Rows(i).Item(0))
                cmd.Parameters("p_order_id").Value = Convert.ToInt32(DataSet.Tables(0).Rows(i).Item(1))
                cmd.Parameters("p_product_id").Value = Convert.ToInt32(DataSet.Tables(0).Rows(i).Item(2))
                cmd.Parameters("p_quantity").Value …
Run Code Online (Sandbox Code Playgroud)

vb.net

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

标签 统计

oracle ×3

plsql ×3

sql ×2

oracle12c ×1

record ×1

vb.net ×1

virtualbox ×1

virtualization ×1