× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It appears you are missing the part that sets the blob file name.

Dcl-s file1 Sqltype( BLOB_FILE );
file1_Name = '/tmp/somefile.ext';
file1_NL = %LEN(%TRIM(file1_Name));
file1_FO = SQFAPP;


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Art Tostaine, Jr.
Sent: Monday, April 8, 2019 9:41 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: SQL Fetch problem with BLOB

I'm trying to select all records in a file with BLOB's and transfer them via FTP to an imaging server. This previously worked fine but we are receiving a SQLSTT

428A1-Unable to access a file referenced by a file reference variable.

Code snips looks like this:

D Blob s SQLTYPE(BLOB_FILE)

EXEC SQL Select rid, dwLineNo, dwimg01
from dwImages
where dwsent = '1900-01-01 00:00:00';

EXEC SQL Fetch Next from C1 into :rid, :DwLineNo, :Blob;

Error in joblog
Message ID . . . . . . : SQL0452 Severity . . . . . . . : 30

Message type . . . . . : Diagnostic

Date sent . . . . . . : 04/08/19 Time sent . . . . . . :
11:33:48


Message . . . . : Unable to access a file that is referred to by a file

reference variable.

Cause . . . . . : The file referred to by the file reference variable
(host
variable 3) could not be accessed because of reason code 2. The reason codes
and their meanings are:

-- 2 - The length of the file name is greater than the maximum allowed

length.

-- If the reason code is 2, correct the file name and then try the request again.

If I look at the data the image file names look ok.

Thanks
--
Art Tostaine

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.