Stored procedure - insert clob obj - error msg: ORA-01460: unimplemented
Hi all,
I have a situation where I want to insert a clob object to my local table via a stored procedure. The clob object stores large amount of text. The clob data is populated from retrieving content in an external text file. When executing an insert statement in c# code, the information was inserted successfully. when executing the stored procedure to insert the information, i always get "ORA-01460: unimplemented or unreasonable conversion requested". I use ReadToEnd() from StreamReader class to retrieve the context of the external text file. Does anyone know why Oracle behaves this way? Thanks for helping in advance.
TABLE DEFINITION FOR CLOB_TEST
Name Type Nullable Default Comments
PKG_NAME VARCHAR2(50) Y
PKG_DESC CLOB Y
PKG_FAM_ID NUMBER Y
STORED PROCEDURE
procedure InsertTempReleaseTable(p_name in varchar2,
p_description in clob,
p_fam_id number) is
begin
insert into clob_test
(pkg_name, pkg_desc, pkg_fam_id)
values
(p_name, p_description, p_fam_id);
end InsertTempReleaseTable;
RETRIEVE CONTENT FROM A TEXT FILE
public string GetTextFileContents(string path)
using (StreamReader sr = new StreamReader(path))
return (sr.ReadToEnd());
C# INVOKE STORED PROCEDURE TO INSERT
using (OracleCommand cmd = (OracleCommand)database.GetStoredProcCommand("pkg_sptbuildstatus.InsertTempReleaseTable"))
cmd.Parameters.Add("p_name", OracleType.VarChar, 255).Value = obj.PackageName; // string
cmd.Parameters.Add("p_description", OracleType.Clob).Value = obj.ChangeDescription; // string
cmd.Parameters.Add("p_fam_id", OracleType.Number).Value = obj.FamilyId; // int
database.ExecuteNonQuery(cmd);
}Edited by: user8976335 on Jan 11, 2010 4:28 PM
Edited by: user8976335 on Jan 11, 2010 4:59 PM
Edited by: user8976335 on Jan 11, 2010 4:59 PM
Edited by: user8976335 on Jan 12, 2010 10:48 AM
It's possible it doesn't like the name of your variables (being the same as the table), it's good practice to not do that.
Much better would be.
procedure InsertTempReleaseTable
p_name in varchar2,
p_description in clob,
p_fam_id number
is
begin
insert into clob_test
(name, description, fam_id)
values
(p_name, p_description, p_fam_id);
end InsertTempReleaseTable;Your Oracle version is typically of immense help.
select * from v$version;Also, using the tags will keep the formatting of your code.
If this isn't any help, can you post a working example of your example ? Where the code breaks (which call).
Edited by: Tubby on Jan 11, 2010 3:50 PM
Edited by: Tubby on Jan 11, 2010 3:51 PM
Similar Messages
-
Calling Stored Procedure with CLOB parameter
Hi,
i have one procedure with IN parameter CLOB which is taking xml file and stored in one table column and this table column datatype is also CLOB. And this procedure called by .Net program but problem is when the file will come more than 32KB calling procedure failed. But as i know CLOB can stored up to 4GB data.
Is that Limitation of oracle or .Net version
please let me know the solution for that,
Create Procedure Insert_File(P_XMLFILE IN CLOB)
as
begin
insert into instances
values(p_xmlfile);
commit;
end;
regards,
MadanHi Thanks for your reply,
Actually this procedure called by .net program and the XML file has passed in that parameter which come from some FTP(its inbound) and this files we are storing into above mentioned table.
Error has come while calling stored procedure Through .net
Error Details:
Error calling stored procedure. 0 retry attemps has failed. Error: System.Exception: Error while calling stored procedure on Oracle: INSERT_FILE: System.Data.OracleClient.OracleException: ORA-01460: unimplemented or unreasonable conversion requested -
Hi,
I'm getting the error msg ORA-00054: resource busy and aquire with NOWAIT specified. This happens when I'm trying to delete a table.use to detect who's locking the table:
select S.SID,Q.SQL_TEXT
from V$LOCK L, V$SESSION S, V$SQLAREA Q
where L.BLOCK = 1
and S.SID = L.SID
and S.SADDR = Q.ADDRESS; -
ORA-01460: unimplemented or unreasonable error & OPEN-FOR statement ...
Hi,
I have a procedure that opens a cursor which returns a result set based on a dynamic SELECT statement. The IN clause
in most cases needs to handle more than 1000 expressions. So to avoid the ORA-01785 error, I use a function to
convert the comma separated list of ids (which are unknown) into a collection which can then be used in the sub query
to process each expression or id. I assumed that the maximum string length I could use for these list of ids was
32767, i.e. VARCHAR2. But f I attempt to open the cursor with a list of ids where the string length is greater than 4000 bytes , the cursor is invalid
and it seems to throw the following Oracle error:
ORA-01460: unimplemented or unreasonable conversion ...
Note that anything less than 4000 bytes is fine. I have attached some of the code below and would appreciate if anyone
could tell me what im doing wrong! For example, can a varchar2 variable greater than 4000 bytes not be used when
executing dynamic SQL in the context of the OPEN-FOR statement?
-- Create type to hold collection of identifiers.
CREATE OR REPLACE TYPE IDList IS TABLE OF NUMBER;
-- Function which converts a string of comma separated list of identifiers
-- into a collection.
CREATE OR REPLACE FUNCTION fnConvertIDListToCollection(
varList IN VARCHAR2,
varDelimiter IN VARCHAR2 DEFAULT ',')
RETURN IDList
IS
varString long := varList || varDelimiter;
varPos pls_integer;
varData IDList := IDList();
BEGIN
LOOP
varPos := instr(varString, varDelimiter);
EXIT WHEN (nvl(varPos, 0) = 0);
varData.extend;
varData(varData.count) := trim(substr(varString, 1, varPos - 1));
varString := substr(varString, varPos + 1);
END LOOP;
RETURN (varData);
END;
CREATE OR REPLACE PROCEDURE MyTestProc
myCursor OUT SYS_REFCURSOR
AS
varListOfIds VARCHAR2(32767);
BEGIN
-- Hard coding this for now but this will be an incoming parameter containing a list
-- of unknown ids, separated with commas.
varListOfIds := '1,2 .. , 5000';
OPEN myCursor FOR
'SELECT DISTINCT val1, val2, val3
FROM TABLEA
WHERE val1 IN (select * from table(cast(fnConvertIDListToCollection(:ListOfIds) as IDList)))' USING varListOfIds;
END;
/APC,
Many thanks for the suggestion and yes I could possibly implement an alternative solution, certainly for some cases but I need to investigate further for others. I'm migrating some SQL Server logic over to Oracle and that was simply the approach taken on that platform.
Could I trouble you with one further question as a newbie to all of this. I hinted in my last response that I was somewhat confused over the limits with the use of varchar2 variables in PL/SQL. If I were building up a piece of dynamic SQL (e.g. SELECT statement including a WHERE clause) using an incoming VARCHAR2 parameter for the WHERE clause, can this parameter contain more than 4000 bytes if necessary. I assumed it could be as big as 32767 bytes but an earlier response suggested a maximum of 4000 bytes. Really sorry for probably a fairly basic Oracle question but it would be very appreciated if you could explain this to me.
Again, many thanks. -
ORA-01460: unimplemented or unreasonable conversion requested
Hi,
i have a problem with a insert statement
we use C# .net
our database server version is
Oracle Database 10g Client
The problem is:
When iam trying to insert records more than 248 it returns the "ORA-01460: unimplemented or unreasonable conversion requested" error. If the number of records are less than 248, then iam able to insert it successfully. Can u please suggest me what to do inorder to overcome with this.
iam using the following query to insert.
PROCEDURE PINSUPD_UNIT
pi_unit_info CLOB,
pi_user_id DPS_USER.USR_ID%TYPE,
po_unit_cur OUT unit_cur
) AS
v_xmlDoc SYS.XMLTYPE;
v_xmlNode SYS.XMLTYPE;
v_intXMLNodeCount NUMBER;
v_UNIT_ID ECON_UNIT.UNIT_ID%TYPE;
v_DESCRIPTION ECON_UNIT.DESCRIPTION% TYPE;
v_NAME ECON_UNIT.NAME%TYPE;
v_UNIT ECON_UNIT.UNIT%TYPE;
v_sysdate DATE;
INVALID_XML EXCEPTION;
BEGIN
v_sysdate := TO_DATE( TO_CHAR(SYSDATE, 'DD/MM/YYYY HH:MI:SS AM'), 'DD/MM/YYYY HH:MI:SS AM');
-- To extract the Data from the XML Input
IF pi_unit_info IS NOT NULL AND pi_unit_info <> ' ' THEN
v_intXMLNodeCount := 1;
v_xmlDoc := SYS.XMLTYPE.CREATEXML(pi_unit_info);
WHILE SYS.XMLTYPE.ExistsNode(v_xmlDoc, '//Unit_Details[' || v_intXMLNodeCount || ']') = 1
LOOP
v_xmlNode := SYS.XMLTYPE.EXTRACT(v_xmlDoc, '//Unit_Details[' || v_intXMLNodeCount || ']');
v_UNIT_ID := 0;
v_UNIT_ID := TO_NUMBER(SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Unit_ID/text()').getStringVal(),'99999999999999999999999999999999999999');
v_DESCRIPTION := '';
v_DESCRIPTION := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Description/text()').getStringVal();
v_NAME := '';
v_NAME := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Name/text()').getStringVal();
v_UNIT := '';
v_UNIT := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Unit/text()').getStringVal();
IF v_UNIT_ID = 0 THEN
--To insert the Unit Details
INSERT INTO
ECON_UNIT
UNIT_ID,
NAME,
UNIT,
DESCRIPTION,
USR_ID,
LAST_UPDATED_DATE
VALUES
SEQ_UNIT.NEXTVAL,
v_NAME,
v_UNIT,
v_DESCRIPTION,
pi_user_id,
v_sysdate
DBMS_OUTPUT.put_line(v_name);
ELSE
--To update the Unit details
UPDATE
ECON_UNIT
SET
NAME = v_NAME,
UNIT = v_UNIT,
DESCRIPTION = v_DESCRIPTION,
USR_ID = pi_user_id,
LAST_UPDATED_DATE = v_sysdate
WHERE
UNIT_ID = v_UNIT_ID;
DBMS_OUTPUT.put_line(v_name);
END IF;
v_intXMLNodeCount := v_intXMLNodeCount + 1;
END LOOP;
OPEN po_unit_cur FOR SELECT * FROM ECON_UNIT;
ELSE
RAISE INVALID_XML;
END IF;
i know it is a known problem, but still iam trying a lot to overcome it.I believe, PL/SQL has a limitation of 32K characters for a LONG parameter.
-
Calling a stored procedure runs into an error
Hello,
We are testing the Database Adapter.
In our database we created the following
- Table tt
- Package ttpackage, with a procedure with 1 input and 1 output parameter which inserts a record in the tt table.
(see scripts at bottom of message)
We created a Database Adapter based upon this Package (Call a stored procedure or function) and register this Database Adapter with the Integration Server.
When we invoke this Database Adapter and enter the input, we can see in the database that 4 records are created. The Web Service returns after a minute with an error
How can we solve this problem?
Regards Leon Smiers
ERROR
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at java.util.Vector.get(Vector.java:710)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.readResponseHeader(Unknown Source)
SCRIPT
drop table tt
drop sequence seq_tt;
drop package ttpackage;
create table tt
(field1 number(10) not null
,field2 varchar2(25) not null
,status varchar2(1) not null
,primary key (field1)
create sequence seq_tt;
create or replace package ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type);
end;
show errors
create or replace package body ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type) is
begin
po_status:='I';
insert into tt
(field1, field2,status)
values(seq_tt.nextval,pi_field2,po_status);
end insert_tt;
end;
show errors
/Hello Dave,
Thanks for the quick fix.
I've tested the fix. The 'Array index out of range: 0' disappeared.
I get, unfortunately, the following error. I already described the steps I take in the first message. Based upon the TTpackage I create a Database adapter, register it with the ESB and invoke the URL from the ESB.
Regards Leon
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.xml.parser.v2.XMLDOMException: Ongeldige naamruimte http://xmlns.oracle.com/pcbpel/adapter/db/OCOP/TTPACKAGE/INSERT_TT/ voor prefix xmlns
at oracle.xml.parser.v2.XMLElement.setAttributeNS(XMLElement.java:1015)
at oracle.tip.esb.utils.DOMUtil.copyContentsTo(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.raiseEvent(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.processMessage(Unknown Source)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:869)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:460)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:177)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
</faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope> -
While executing java stored procedure i got an error
I have used this command to load java source into data base
loadjava -user ENCORA/ENCORA C:\framework\Packages\testdevelopement\HOST.java
but while executing i got an error.
SQL> create or replace function run_cmd(p_cmd in varchar2) return number
2 as
3 language java
4 name 'HOST.RunThis(java.lang.String[]) return integer';
5 /
Function created.
SQL> create or replace procedure RC(p_cmd in varchar2)
2 as
3 x number;
4 begin
5 x := run_cmd(p_cmd);
6 end;
7 /
Procedure created.
SQL> set serveroutput on size 1000000
SQL> exec dbms_java.set_output(1000000)
PL/SQL procedure successfully completed.
SQL> exec rc('/usr/bin/ps -ef');
BEGIN rc('/usr/bin/ps -ef'); END;
ERROR at line 1:
ORA-29540: class HOST does not exist
ORA-06512: at "ENCORA.RUN_CMD", line 0
ORA-06512: at "ENCORA.RC", line 5
ORA-06512: at line 1
can any one suggest me how can i resolve this problem?Hi Uday,
My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
is thrown to indicate that an exception occurred during
evaluation of a static initializer or
the initializer for a static variable
Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
1. Complete error message and stack trace you are getting.
2. The section of your java code that you think is causing the problem.
3. Oracle database version you are using.
Good Luck,
Avi. -
Stored Procedure Call from Bean Error - PLS-00201
Hello all,
I am using the java stored procedure code in the examples dir of weblogic51/examples/jdbc/...
with one exception. I created the stored procedure as another user with more
permissions than
the user that the jdbc connection will be established with. I created a public
synonym so the stored
procedure doesn't have to be refered to as "username.proc_squareInt". I keep
getting the following
errors. The web user has execute permissions and I tried calling it both with
the owner.proc_name
and proc_name (which I know won't work since it won't be able to find it).
Any help would be greatly appreciated.
Sincerely,
Michael Prinsen
Tue Jul 17 13:47:41 MDT 2001:<E> <WebAppServletContext-et> Root cause of ServletException
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'WTHDBM.PROC_SQUAREINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1330)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:757)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1807)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:332)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:376)
at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:35)
at csu.et.testBean.getWeatherData1(testBean.java:46)
at jsp_servlet._test._tester._jspService(_tester.java:107)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
// START CODE
package csu.et;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.text.*;
import java.beans.*;
import java.math.*;
import java.util.Date;
import java.util.Locale;
import csu.util.*;
public class testBean {
public String getWeatherData1() throws SQLException {
Connection conn = null;
conn = CSUConnection.getConnection("etSelectConnectionPool");
// Create a stored proc - (CREATED ALREADY)
// Statement stmt1 = conn.createStatement();
// stmt1.execute("CREATE OR REPLACE PROCEDURE proc_squareInt " +
// "(field1 IN OUT INTEGER, " +
// " field2 OUT INTEGER) IS " +
// "BEGIN field2 := field1 * field1; " +
// "field1 := field1 * field1; END proc_squareInt;");
// stmt1.close();
String sql = "{call proc_squareInt(?, ?)}";
CallableStatement cstmt1 = conn.prepareCall(sql);
cstmt1.registerOutParameter(2, java.sql.Types.INTEGER);
for (int i = 0; i < 5; i++) {
cstmt1.setInt(1, i);
cstmt1.execute();
System.out.println(i + " " + cstmt1.getInt(1) + " " + cstmt1.getInt(2));
cstmt1.close();
conn.close();
return("hard-coded stuff");
//END CODE
this is probably an oracle related issue, and has very little to do with
Weblogic transactions.
your easiest way to debug this is to open a SQL/Plus window, log in as user
WTHDBM and try to run the command
"execute proc_squareInt(5,5);"
"execute owner.proc_squareInt(5,5);"
if this doesn't work, consult Oracle technet on how to setup synonyms and
permissions
Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[email protected]
www.filip.net
"Michael Prinsen" <[email protected]> wrote in message
news:[email protected]...
>
> Hello all,
>
> I am using the java stored procedure code in the examples dir of
weblogic51/examples/jdbc/...
> with one exception. I created the stored procedure as another user with
more
> permissions than
> the user that the jdbc connection will be established with. I created a
public
> synonym so the stored
> procedure doesn't have to be refered to as "username.proc_squareInt". I
keep
> getting the following
> errors. The web user has execute permissions and I tried calling it both
with
> the owner.proc_name
> and proc_name (which I know won't work since it won't be able to find it).
>
> Any help would be greatly appreciated.
>
> Sincerely,
>
> Michael Prinsen
>
> Tue Jul 17 13:47:41 MDT 2001:<E> <WebAppServletContext-et> Root cause of
ServletException
> java.sql.SQLException: ORA-06550: line 1, column 7:
> PLS-00201: identifier 'WTHDBM.PROC_SQUAREINT' must be declared
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1330)
> at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:757)
> at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313
> at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
> at
oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1
353)
> at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
> at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
:1807)
> at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
ment.java:332)
> at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.j
ava:376)
> at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:35)
> at csu.et.testBean.getWeatherData1(testBean.java:46)
> at jsp_servlet._test._tester._jspService(_tester.java:107)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:120)
> at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:138)
> at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:915)
> at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:879)
> at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:269)
> at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
> at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>
>
>
> // START CODE
>
> package csu.et;
>
> import java.io.*;
> import java.sql.*;
> import java.util.*;
> import java.text.*;
> import java.beans.*;
> import java.math.*;
> import java.util.Date;
> import java.util.Locale;
> import csu.util.*;
>
> public class testBean {
>
> public String getWeatherData1() throws SQLException
>
> Connection conn = null;
> conn = CSUConnection.getConnection("etSelectConnectionPool");
>
> // Create a stored proc - (CREATED ALREADY)
> // Statement stmt1 = conn.createStatement();
> // stmt1.execute("CREATE OR REPLACE PROCEDURE proc_squareInt " +
> // "(field1 IN OUT INTEGER, " +
> // " field2 OUT INTEGER) IS " +
> // "BEGIN field2 := field1 * field1; " +
> // "field1 := field1 * field1; END proc_squareInt;");
> // stmt1.close();
>
> String sql = "{call proc_squareInt(?, ?)}";
> CallableStatement cstmt1 = conn.prepareCall(sql);
>
> cstmt1.registerOutParameter(2, java.sql.Types.INTEGER);
> for (int i = 0; i < 5; i++) {
> cstmt1.setInt(1, i);
> cstmt1.execute();
> System.out.println(i + " " + cstmt1.getInt(1) + " " +
cstmt1.getInt(2));
> }
>
> cstmt1.close();
> conn.close();
> return("hard-coded stuff");
> }
>
> }
>
> file://END CODE
-
Testing a Stored Procedure iView gives an error!!
Hi,
I have created a stored procedure iView , associated with a SP object in MSSQL server.Tested the connection etc..everything is works. but when i Preview the SP iview..It gives me an error
"No response from the backend application"
Can u please let me know whats wrong and also let me know incase i missed any step in creating the Iview,
thanks
GlenHi,
I have created a stored procedure iView , associated with a SP object in MSSQL server.Tested the connection etc..everything is works. but when i Preview the SP iview..It gives me an error
"No response from the backend application"
Can u please let me know whats wrong and also let me know incase i missed any step in creating the Iview,
thanks
Glen -
Oracle DB Error Msg (ORA-12505)
Hi,
I had problem accessing my DB (running on AIX-based) from SQL plus. An error code ORA-12505 is given. I had no problem to start up and shutdown the database. Anyone can advise?
By the way, what is ORA12505 means? How to resolve this error msg. Anywhere I can get full list of Oracle error message?
Thanks a lot!Hi Bee
In this link you can have all Oracle errors.
http://otn.oracle.com/pls/db92/db92.error_search?remark=homepage&prefill=ORA-
What is the message that you are getting ?
Joel Pérez -
Hi I installed oracleDEV 10g at my home desktop while I can't connect to company's oracle server, the user name and pswd are corrected set up while I got the error message ORA 12154 again and again, anybody can give me a help will be highly appreciated!
you can tell me the solution to [email protected]
ThanksHi
Check the tnsnames.ora file you are using, verify that it is accessible. Check if you have a $HOME/.tnsnames.ora file - This will be used in addition to 'tnsnames.ora'. Check TNS_ADMIN is set in your environment. - There is a readable tnsnames.ora file in $TNS_ADMIN
Regards Raf -
I installed a windows nt version on windows 95 and cannot log in. I am getting the error ORA-12203 TNSnames. Help anyone?
thanks
MinervaHi,
If you are using Sqlplus on the same machine in which you have the DB, you can run it in two ways :
- Specifying only username and password : in this case you have to set ORACLE_HOME and ORACLE_SID environment variables. ORACLE_HOME should be already defined in the registry, so you should have to set only ORACLE_SID = <your SID>
- Specifying username,password and connection string : here you have to configure an alias in the TNSNAMES.ora file to point to your DB : you can do this using NET MANAGER or NET EASY CONFIGURATION (I don't use often Windows systems, so I don't remember exactly....)
If you are using a Client, the second way is needed.
Then you have to check that the listener is running on the Server. Check the listener service, it has to be active. If so, from a DOS Window try :
LSNRCTL stop
LSNRCTL start
This stop and restart the listene
hth
Paolo -
Stored procedure which returns date error
if have a function getGmtDate in the package pa which uses a date as parameter and returns a date
conn.Connect()
strSQL = "pa.getGmtDate"
P_RETURN As New OracleParameter(":pRETURN", OracleDbType.Date, ParameterDirection.ReturnValue)
Dim P_DATE As New OracleParameter(":pDATE", OracleDbType.Date, 0, ParameterDirection.Input)
P_DATE.Value = Now 'current date
Dim cmd As New OracleCommand(strSQL, conn.getConnection)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(P_RETURN)
cmd.Parameters.Add(P_DATE)
cmd.ExecuteNonQuery()
dim returnValue as Date = P_RETURN.Value
and the date is retrieved correct from the db, but when I want to bind the resultdate to a variable then it throws an exception:
Cast from type 'OracleDate' to type 'Date' is not valid
can anyone help me?1) Create CallableStatement
2) For each of returning value you have to call RegisterOutParameter()
3) For others user setXXX() method depending on type of parameter
4) call
5) use vars registered through RegisterOutParameter() - all your values should be there
Pavel -
Inserting to a clob field using cx_Oracle via a stored procedure
Hello,
Does anyone have experience using cx_Oracle to call a stored procedure which inserts to a clob field? I have found examples of doing this via straight SQL but I was hoping it was possible to do this via a stored procedure call. Thanks for any help you can provide.
JasonAnd cursor.callproc('insert_clob_proc', (clob,))
doesn't work for you?
PrzemekYes - I should have been more clear in my original post. The callproc function works until we have a value which is over 32K. At values over 32K, we get an error message "ORA-01460: unimplemented or unreasonable conversion requested". I believe this is because we are sending the value as a string and so we would need to figure out how to send as a CLOB in cx_Oracle? Here is some code to use to test if interested...
Oracle (Oracle Database 10g Release 10.1.0.4.0 - Production):
CREATE TABLE clob_test (CLOB_FIELD CLOB);
CREATE OR REPLACE PROCEDURE ins_clob_test (v_clob_field IN CLOB)
AS
BEGIN
INSERT INTO clob_test (clob_field) VALUES (v_clob_field);
END ins_clob_test;
Python (2.5):
conn = cx_Oracle.connect(xhash['oraclelogin'])
cursor = conn.cursor()
clob_var = 'Some test data' * 10000
cursor.callproc('ins_clob_test',(clob_var,))
conn.commit()
cursor.close()
conn.close()
I should also mention that I am the Oracle developer and not the Python programmer - my knowledge of Python is very limited. I would like the Python programmers to use the procedures (packages) I have created to do their inserts but this situation has caused them to put the SQL directly in their code.
Thanks again for any assistance you can provide.
Jason -
Image Upload error ora-01460:
Hi to all,
I am doing a development in .Net to upload the Image.
I tried using to upload Image using Oracle Client Connectivity provided by .Net. I am able to upload the Image of any size upto 4GB on Blob field.
I tried using the same thing just changing the connectivity to OLEDB and tried to upload the Image but I'm getting the error as ora-01460: unimplemented or unreasonable conversion requested for Image file size greater than 32K.
What would be the possible causes for this.. I posted below my table structure and the procedure involved in the uploding the picture.
Name Null? Type
ID NUMBER
IMAGE_FILENAME VARCHAR2(500)
IMAGE BLOB
MIME VARCHAR2(4000)
FILENAME VARCHAR2(4000)
Procedure
CREATE OR REPLACE PROCEDURE DBO.SP_UPLOAD_FILE(P_ID IN NUMBER, P_FILENAME IN VARCHAR2, P_MIME IN VARCHAR2, P_PICTURE IN BLOB) AS
BEGIN
UPDATE TEMP_IMAGE SET IMAGE = P_PICTURE, FILENAME = P_FILENAME, MIME = P_MIME
WHERE ID= P_ID;
END;
Please post your suggestions..
Thanks and Regards,
Vijayaraghavan KWhat would be the possible causes for this.OLEDB?
Did you post the entire error message or did you just cut out the ORA-01460 part?
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:481421535472#72682112997104
Maybe you are looking for
-
Easy JNDI + Connection Pool Question
This is an easy question: Once I get the object represented by my connection pool from the Weblogic JNDI tree, how do I get a connection from the returned object of type weblogic.common.internal.ResourceAllocator? I keep getting ClassCastExceptions.
-
SSRS report with PowerPivot datasource - 401 Unauthorized
Hello together, I have a tricky issue and hope that you can help me: Problem: I want to build a Reporting Services Report with a PowerPivot datasource with Report Builder 3.0. When I try to access the datasource via Report Builder I get the error: Th
-
Is it ok? if we have 42 million records in a single fact table!!
Hello, We have three outstanding fact tables, and we need to add one more fact type, and we were thinking whether we can do two different fact tables, or can we put the values in one of the same fact table which is similar, but the records are upto 4
-
I created a form, how do I save it?
I created a form, how do I save it?
-
Hi all, Can any one give me the detailed and separate blogs for context handling, value mapping, user defined functions, and multi mapping. Thanks in Advance