DBMS_OUTPUT has different default buffer sizes, depending on your Oracle version. You can increase the buffer up to 1,000,000 using the following PL/SQL statement: DBMS_OUTPUT.ENABLE(1000000); The SQL*Plus statement to achieve the same result is: SET SERVEROUTPUT ON SIZE 1000000 Starting with Oracle release 10g, it is possible to use the following unlimited buffer settings: DBMS_OUTPUT.ENABLE (buffer_size => NULL);
Create project folder, for example ~cktest: cd cktest Download C++ GCC Chilkat Library: wget https://chilkatdownload.com/9.5.0.84/chilkat-9.5.0-x86_64-linux-gcc.tar.gz tar xfz ./*.gz Move include and lib folder to cktest Create your .cpp program, for example my.cpp #include <CkJsonObject.h> #include <iostream> int ChilkatSample() { CkJsonObject json; bool success; int index = -1; success = json.AddStringAt(-1,"Title","Pan's Labyrinth"); success = json.AddStringAt(-1,"Director","Guillermo del Toro"); success = json.AddStringAt(-1,"Original_Title","El laberinto del fauno"); success = json.AddIntAt(-1,"Year_Released",2006); json.put_EmitCompact(false); std::cout << json.emit() << "\r\n"; exit(EXIT_SUCCESS); } static int s = ChilkatSample(); int main() { std::cout << "Inside main() - dummy things"; } To compile: g++ my.cpp -I./include -L./lib -lc...
PL/SQL Write BLOB to file (temp file): in my case I have a table with BLOB column, I keep my pdf files inside, and I need to save them in temp directory. This procedure accepts 3 arguments: BLOB, directory name to save into and file name: CREATE OR REPLACE PROCEDURE write_pdf(v_blob IN BLOB, p_directory IN VARCHAR2, p_filename IN VARCHAR2 ) IS v_length INTEGER; v_index INTEGER := 1; v_bytecount INTEGER; v_tempraw RAW(32767); v_file UTL_FILE.file_type; BEGIN v_file := UTL_FILE.fopen(p_directory, p_filename, 'wb', 32767); v_length := DBMS_LOB.getlength(v_blob); WHILE v_index <= v_length LOOP v_bytecount := 32767; DBMS_LOB.read(v_blob, v_bytecount, v_index, v_tempraw); UTL_FILE.put_raw(v_file, v_tempraw); UTL_FILE.fflush(v_file); ...
Comments
Post a Comment