Error in using DBMS_LOB Package
Hi,
I am attaching a PDF File through a database procedure as shown below
create or replace procedure load_document(document_id in number, filename IN varchar2, doc_desc IN VARCHAR2, doc_type IN VARCHAR2) as
f_lob bfile;
b_lob blob;
--document_name varchar2(30);
--mime_type varchar2(30);
document_name oea_documents.document_name%TYPE;
mime_type oea_documents.document_mime_type%TYPE;
dot_pos number;
v_file_type VARCHAR2(10);
begin
-- Find the position of the dot ('.') located in the filename
dot_pos := instr(filename,'.');
-- Get the filename without extension and use it as image name
document_name := substr(filename,1,dot_pos-1);
-- Build the mime type . Retrieve the file extension and add it to 'image/'
v_file_type := SUBSTR( filename, dot_pos+1, Length(Filename) );
IF ( UPPER(v_file_type) IN ('JPG','JPEG','TIF','TIFF','GIF') ) THEN
mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
ELSIF ( UPPER(v_file_type) = 'PDF' ) THEN
mime_type := 'application/pdf';
ELSIF ( UPPER(v_file_type) = 'DOC' )THEN
mime_type := 'application/msword';
ELSIF ( UPPER( v_file_type) = 'XLS') THEN
mime_type := 'application/ms-excel';
ELSE
mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
END IF;
insert into oea_documents (document_id,
document_name,
document_mime_type,
document,
document_description,
document_type
values(document_id, document_name, mime_type, empty_blob(),doc_desc,doc_type) return document into b_lob;
-- /!\ Directory name has to be UpperCase !
f_lob := bfilename('FILE_LOAD',filename);
o_dset_test('5');
dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
o_dset_test('6');
dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
FILE_LOAD is a folder on the database server(unix).
I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.
while executing this procedure I am getting the error ora-22288(Invalid file or directory).
But this occurs randomly
For instance i tried to attach a pdf file with the name cross.pdf ,it gave me the above error and when i renamed the file as Cross.pdf it attached successfully.
The error comes whilke executing the statement dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
Please guide on the above issue.
Hi,
Welcome to the forum!
user1356624 wrote:
f_lob := bfilename('FILE_LOAD',filename);
FILE_LOAD is a folder on the database server(unix).
I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.The first argument to BFILENAME is the name of a directory object, as found in the directory_name column of all_directories. That is not the same thing as a folder name, which is found in the directory_path column of all_directories. Look up [CREATE DIRECTORY|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5007.htm#sthref6211] in the SQL Language manual for a description of Oracle's directory objects.
If you have problems with this, post the results of
SELECT *
FROM all_directories;It might also be useful to see the Oracle "CREATE DIRECTORY" command that was used.
As you probably noticed, this site compresses white space by default.
When you post code or results on this site, type these 6 characters:
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Edited by: Frank Kulash on Aug 10, 2009 3:35 PM
Added link.
Similar Messages
-
Error while using UTL_FILE package
I am getting error while using UTL_FILE package in apex 3.0 version
Pls help me out.ok, how are you using UTL_FILE and what is the error?
-
Error while using UTL_DBWS package
Hello
I want to call a web service using UTL_DBWS package as explained in this link.
http://www.oracle-base.com/articles/10g/utl_dbws10g.php
I implemented the example successfully, and I need to my own web service.
my web service is just a java class that return a hello world and a parameter. deployed on Integrated weblogic server shipped with Jdeveloper11g.
here is my java class
package ws;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
public class HelloWorld {
public HelloWorld() {
@WebMethod(action = "http://ws//sayHelloWorld")
public String sayHelloWorld(){
return "Hello World";
@WebMethod(action = "http://ws//sayHelloWorld")
public String sayHelloName(@WebParam(name = "arg0")
String n){
return "Hello " + n;
}my WSDL is
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
-->
- <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
-->
- <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="HelloWorldService">
- <types>
- <xsd:schema>
<xsd:import namespace="http://ws/" schemaLocation="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?xsd=1" />
</xsd:schema>
</types>
- <message name="sayHelloWorld">
<part name="parameters" element="tns:sayHelloWorld" />
</message>
- <message name="sayHelloWorldResponse">
<part name="parameters" element="tns:sayHelloWorldResponse" />
</message>
- <message name="sayHelloName">
<part name="parameters" element="tns:sayHelloName" />
</message>
- <message name="sayHelloNameResponse">
<part name="parameters" element="tns:sayHelloNameResponse" />
</message>
- <portType name="HelloWorld">
- <operation name="sayHelloWorld">
<input message="tns:sayHelloWorld" />
<output message="tns:sayHelloWorldResponse" />
</operation>
- <operation name="sayHelloName">
<input message="tns:sayHelloName" />
<output message="tns:sayHelloNameResponse" />
</operation>
</portType>
- <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="sayHelloWorld">
<soap:operation soapAction="http://ws//sayHelloWorld" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
- <operation name="sayHelloName">
<soap:operation soapAction="http://ws//sayHelloWorld" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="HelloWorldService">
- <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
<soap:address location="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort" />
</port>
</service>
</definitions>and my function is to call the web service
CREATE OR REPLACE FUNCTION SAYHelloMYNAME (p_int_1 IN Varchar2)
RETURN NUMBER
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.call;
l_wsdl_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_service_qname UTL_DBWS.qname;
l_port_qname UTL_DBWS.qname;
l_operation_qname UTL_DBWS.qname;
l_xmltype_in XMLTYPE;
l_xmltype_out XMLTYPE;
l_return VARCHAR2(100);
BEGIN
l_wsdl_url := 'http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl';
l_namespace := 'http://ws/';
l_service_qname := UTL_DBWS.to_qname(l_namespace, 'HelloWorldService');
l_port_qname := UTL_DBWS.to_qname(l_namespace, 'HelloWorldPort');
l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sayHelloName');
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
l_call := UTL_DBWS.create_call (
service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname);
l_xmltype_in := XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
<sayHelloWorld xmlns="' || l_namespace || '">
<parameters>' || p_int_1 || '</parameters>
</sayHelloWorld>');
l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
request => l_xmltype_in);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
l_return := l_xmltype_out.extract('//return/text()').getstringVal();
RETURN l_return;
END;
/but when I test the function I get this error
ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: Failed to read wsdl file at: "http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl", caused by: java.net.ConnectException. : Connection refused
ORA-06512: at "WSUSER.UTL_DBWS", line 193
ORA-06512: at "WSUSER.UTL_DBWS", line 190
ORA-06512: at "WSUSER.SAYHELLOMYNAME", line 24any suggestions?M.Jabr wrote:
can you elaborate more on this?
I can open http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl
on my browser.Is your browser on that Oracle server? You are instructing Oracle server code (the UTL_DBWS package) to access that URL.
The IP in that URL is a localhost IP address - and that means using the local IP stack only. So it expects a web server on the Oracle server platform on tcp port 7101. It cannot use that IP to access your client/development machine.
How can I test it using UTL_HTTP?You can write a basic web browser, minus the rendering engine, using UTL_HTTP. You can also use it for web service calls - which is my preference as I deem the UTL_DBWS package to clunky and complex.
See:
{message:id=1925297} (sample PL/SQL web browser)
{message:id=4205205} (sample PL/SQL web browser SOAP call) -
Error when using DBMS_XMLDOM package
Hello,
I have created a set of triggers that use the DBMS_XMLDOM packages. These triggers were created on a Win 2k install of 9.2.0.2.1. A brand new user was created and a specific set of permissions granted. The permissions were:
GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE, AQ_USER_ROLE
GRANT EXECUTE ON DBMS_AQADM
GRANT EXECUTE ON DBMS_AQ
grant execute on dbms_aqin
execute dbms_java.grant_permission('<USER>', 'java.net.SocketPermission', 'localhost:1024-', 'accept, listen, resolve');
execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission', ' getClassLoader', '' )
execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission' , 'setContextClassLoader', '' )
I then went to install these triggers on our application database server. This is a Solaris installation that started out as 9.2.0.1.0 and was then upgraded to 9.2.0.2.0. I created the user and granted the exact same permissions on this database. However, everytime I attempt to execute the triggers, or anything else that uses DBMS_XMLDOM packages, I get the following error:
doc dbms_xmldom.DOMDocument;
ERROR at line 3:
ORA-06550: line 3, column 11:
PLS-00201: identifier 'DBMS_XMLDOM.DOMDOCUMENT' must be declared
I did not create the application database instance on the Solaris machine, but from what I've talked with the DBA, it was created as a general database, which is how I created my test databases. I also verified that the users in both databases have Execute on SYS.XMLDOM granted.
Any ideas on why I might be getting this error?
Thanks,
AndrewWhen I try the describe, it says object not found. If I go into OEM, I don't see that package either. Again, I didn't create that database, but I thought the XML DB stuff was installed by default with the database. Is there a way to add that package after the database is created?
Thanks,
Andrew -
Error logging using DBMS_ERRLOG package
Hi All,
We have following tables, which are growing day-by-day and giving performance problems.
There are total 25 tables (1 parent and 24 child tables, with different structures).
Here i gave some Samples, NOT actual table structures.
Actually we don't require all the data for our regular activities.
So we thought of moving part of the data into Other (Archive) tables, on daily basis.
Using SOME criteria, we are finding eligible records to be moved into Archive tables.
All child records follows the Parent.
Original Tables
==================
create table customer (c_id number(5), c_name varchar2(10),c_address varchar2(10));
create table orders (o_id number(5),c_id number(5),o_info clob);
create table personal_info (p_id number(5),c_id number(5), age number(3), e_mail varchar2(25), zip_code varchar2(10)):
Archive Tables
==============
create table customer_arch (c_id number(5), c_name varchar2(10),c_address varchar2(10));
create table orders_arch (o_id number(5),c_id number(5),o_info varchar2(100));
create table personal_info_arch (p_id number(5),c_id number(5), age number(3), e_mail varchar2(25), zip_code varchar2(10)):
Temp table
==========
create table C_temp (rnum number(5), ids number(5));
Sample Code
============
PROCEDURE payment_arch
IS
l_range_records NUMBER (4) := 2000;
l_total_count NUMBER(10) := 0;
l_prev_count NUMBER(10) := 0;
l_next_count NUMBER(10) := 0;
BEGIN
--Finding eligible records to be moved into Archive tables.
INSERT INTO C_TEMP
SELECT ROWNUM,c_id FROM customer;
SELECT NVL(MAX(ID),0) INTO l_total_count FROM OPP_PAYMENT_ID_TEMP;
IF l_total_count > 0 -- Start Count check
THEN
LOOP -- Insert Single payments
IF ((l_total_count - l_prev_count) >= l_next_count )
THEN
l_next_count := l_prev_count + l_range_records;
ELSE
l_next_count := l_total_count;
END IF;
l_prev_count := l_prev_count ;
INSERT INTO customer_ARCH
SELECT * FROM customer a
WHERE c_id in (SELECT c_id
FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
INSERT INTO orders_ARCH
SELECT * FROM orders a
WHERE c_id in (SELECT c_id
FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
INSERT INTO personal_info_ARCH
SELECT * FROM personal_info a
WHERE c_id in (SELECT c_id
FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
-- Delete Archived Single Payments
DELETE customer a
WHERE c_id in (SELECT c_id
FROM C_TEMP b WHERE ID BETWEEN l_prev_count AND l_next_count);
COMMIT;
IF l_next_count = l_total_count
THEN
EXIT;
else
l_prev_count := l_next_count;
END IF;
END LOOP; -- Insert Single payments
END IF; -- End Count check
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
RAISE_APPLICATION_ERROR('-20002','payment_arch: ' || SQLCODE ||': ' || SQLERRM);
END Payment_Arch;
In production, we may require to archive 25000 Parent records and 25000*4*3 child records per day.
Now the problem is:
By any chance, if record fails, We want to know the Exact record ,just "c_id" for the particular table
where the error raised and Error message.
We thought of using DBMS_ERRLOG package, but we CAN NOT log errors of Different tables into SINGLE error log table.
In the above case It require 3 Different tables and it logs all columns from the original table.
It's a un-necessary burden on the database.
We would be very glad, if anyone can help us with some good thought.
Thanks in advance.
srinivasduplicate post
Insufficient privilege error when executing DBMS_ERRLOG through PLSQL -
Error while using DBMS_XMLSave package...
Hi All,
I am using DBMS_XMLSave package and when I try to execute the following code, it is giving me error "Java call terminated by uncaught Java exception:"
I am executing following code ....
declare
insCtx DBMS_XMLSave.ctxType;
begin
insCtx := DBMS_XMLSave.newContext('scott.emp');
end;
I am getting following error ...
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.ExceptionInInitializerError
ORA-06512: at "SYS.DBMS_XMLSAVE"
ORA-06512: at line
Please help me to overcome the problem....
Thanx in advance ,
YogeshFound maybe an applicable reference...
On http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/Java_2_Connectivity_(J2C)/1163246.html
it says:
* Application code is missing a setXXX method call somewhere.
* There might be a problem in the Oracle JDBC driver code.
If the latter is the problem than you should or try a different JDBC driver or (which is probably the best solution anyway) create an iTar with Oracle support via metalink.oracle.com
Other references can also be found on the internet when using google which could be applicable. Search on keywords: "Missing IN or OUT parameter at index"
Message was edited by:
mgralike -
Error while using Copy Package
Hi,
I want to copy data from category BudgetV1 to BudgetV2,
I have tried to use Copy Package but I always get error with
error message "The file is empty".
Can anyone help me with the problem?
Thanks in advance.Hi,
Please check if you have data in category BudgetV1. This error normally occurs when there is no data in source specified in COPY package. Make sure to select appropriate members when you specify other source dimensions.
Hope this helps.
Regards,
Shoba -
Error while using Mail Package for dynamic email address - XMLScanException
Hi All,
i am trying to implement File_to_Mail Scanrio. Here i am using mail package stuff to make use the dynamic mail Id's. i am following the blog /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address. i have finished all the settings as per the blog but it throwing the following error
failed to send mail: com.sap.aii.messaging.util.XMLScanException: expecting start tag: Mail, but found Mail at state 1
Please help me to resolve this error.
Thanks in advance
-Siva
Edited by: Siva Ram on Jan 18, 2008 7:43 AM
Edited by: Siva Ram on Jan 18, 2008 7:43 AM
Edited by: Siva Ram on Jan 18, 2008 7:44 AM
Edited by: Siva Ram on Jan 18, 2008 7:44 AM
Edited by: Siva Ram on Jan 21, 2008 5:59 AMHi Siva
check with these threads discuss the same XMLScanException
Mail adapter fails when using Mail Package Format
Error in E-mail Adapter - Message protocol XIALL
Mapping Error with mail package
Error in Mail Adapter
See the below links also
/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
/people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
Error in Mail Adapter
Mapping Error with mail package
Regards
Abhishek -
Error while using UTP_MAIL package in oracle 10g
Hi,
I am using the UTP_MAIL package to send a mail from oracle 10g.
I hane connected to the database as sysdba,but while setting the SMTP_SERVER_OUTPUT parameter i get the following error.
SQL> ALTER SYSTEM SET smtp_out_server='blrkecmbx02.ad.abc.com:25' scope=both;
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
Pls help to figure out a solution.This parameter is not modifiable, check the Oracle Reference: SMTP_OUT_SERVER Initialization Parameter
Try the scope=spfile instead of both.
~ Madrid -
Error while using utl_http package
Hi Guys,
I need some help with the utl_http package
The problem that Iam facing is as follows :
Iam trying to use the Oracle provided package utl_http
package to send an http request to a particular
website.However Iam getting the request_failed
exception.
I type in the foll.command in sqlplus:
select utl_http.request('http://www.oracle.com') from
dual
and I get the foll.error---
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_HTTP", line 174
ORA-06512: at line 1
If I try and trap the exception it shows
request_failed exception.
If any one has any clue on how to resolve this -- >please reply ASAP .
ThanksIs it possible that your database sits behind a firewall? If so, you need to specify the proxy in utl_http.request.
-
Error when useing DBMS_CRYPTO package in reports 10g
hi all,
i wrote a package which use dbms_crypto, there are functions to crypto userid and decrypo userid.
in report 6i it work fine it cryptos and decrpts. when i use in reports 10g it gives this error.
-28817 ORA-28817: PL/SQL function returned an error.
ora-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
ORA-06512: at "SYS.DBMS_CRYPTO", line 41
ora-06512: at "YBS.SIFRELE", line 26
the packege like this;
PACKAGE BODY SIFRELE
IS
function sicil_sifrele (p_sicil_no IN varchar2) RETURN varchar2
IS
p_key RAW(128);
p_sicil_raw RAW(128);
p_encrypted_raw RAW(128);
BEGIN
p_key := utl_raw.cast_to_raw(to_char(sysdate,'mmyyyydd'));
p_sicil_raw := utl_raw.cast_to_raw(p_sicil_no);
p_encrypted_raw := dbms_crypto.encrypt(src => p_sicil_raw,
typ => dbms_crypto.des_cbc_pkcs5, key => p_key);
return (utl_raw.cast_to_varchar2(p_encrypted_raw));
END;
FUNCTION sicil_coz ( p_encrypted_raw IN RAW) RETURN varchar2
IS
p_key RAW(128);
p_decrypted_raw RAW(128);
sicil_donen VARCHAR2(250);
BEGIN
p_key := utl_raw.cast_to_raw(to_char(sysdate,'mmyyyydd'));
p_decrypted_raw := dbms_crypto.decrypt(src => p_encrypted_raw,
typ => dbms_crypto.des_cbc_pkcs5, key => p_key);
sicil_donen := utl_raw.cast_to_varchar2(p_decrypted_raw);
return (sicil_donen);
END;
END;
thanks.
eserHello,
You should create a "wrapper function"
Create a function in the database that will call dbms_crypto.encrypt / dbms_crypto.decrypt and call this function in Reports.
(The problem here seems to be the reference to dbms_crypto.des_cbc_pkcs5)
Regards -
Error while using dbms_lob.fileopen
Hi,
I am getting the below error when executing the code given below,
CODE:-
DECLARE
l_bfile BFILE;
l_data BLOB;
BEGIN
DBMS_LOB.createtemporary (lob_loc => l_data,
CACHE => TRUE,
dur => DBMS_LOB.CALL);
l_bfile := BFILENAME('/home/lt/write','MIA00137.inp');
DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
END;
ERROR:-
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 523
ORA-06512: at line 12
I am using the directory path instead of using the directory name, which is my requirement. How can I overcome the above error.
Thanks
RKRYou should use a directory object not a file system directory.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5007.htm#sthref6399
Bye Alessandro -
Error when using DBMS_CRYPTO package in reports 10g
hi all,
i wrote a package which use dbms_crypto, there are functions to crypto userid and decrypo userid.
the packege like this;
PACKAGE BODY SIFRELE
IS
function sicil_sifrele (p_sicil_no IN varchar2) RETURN varchar2
IS
p_key RAW(128);
p_sicil_raw RAW(128);
p_encrypted_raw RAW(128);
BEGIN
p_key := utl_raw.cast_to_raw(to_char(sysdate,'mmyyyydd'));
p_sicil_raw := utl_raw.cast_to_raw(p_sicil_no);
p_encrypted_raw := dbms_crypto.encrypt(src => p_sicil_raw,
typ => dbms_crypto.des_cbc_pkcs5, key => p_key);
return (utl_raw.cast_to_varchar2(p_encrypted_raw));
END;
FUNCTION sicil_coz ( p_encrypted_raw IN RAW) RETURN varchar2
IS
p_key RAW(128);
p_decrypted_raw RAW(128);
sicil_donen VARCHAR2(250);
BEGIN
p_key := utl_raw.cast_to_raw(to_char(sysdate,'mmyyyydd'));
p_decrypted_raw := dbms_crypto.decrypt(src => p_encrypted_raw,
typ => dbms_crypto.des_cbc_pkcs5, key => p_key);
sicil_donen := utl_raw.cast_to_varchar2(p_decrypted_raw);
return (sicil_donen);
END;
END;
in report 6i it work fine cryptos and decrpts. when i use in reports 10g it gives this error.
-28817 ORA-28817: PL/SQL function returned an error.
ora-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
ORA-06512: at "SYS.DBMS_CRYPTO", line 41
ora-06512: at "YBS.SIFRELE", line 26
thanks...Hello,
You should create a "wrapper function"
Create a function in the database that will call dbms_crypto.encrypt / dbms_crypto.decrypt and call this function in Reports.
(The problem here seems to be the reference to dbms_crypto.des_cbc_pkcs5)
Regards -
Error when using DBMS_XMLSave package
Hi,
I am a novice at XML technology. And although I have picked up on the basics, please do bear with my questions. My requirement is that we are receiving XML files in a particular format (as below), which I need to load into Oracle tables.
<?xml version="1.0"?>
<Root_Element>
<Examinee>
<MACode>A</MACode>
<TestingJID>TN</TestingJID>
<ExamineeID>100001</ExamineeID>
<CreateDate>20020221</CreateDate>
<Demographic>
<InfoDate>20020221</InfoDate>
<FirstTime>1</FirstTime>
<LastName>JANE</LastName>
<FirstName>DOE</FirstName>
<MiddleInitial>C</MiddleInitial>
<LithoNumber>73</LithoNumber>
<IdType>1</IdType>
<IdNumber>30738</IdNumber>
<DOB>19630525</DOB>
<EthnicCode>1</EthnicCode>
<GenderCode>2</GenderCode>
<MilitaryCode/>
<MSCode/>
<RFT01>1</RFT01>
<RFT02></RFT02>
<RFT03></RFT03>
<RFT17></RFT17>
<StreetAddress>SomeAddress</StreetAddress>
<City>SomeCity</City>
<StateCode>TN</StateCode>
<ZipCode>37000</ZipCode>
<EdLevel>8</EdLevel>
<SU01> </SU01>
<SU02> </SU02>
<SU03> </SU03>
<SU04> </SU04>
<TestCenterCode>34</TestCenterCode>
<PassStatus>1</PassStatus>
<CompleteStatus>1</CompleteStatus>
<CompleteDate>20020221</CompleteDate>
<TotStdScore>268</TotStdScore>
<AvgStdScore>53.6</AvgStdScore>
<CredJID>TN</CredJID>
<CredStatus>1</CredStatus>
<CredNbr>100001</CredNbr>
<CredDate>20020310</CredDate>
</Demographic>
<Test>
<TestDate>20020221</TestDate>
<TestNbr>1</TestNbr>
<SrlNbr>13773784</SrlNbr>
<Fmt>3</Fmt>
<Frm>23</Frm>
<Raw>47</Raw>
<Top>10</Top>
<RN1>30</RN1>
<RN2>35</RN2>
<RN3></RN3>
<RS1>4</RS1>
<RS2>4</RS2>
<RS3></RS3>
<ESY>8</ESY>
<Std>58</Std>
<Rnk>81</Rnk>
<FErr>0</FErr>
<EErr>0</EErr>
<MErr>0</MErr>
<JErr>0</JErr>
<AErr>0</AErr>
<QErr>0</QErr>
<Best>1</Best>
<Inactive>0</Inactive>
<Response>4,4,4,2,2,5,1,1,2,4,5,5,5,1,3,1,5,4,1,1,5,3,1,3,5,4,4,4,4,3,1,4,1,1,3,4,2,4,4,3,1,1,4,5,4,3,1,2,4,1, , , , , </Response>
</Test>
<Test>
<TestDate>20020221</TestDate>
<TestNbr>2</TestNbr>
<SrlNbr>13773784</SrlNbr>
<Fmt>3</Fmt>
<Frm>23</Frm>
<Raw>46</Raw>
<Std>53</Std>
<Rnk>67</Rnk>
<FErr>0</FErr>
<EErr>0</EErr>
<MErr>0</MErr>
<JErr>0</JErr>
<AErr>0</AErr>
<QErr>0</QErr>
<Best>1</Best>
<Inactive>0</Inactive>
<Response>5,3,5,3,2,4,3,4,3,3,2,4,3,2,2,3,2,2,2,3,1,4,3,5,4,3,1,1,2,1,2,4,5,5,2,5,4,5,4,1,3,2,1,4,1,3,2,4,2,1,1,1,4,4,5,2,3,2,1, , , , , </Response>
</Test>
</Examinee>
</Root_Element>
We will be creating new tables, so taking into account the nested structures we decided to go the object-relational route. The "Examinee" is on the higher level with a single "Demographic" and multiple "Test" under it. This is what we have created.
create or replace type DEMOGRAPHIC_TY as object (
InfoDate VARCHAR2(50),
FirstTime VARCHAR2(50),
LastName VARCHAR2(50),
FirstName VARCHAR2(50),
MiddleInitial VARCHAR2(50),
LithoNumber VARCHAR2(50),
IdType VARCHAR2(50),
IdNumber VARCHAR2(50),
DOB VARCHAR2(50),
EthnicCode VARCHAR2(50),
GenderCode VARCHAR2(50),
MilitaryCode VARCHAR2(50),
MSCode VARCHAR2(50),
RFT01 VARCHAR2(50),
RFT02 VARCHAR2(50),
RFT03 VARCHAR2(50),
RFT17 VARCHAR2(50),
StreetAddress VARCHAR2(50),
City VARCHAR2(50),
StateCode VARCHAR2(50),
ZipCode VARCHAR2(50),
EdLevel VARCHAR2(50),
SU01 VARCHAR2(50),
SU02 VARCHAR2(50),
SU03 VARCHAR2(50),
SU04 VARCHAR2(50),
TestCenterCode VARCHAR2(50),
PassStatus VARCHAR2(50),
CompleteStatus VARCHAR2(50),
CompleteDate VARCHAR2(50),
TotStdScore VARCHAR2(50),
AvgStdScore VARCHAR2(50),
CredJID VARCHAR2(50),
CredStatus VARCHAR2(50),
CredDate VARCHAR2(50),
CredNbr VARCHAR2(50));
create or replace type TEST_TY as object (
TestDate VARCHAR2(50),
TestNbr VARCHAR2(50),
SrlNbr VARCHAR2(50),
Fmt VARCHAR2(50),
Frm VARCHAR2(50),
"Raw" VARCHAR2(50),
Top VARCHAR2(50),
RN1 VARCHAR2(50),
RN2 VARCHAR2(50),
RN3 VARCHAR2(50),
RS1 VARCHAR2(50),
RS2 VARCHAR2(50),
RS3 VARCHAR2(50),
ESY VARCHAR2(50),
Std VARCHAR2(50),
Rnk VARCHAR2(50),
FErr VARCHAR2(50),
EErr VARCHAR2(50),
MErr VARCHAR2(50),
JErr VARCHAR2(50),
AErr VARCHAR2(50),
QErr VARCHAR2(50),
Best VARCHAR2(50),
Inactive VARCHAR2(50),
Response VARCHAR2(100));
create or replace type TEST_NT as table of TEST_TY;
create table EXAMINEE (
MACode VARCHAR2(50),
TestingJID VARCHAR2(50),
ExamineeID VARCHAR2(50),
CreateDate VARCHAR2(50),
Demographic DEMOGRAPHIC_TY,
Test TEST_NT)
nested table Test store as Test
CREATE DIRECTORY XML_DIR AS 'C:\TestXML';
CREATE TABLE XML_TEMP (key NUMBER, f_lob BFILE);
INSERT INTO XML_TEMP VALUES (1,BFILENAME('XML_DIR','M01.XML'));
And this is the procedure,
CREATE OR REPLACE PROCEDURE loadxml AS
insCtx sys.DBMS_XMLSave.ctxType;
rows number;
fil BFILE;
buffer RAW(32767);
len INTEGER;
insrow INTEGER;
BEGIN
SELECT f_lob INTO fil FROM xml_temp WHERE key = 1;
DBMS_LOB.FILEOPEN(fil,DBMS_LOB.FILE_READONLY);
len := DBMS_LOB.GETLENGTH(fil);
DBMS_LOB.READ(fil,len,1,buffer);
insCtx := sys.DBMS_XMLSave.newContext('examinee'); -- get the context handle
rows := sys.DBMS_XMLSave.insertXML(insCtx,buffer); -- this inserts the document
sys.DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
DBMS_LOB.FILECLOSE(fil);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('In Exception');
DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
DBMS_LOB.FILECLOSE(fil);
END IF;
end;
And when I execute this, it gives an error,
In Exception
ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
I have tried to follow the XML Developer Guide as much possible, but might be missing something.
H E L P !!!!
Thanks.When I try the describe, it says object not found. If I go into OEM, I don't see that package either. Again, I didn't create that database, but I thought the XML DB stuff was installed by default with the database. Is there a way to add that package after the database is created?
Thanks,
Andrew -
Error returned using SQL package
Hi,
I'm trying to connect to a database using the example code supplied in the docs here at java but I am getting the following error.
Error: The name "SQLWarning" is not declared as a type. : C:\Program Files\Asymetrix\SuperCede\Projects\Project1\Component3\Source1.java (133)
1. Can anyone explain this
2. Is there an online database/listing of compiler error messages that explain javac error messages in more detail.
thanks,
RemoAsymetrix SuperCede - Applet EditionOK, I'm not sure what this is. Is it an alternative comppiler or is it an IDE that uses Sun's standard compiler to do compilation.
I'm guessing it doesn't use Sun's compiler as that doesn't seem like a standard compilation error. Maybe you should try using the standard JDK and see if that works.
Also, I suggest that a database of compilation errors would need to be Asymetrix SuperCede specific if it is an alternative compiler.
Maybe you are looking for
-
How do I separate 3 different devices all using the same apple ID
HELP PLEASE!! My wife has a macbook which is about 5 years old. We used our only email address at that time as our apple ID. Since then we have bought her an iphone 4 and registered it with the same apple ID. Then a few months later I made the jump f
-
<!DOCTYPE HTML> <html> <head> <style type="text/css"> @font-face { font-family: 'dimmflmyriadprobold'; src: url('dimmflmyriadprobold.eot'); src: url('dimmflmyriadprobold.eot?#iefix') format('embedded-opentype'), url('dimmflmyriadprobold.woff') format
-
Email won't send: KINDA URGENT
Lately my MS Entourage was having trouble sending emails. I had to try several times before they would go out. Now, almost none of them will go. However, I can send to myself and to others in my office. But trying to send to someone outside my domain
-
Change lov record group dynamilcally
Please provide me solution :- declare l_id lov; rg_id recordgroup; n boolean; begin l_id := find_lov('LOV14'); rg_id := find_group('LOV14'); if get_lov_property('LOV14',group_name) = 'LOV14' then message('found
-
IChat issue: no idle/privacy preferences
Did Apple do away with privacy/idle preferences? I am running iChat 4.0.8, and when I go away but stay at the computer, or come back after screen saver initiates, I get a barrage of IMs, which leads me to believe my friends who are running AIM can se