PL/SQL 中的问题 = 错误堆栈:ORA-01403:Oracle Application Express (APEX) 中没有数据

Posted

技术标签:

【中文标题】PL/SQL 中的问题 = 错误堆栈:ORA-01403:Oracle Application Express (APEX) 中没有数据【英文标题】:Problem in PL/SQL = Error Stack: ORA-01403: No Data in Oracle Application Express (APEX) 【发布时间】:2020-07-31 10:58:09 【问题描述】:

我创建了一个带有 Web 服务的上传系统(上传到 Oracle 存储桶)。我已将页面和 Web 服务复制到我的新应用程序(从已经运行的应用程序),但上传功能出现问题。我得到的错误是 ORA-01403: No Data,在原始页面中没有问题,一切正常。有人可以帮我解决这个问题或给我一个好的方向。

PL/SQL 代码

begin declare
  l_request_url varchar2(32767);    
  l_content_length number;    
  l_response clob;    
  upload_failed_exception exception;    
begin    
  for file in (    
  select * from apex_application_temp_files    
  where name = :P101_FILE    
  ) loop    
  l_request_url := :G_BASE_URL || 'b/##BUCKETNAME##'    
  || '/o/' || apex_util.url_encode(file.filename);    
    
  apex_debug.info('File: %s', file.filename);    
  apex_debug.info('URL: %s', l_request_url);    
  apex_debug.info('Mime: %s', file.mime_type);    
    
  apex_web_service.g_request_headers(1).name :=    
  'Content-Type';    
  apex_web_service.g_request_headers(1).value :=    
  file.mime_type;    
  l_response := apex_web_service.make_rest_request(    
  p_url => l_request_url    
  , p_http_method => 'PUT'    
  , p_body_blob => file.blob_content    
  , p_credential_static_id => :G_OCI_WEB_CREDENTIAL    
  );    
  if apex_web_service.g_status_code != 200 then    
  raise upload_failed_exception;    
  end if;    
  end loop;    
end;  
end;  

P101_FILE = 上传文件项

##BUCKETNAME## = 在原始代码中是存储桶的实际名称。

调试:

Exception in "plsql process":  
Error Stack: ORA-01403: Geen gegevens gevonden.  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1594  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2658  
ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1568  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC_LOCAL", regel 2761  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3775  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3810  
Backtrace: ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1594  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2658  
ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1568  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC_LOCAL", regel 2761  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3775  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3810  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 76  
2  
1%  
0.04179 0.00030  
Exception in "uploadFile":  
Error Stack: ORA-01403: Geen gegevens gevonden.  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 96  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1594  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2658  
ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1568  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC_LOCAL", regel 2761  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3775  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3810  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 76  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 1156  
ORA-06512: in "APEX_200100~  
Backtrace: ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 96  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1594  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2658  
ORA-06512: in "APEX_200100.WWV_FLOW_CREDENTIAL", regel 106  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 376  
ORA-06512: in "APEX_200100.WWV_FLOW_WEBSERVICES_API", regel 416  
ORA-06512: in regel 22  
ORA-06512: in regel 22  
ORA-06512: in "SYS.DBMS_SYS_SQL", regel 2120  
ORA-06512: in "SYS.WWV_DBMS_SQL_APEX_200100", regel 590  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 2621  
ORA-06512: in "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", regel 1568  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC_LOCAL", regel 2761  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3775  
ORA-06512: in "APEX_200100.WWV_FLOW_EXEC", regel 3810  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 76  
ORA-06512: in "APEX_200100.WWV_FLOW_PROCESS_NATIVE", regel 1156  
ORA-06512: in "APEX_200100.WWV_FLOW_PLUGIN", regel 2586  
ORA-0~  
2  
1%  
0.04209 0.00065  
Add error onto error stack  
4  
1%  
0.04273 0.00020  
Hiding error additional_info, as it contains ORA error message: ORA-01403: Geen gegevens gevonden.  
1  
0%  
0.04293 0.00002  
Error: ORA-01403: Geen gegevens gevonden  

【问题讨论】:

您没有找到任何数据,只能在select * from apex_application_temp_files where name = :P101_FILE 中使用 APEX SQL Workshop 并检查该表中是否有数据 还要检查:P101_FILE是否是顶点页面中元素的实际名称 :g_base_url 和 :g_oci_web_credential 是否分配了正确的值?这是从哪里引发的“uploadFile”中的“异常”? apex_application_temp_files 是 P101_FILE 文件上传项的临时存储。在 DEBUG 中,我得到了所有信息(文件名/mime 类型和构造的 URL)。 两个应用程序中的替换完全相同。 URL(l_request_url) 是按照应有的方式构建的。 【参考方案1】:

问题是 :G_OCI_WEB_CREDENTIAL 的替换中的空格。删除空间后,一切正常。感谢您的帮助!

【讨论】:

以上是关于PL/SQL 中的问题 = 错误堆栈:ORA-01403:Oracle Application Express (APEX) 中没有数据的主要内容,如果未能解决你的问题,请参考以下文章

PL/SQL 中 CASE 语句中的堆栈条件

使用 pl/sql 过程记录错误和处理异常

带有动态 sql 的 PL/SQL 触发器

Oralce PL/SQL 堆栈信息追踪

pl/sql 中的错误处理

检查 PL/SQL 异常块中的特定错误代码