<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: On writing binary data from within Oracle Forms 6i</title>
	<atom:link href="http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:40:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: mls</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6808</link>
		<dc:creator>mls</dc:creator>
		<pubDate>Mon, 22 Aug 2011 09:11:35 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6808</guid>
		<description>Well, I&#039;d really like to see a working example.

I tried to do quite the same thing, well, reading a client file in Forms 6i instead of writing. I used native Windows I/O functions and ORA_FFI package to make them available in Forms 6i. However, I just couldn&#039;t make them work properly: the &quot;ReadFile&quot; function always set the error code to 998 which would be &quot;Invalid memory reference&quot; or something like that, and nothing was returned. (Despite that the file was opened (&quot;CreateFile&quot;) and closed (&quot;CloseHandle&quot;) successfully.) I just don&#039;t know what the heck was not working OK---wrong declaration of &quot;ReadFile&quot; or what? The test file for reading is OK and resides in the local machine with ORACLE client and Forms 6i. Everything seems allright, only reading the file fails and I don&#039;t know why.

Thanks for any reply.

Marko L. S.
Slovenia</description>
		<content:encoded><![CDATA[<p>Well, I&#8217;d really like to see a working example.</p>
<p>I tried to do quite the same thing, well, reading a client file in Forms 6i instead of writing. I used native Windows I/O functions and ORA_FFI package to make them available in Forms 6i. However, I just couldn&#8217;t make them work properly: the &#8220;ReadFile&#8221; function always set the error code to 998 which would be &#8220;Invalid memory reference&#8221; or something like that, and nothing was returned. (Despite that the file was opened (&#8220;CreateFile&#8221;) and closed (&#8220;CloseHandle&#8221;) successfully.) I just don&#8217;t know what the heck was not working OK&#8212;wrong declaration of &#8220;ReadFile&#8221; or what? The test file for reading is OK and resides in the local machine with ORACLE client and Forms 6i. Everything seems allright, only reading the file fails and I don&#8217;t know why.</p>
<p>Thanks for any reply.</p>
<p>Marko L. S.<br />
Slovenia</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alraies</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6798</link>
		<dc:creator>Alraies</dc:creator>
		<pubDate>Sun, 17 Apr 2011 16:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6798</guid>
		<description>Never mind :)

Finally I solved the problem, I used Windows APIs to write the file in binary mode instead of text_io package, and it worked!

Thank you!</description>
		<content:encoded><![CDATA[<p>Never mind <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally I solved the problem, I used Windows APIs to write the file in binary mode instead of text_io package, and it worked!</p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry Brendel</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6797</link>
		<dc:creator>Larry Brendel</dc:creator>
		<pubDate>Tue, 12 Apr 2011 15:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6797</guid>
		<description>Don&#039;t know where I got most of this but only made miner changes to the original authors code:
CREATE OR REPLACE FUNCTION BLOB2CLOB(B BLOB)
RETURN CLOB IS
  C CLOB;
  N NUMBER;
BEGIN
  IF (B IS NULL) THEN
    RETURN NULL;
  END IF;
  IF (DBMS_LOB.GETLENGTH(B)=0) THEN
    RETURN EMPTY_CLOB();
  END IF;
  DBMS_LOB.CREATETEMPORARY(C,TRUE);
  N:=1;
  WHILE (N+32767&lt;=DBMS_LOB.GETLENGTH(B)) LOOP
    DBMS_LOB.WRITEAPPEND(C,32767,UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(B,32767,N)));
    N:=N+32767;
  END LOOP;
  DBMS_LOB.WRITEAPPEND(C,DBMS_LOB.GETLENGTH(B)-N+1,UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(B,DBMS_LOB.GETLENGTH(B)-N+1,N)));
  RETURN C;
END;
/</description>
		<content:encoded><![CDATA[<p>Don&#8217;t know where I got most of this but only made miner changes to the original authors code:<br />
CREATE OR REPLACE FUNCTION BLOB2CLOB(B BLOB)<br />
RETURN CLOB IS<br />
  C CLOB;<br />
  N NUMBER;<br />
BEGIN<br />
  IF (B IS NULL) THEN<br />
    RETURN NULL;<br />
  END IF;<br />
  IF (DBMS_LOB.GETLENGTH(B)=0) THEN<br />
    RETURN EMPTY_CLOB();<br />
  END IF;<br />
  DBMS_LOB.CREATETEMPORARY(C,TRUE);<br />
  N:=1;<br />
  WHILE (N+32767<=DBMS_LOB.GETLENGTH(B)) LOOP<br />
    DBMS_LOB.WRITEAPPEND(C,32767,UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(B,32767,N)));<br />
    N:=N+32767;<br />
  END LOOP;<br />
  DBMS_LOB.WRITEAPPEND(C,DBMS_LOB.GETLENGTH(B)-N+1,UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(B,DBMS_LOB.GETLENGTH(B)-N+1,N)));<br />
  RETURN C;<br />
END;<br />
/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6796</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 11 Apr 2011 18:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6796</guid>
		<description>Alraies: Sorry, i don&#039;t know. Maybe Matt has subscripted to the comments and reads this.</description>
		<content:encoded><![CDATA[<p>Alraies: Sorry, i don&#8217;t know. Maybe Matt has subscripted to the comments and reads this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alraies</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6795</link>
		<dc:creator>Alraies</dc:creator>
		<pubDate>Mon, 11 Apr 2011 15:58:55 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6795</guid>
		<description>Thank you very much for the code
I used it, and used Matt&#039;s modification because I can&#039;t use external tools. But there is still a problem, the put function do as the special characters says, when find 10, it adds chr(13) automatically, on EOF, it ends the file!
Is there any alternative way to avoid this and also not use external .exe file?

Thanks</description>
		<content:encoded><![CDATA[<p>Thank you very much for the code<br />
I used it, and used Matt&#8217;s modification because I can&#8217;t use external tools. But there is still a problem, the put function do as the special characters says, when find 10, it adds chr(13) automatically, on EOF, it ends the file!<br />
Is there any alternative way to avoid this and also not use external .exe file?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6655</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Thu, 12 Nov 2009 09:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6655</guid>
		<description>You&#039;re welcome :)</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduard</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6654</link>
		<dc:creator>Eduard</dc:creator>
		<pubDate>Thu, 12 Nov 2009 09:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6654</guid>
		<description>Thanx for the help i already made it. Thanx best regards.. God Bless.</description>
		<content:encoded><![CDATA[<p>Thanx for the help i already made it. Thanx best regards.. God Bless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduard</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6653</link>
		<dc:creator>Eduard</dc:creator>
		<pubDate>Mon, 09 Nov 2009 06:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6653</guid>
		<description>Just like to ask if it is ok. I just to know if there is other way to concatenate a varchar2 datatype and clob datatype because when i concatenate this two datatype it show me an error of inconsistent datatype.

thanx and best regards</description>
		<content:encoded><![CDATA[<p>Just like to ask if it is ok. I just to know if there is other way to concatenate a varchar2 datatype and clob datatype because when i concatenate this two datatype it show me an error of inconsistent datatype.</p>
<p>thanx and best regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6652</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Fri, 06 Nov 2009 11:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6652</guid>
		<description>Eduard:

The code in the original article consists of 2 parts: One for the db as a wrapper around dbms_lob. The other part (below &quot;and in a forms on client side:&quot;) is is forms code.
Forms uses the db function &quot;read_export&quot; as a wrapper around dbms_lob.

Forms itself can handle clob data directly from the table but has _no_ support for dbms_lob and the associated datatypes. Therefore the wrapper function.

Have a great day,
Michael.</description>
		<content:encoded><![CDATA[<p>Eduard:</p>
<p>The code in the original article consists of 2 parts: One for the db as a wrapper around dbms_lob. The other part (below &#8220;and in a forms on client side:&#8221;) is is forms code.<br />
Forms uses the db function &#8220;read_export&#8221; as a wrapper around dbms_lob.</p>
<p>Forms itself can handle clob data directly from the table but has _no_ support for dbms_lob and the associated datatypes. Therefore the wrapper function.</p>
<p>Have a great day,<br />
Michael.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduard</title>
		<link>http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6651</link>
		<dc:creator>Eduard</dc:creator>
		<pubDate>Fri, 06 Nov 2009 08:46:04 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/29/on-writing-binary-data-from-within-oracle-forms-6i/#comment-6651</guid>
		<description>hmmm ist the code that you have is only for the database side? how will you call the procedure in the forms?</description>
		<content:encoded><![CDATA[<p>hmmm ist the code that you have is only for the database side? how will you call the procedure in the forms?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.402 seconds -->

