Conditional selection of RAW/BLOB depending on data type
Date: Tue, 2 Mar 1999 10:17:26 -0500
Message-ID: <7bgvgs$3o6$1_at_paperboy.baynetworks.com>
Hello,
I'm a bit stumped here. What I'm trying to do is:
Get the data type of a column
If it's a RAW, then convert to BLOB
if it's a BLOB then just leave as is
Basically I have something like:
SELECT data_type INTO src_datatype FROM USER_TAB_COLUMNS where table_name='TABLE_A' AND column_name='COLUMN A';
IF src_datatype = 'LONG RAW' THEN
/* Copy the RAW into a buffer */
SELECT column_a into src_raw FROM TABLE_A WHERE <some condition>;
ELSE
/* treat as a blob */
END IF;
The problem is that at run time, I get an PLS-00385: type mismatch found at
'SRC_RAW' in SELECT...INTO statement
if the data type is a BLOB at runtime.
I guess what I'm trying to do is only run that code if it's a RAW, else run the code for BLOBs.
Any ideas on this? I've tried putting this into a procedure but I get the same problem when the proc is compiled.
Cheers
Dave
dnorth_at_baynetworks.com Received on Tue Mar 02 1999 - 16:17:26 CET