简体   繁体   English

在Oracle Apex中将Blob列内容从一个表复制到另一个表

[英]Copying blob column contents from one table to another in Oracle Apex

I'm currently trying to copy the contents of a blob column from one table to another in Oracle Apex 5 and no matter what, it doesn't copy the BLOB data over, it leaves all those fields blank and it's driving my nuts. 我目前正在尝试在Oracle Apex 5中将blob列的内容从一个表复制到另一个表,无论如何,它不会复制BLOB数据,所有这些字段都留为空白,这使我发疯。

Here is the PL/SQL I'm using to accomplish this as a process. 这是我用来完成此过程的PL / SQL。

insert into ATTACHMENTS_AVAIL 
  ("ADDED_FILE", "MIMETYPE", "FILENAME", "CONTRACTOR_ID", "DATE_ADDED", "TYPE") 
select RESUME,
       MIMETYPE,
       FILENAME,
       :P24_CONTRACTOR_ID,
       sysdate,
       'Resume'
from subs 
where pkey = :P24_SUBS_PKEY;

Any idea what I'm missing here? 知道我在这里缺少什么吗?

Here are the field types. 这是字段类型。

ADDED_FILE    - BLOB
MIMETYPE      - VARCHAR2
FILENAME      - VARCHAR2
CONTRACTOR_ID - NUMBER
DATE_ADDED    - DATE
TYPE          - VARCHAR2

(...) it leaves all those fields blank (...)将所有这些字段留空

It means that WHERE clause failed, completely: 这意味着WHERE子句完全失败:

  • either there's no SUBS.PKEY whose value is equal to P24_SUBS_PKEY item value, or 没有任何SUBS.PKEY的值等于P24_SUBS_PKEY项目的值,或者
  • P24_SUBS_PKEY is empty P24_SUBS_PKEY

How come? 怎么会? Because, even if every other value was NULL, SYSDATE (you insert into DATE_ADDED ) and 'Resume' (which goes into TYPE column) would be inserted. 因为即使其他所有值都为NULL,也会插入SYSDATE (插入DATE_ADDED )和'Resume'(插入TYPE列中)。 So, INSERT failed because SELECT failed because WHERE doesn't work. 因此, INSERT失败,因为SELECT失败,因为WHERE不起作用。

I presume you checked whether SUBS table contains appropriate values. 我假设您检查了SUBS表是否包含适当的值。 Therefore, I presume that P24_SUBS_PKEY item doesn't contain anything. 因此,我假设P24_SUBS_PKEY项目不包含任何内容。 Perhaps you see the value on the screen, but - is it in session state? 也许您在屏幕上看到该值,但是-它是否处于会话状态? I guess not. 我猜不会。 Enable debugging and check the sessions state values after the process ends. 在过程结束后,启用调试并检查会话状态值。

Saying that you wrote a process which should do the INSERT - when does that process "fire"? 说你写了一个过程 ,应该做的INSERT -什么时候该进程“火”? The simplest way is, probably, when you push a button which submits the page. 最简单的方法可能是,当您按下提交页面的按钮时。 And, once you submit it, items' values are "stored" into session state. 而且,一旦提交,项目的值就会“存储”到会话状态。 I suggest you to do that, just to make sure it actually works. 我建议您这样做,以确保它确实有效。 Then you can improve the whole thing, if necessary. 然后,如有必要,您可以改善整个过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM