zoukankan      html  css  js  c++  java
  • SQL 错误 [30028] [42000]: COMPILE FAILED: Semantic error: [Error 30028] Line 1:7 PLSQL function is running in a non-driver environment, usually in SQL statement which doesn't allow nested SQL statement.

    1.首先看下oracle中如何实现调用标准sql
    create or replace function test_hk
    RETURN date
    IS
    v1 DATE;
    BEGIN
    select sysdate into v1 from dual;
    RETURN v1;
    END test_hk;
    /
    --调用方法1:语句块调用
    set serveroutput on
    declare
    var_date date;
    BEGIN
    var_date:=test_hk();
    dbms_output.put_line(var_date);
    END;
    --调用方法2:select
    SELECT test_hk() FROM dual;
    --其他调用方法参考 https://blog.csdn.net/qq_30934019/article/details/80557576

    2.看下Inceptor中调用标准sql会出现什么问题
    create or replace function test_hk()
    RETURN date
    IS
    v1 DATE;
    BEGIN
    select sysdate into v1 from system.dual;
    RETURN v1
    END
    /

    --执行报错:
    SELECT test_hk() FROM system.dual;

    SQL 错误 [30028] [42000]: COMPILE FAILED: Semantic error: [Error 30028] Line 1:7 PLSQL function is running in a non-driver environment, usually in SQL statement which doesn't allow nested SQL statement. Error encountered near token 'test_hk'

    3.解决办法:
    --使用语句块调用
    DECLARE
    v1 DATE;
    BEGIN
    v1:= test_hk();
    dbms_output.put_line(v1)
    END;

  • 相关阅读:
    Appium Desktop使用
    mumu模拟器使用
    adb
    测试准出
    缺陷管理
    测试准入检查
    测试工作流程
    需求测试分析
    异常字符测试
    今日总结
  • 原文地址:https://www.cnblogs.com/wang3680/p/12204354.html
Copyright © 2011-2022 走看看