Insert floats fail...
Hi!
I create a table like:
create table tab(column1 number(8,2));
When I intended to insert values with:
insert into tab values (3.2);
However, I have a error:
OCA-30021: error preparing/executing SQL statement
[POL-2404] invalid characters specified for cast conversion
This is on SQL*Plus in Windows 98 Second Edition.
How can I insert this values?
Would somebody helpme?
Thanks in advance.
A-ha!
I suspect (as Joachim does) that you have a character set problem:
For example, in the UK and US "3,5" means "three,five", whereas mainland Europeans would read "three and a half".
null
Similar Messages
-
Why has CAST(FieldName to float) failed in view but not in SELECT?
I've just solved a problem but I'm still not sure what the problem is!
I have a data (staging) table with all values stored as text. The data is converted to the correct data-type and also aggregated somewhat in a view. A select statement with the conversion works. A select statement with the conversion and aggregation (GROUP
BY) works. Creating a view of the conversion and aggregation works. However, on selecting from the view (e.g. SELECT TOP 1000 * FROM ViewName) it fails saying it cannot convert from varchar to float. There are no visible characters in the field apart from
numbers between 0 and 9, a decimal point and sometimes a leading minus sign (-).
The fix? Cast to money and then cast to float.
The problem? I don't know! What was the problem? Some of the values had up to 10 decimal places. Was that a problem? Was it really an overflow error masquerading as conversion error? The longest strings present were:
-2.609763091
-0.082456066
-0.674010546
-2.563428427
-0.016109637
-0.313600766
-0.104452264
-0.853811384
-0.302529502
-0.000362354
-0.002961949
-0.319269185
-0.001970796
Would really like to know what caused this so I can spot it in future before it happens.
Cheers.
JCEHOne possibility is that the two execution plans are different. The logical order of the way SQL processes the clauses a SELECT query is FROM, ON, OUTER, WHERE, GROUP BY, CUBE | ROLLUP, HAVING, SELECT, DISTINCT, ORDER BY, TOP. (Actually that's
what I learned, now there are some additional things like APPLY, but for our purposes we can ignore them). The important thing to know is that that is the LOGICAL order, but SQL is allowed (and often does) go change that order to anything it wants as
long as it returns the correct result.
So, for example, if your FROM clause a number of rows and some of those rows contain data which would cause a CAST (or anything else) in the SELECT clause to fail, but those rows are eliminated by your WHERE clause. Then SQL could do
FROM, WHERE, SELECT and the query works, or
FROM, SELECT, WHERE and the query fails. And, in general, you cannot control which plan SQL will use.
So, for example, if you have a table named T with two integer columns I and J and some rows in the table have a value of 0 in the column J and you run
SELECT I/J FROM T WHERE J<>0
it might work and you might get a divide by zero error. So one safe way to handle this is to write your query as
SELECT I/(CASE WHEN J <> 0 THEN J ELSE NULL END) WHERE J<>0
Another way would be to create a temp table and write an insert statement that inserted into that temp table only the rows where J<>0 and then do the query from the temp table. Since that is two SQL commands, SQL is forced to do them in order,
it cannot combine them and reorder the processing, that would look like
Create Table #T(I int, J int);
Insert Table #T(I, J)
Select I, J FROM T WHERE J<>0;
Select I/J From #T;
Drop Table #T;
You could try doing the equivalent of one of those to your query and see if that makes the problem go away.
Now I know you are going to ask "Why did the view use to work and it doesn't anymore?" and "Why does using the view and the table return different results". My guess is that you are getting different plans for the view and the table,
why that is, I don't know, it is often difficult to answer that type of question. My best guess for why the view used to work, then you ALTERED it, and then changed it back to the original form and it fails even though it is exactly the same as the old
view that was working is, when you had the old view, then was a cached execution plan that was working. That execution plan might have been created a good while ago. When you ALTERED it, you, of course, got a new plan. Then when you ALTERED
it back to the original form, it no longer had the plan it had been using, so had to create a new one, and this new plan was different than the old one.
Finally, if this is the cause of your problem, then you are not guaranteed that the convert to money, then to float is a permanent fix. If you have column headers which cannot be converted to either money or float, then it could be the convert to money
then to float is enough to get SQL to do the WHERE first, then the SELECT. But there is no guarantee that will be true forever. Changes in your data distribution and release level of SQL might make that version do the select first and then the
where.
Tom -
Insert float value into ms sql server
Hi.
How do I insert a float value into my ms sql db.
The Code:
select.setFloat( 4, theForm.getVaerdi() );ERROR:
"MakeClapetInsertAction.java": Error #: 300 : method setFloat(int, java.lang.Float) not found in interface java.sql.PreparedStatement at line 89, column 12setFloat takes a float primitive, not a Float object.
select.setFloat( 4, theForm.getVaerdi().floatValue() ); -
I have a form to update a table. I want to insert almost same values to another table at the same time. I wrote a process whose process point is on "Apply Changes" button. The source of process is as follows:
BEGIN
INSERT INTO ACTIVATION_PLAN_DETAIL
(AP_NO, MOBILENO, NUMBER_TYPE, ISSUEDTO, IMSI, CITY, PRIORITY)
values( :P2_AP_STATUS,:P2_MOBILENO,:P2_NUMBER_TYPE,:P2_ISSUETO,GET_IMSI_PREPAID(:P2_MOBILENO),:P2_CITY, :P2_PRIORITY);
END;
Update gets successful but insert fails and gives the error that cannot insert null into ap_no column. The field :Ap_NO is "Select List" and I know that it may be because of it is web rather than Oracle Forms where it was successful. Any solutions to this??????When you Edit your Page Process there is one part on that page called "Messages". There you can enter a "Process Success Message" and a "Process Error Message". If something goes wrong you can use the last one to show the (current) values, using the &fieldname. notation.
In your statement
BEGIN
INSERT INTO ACTIVATION_PLAN_DETAIL
(AP_NO, MOBILENO, NUMBER_TYPE, ISSUEDTO, IMSI, CITY, PRIORITY)
values( :P2_AP_STATUS,:P2_MOBILENO,:P2_NUMBER_TYPE,:P2_ISSUETO,GET_IMSI_PREPAID(:P2_MOBILENO),:P2_CITY, :P2_PRIORITY);
END;You are trying to insert the value of P2_AP_STATUS into the column AP_NO. AP_NO seems to be NULL, so I would like to see the value of P2_AP_STATUS... (or is that the wrong field....) -
Insert / delete fails on unique constraint (order problem)
Hi dear Kodo team,
within a transaction, we are deleting a certain jdo object. The deletion is
undone later (within the same tx), resulting in creating a new object with
the same contents as the deleted one (gets another oid, of course). In our
database, there is a unique constraint on two mapped fields of this object.
Unfortunately, kodo issues the INSERT statement before the DELETE
statement, thus producing a unique constraint violation.
Is there a way to influence the statement order? Is there any solution other
than disabling / deferring this constraint?
Thanks in advance,
ContusBeside Oracle, we are using our db schema on db platforms that do not
support deferred constraints. That's why we would like to know if there is
a way to influence statement order without removing those constraints.
Thanks,
Contus
Alex Roytman wrote:
In general the best option is to use deferred constraints on all your FK
and unique constraints. You still get complete referential integrity but
do not need Kodo to order your statements for you. If you are already
doing it but still get this error message and you are using Oracle 9.2 it
seems to be a bug in oracle JDBC. I submitted it to oracle - they accepted
it and supposedly working on resolution
"contus" <[email protected]> wrote in message
news:bulku6$qad$[email protected]..
Hi dear Kodo team,
within a transaction, we are deleting a certain jdo object. The deletionis
undone later (within the same tx), resulting in creating a new object
with the same contents as the deleted one (gets another oid, of course).
In our database, there is a unique constraint on two mapped fields of
thisobject.
Unfortunately, kodo issues the INSERT statement before the DELETE
statement, thus producing a unique constraint violation.
Is there a way to influence the statement order? Is there any solutionother
than disabling / deferring this constraint?
Thanks in advance,
Contus -
Hi,
Im using Oracle database 10g. Im in chap04 p.107. Im trying to insert a new row to the parts table. Here are the following statements and the result.
DECLARE
l_newId INTEGER := 6;
l_newDesc VARCHAR2(250) := 'Mouse';
BEGIN
INSERT INTO parts
(id, description, unitprice, onhand, reorder)
VALUES ( l_newId, l_newDesc, 49, 1200, 500);
END;
Results Explain Describe Saved SQL History
1 row(s) inserted.
0.32 seconds
It says there that I was able to insert one row but when I tried to check it, its not there in the parts table. Here is my query and the result.
select * from parts;
ID DESCRIPTION UNITPRICE ONHAND REORDER
1 Fax Machine 299 277 50
2 Copy Machine 4895 143 25
3 Laptop PC 2100 7631 1000
4 Desktop PC 1200 5903 1000
5 Scanner 99 490 200
5 rows returned in 0.07 seconds
The new inserted row is still not in the table.
What do I do to really insert this newId in the parts table? I need some help pls. I will be patiently waiting for some answers. Thank you very much.
lynHi,
Thank you so much for your reply. Its working right now.
Happy New year. Thank you once again.
Godbless,
lyn -
ProC cannot insert float/double C datatype
Hallo,
we compiled our C-Programms which we developed on SCO OpenServer
with the ProC on Linux.
Like on SCO we use the LANG enviroment variable de_DE for
german national language support. If we try now this C-Code:
setlocale(LC_ALL, "");
double x = 2.34;
EXEC SQL INSERT INTO anytable VALUES (:x);
EXEC SQL COMMIT;
(The table anytable has one column with number(10,4) )
The result is that the value in table is only 2 instead of
2,34 (german decimal separator is ,).
If we try setlocale(LC_ALL, "C") the value in the table is
correct 2,34.
But we have to use the german national language
support with setlocale(LC_ALL, "") for other purposes.
So is it a bug or did we miss something.
(On SCO it works with setlocale(LC_ALL, "");)
Thanks !
Reinhold Berger
nulli think you need to debug your code, lookalike the values you trying insert already exist in the database.
these two IDs (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6).
i would try to run the select command against the content db.
SELECT TOP * FROM [DB Name].[dbo].[NavNodes] where id = '6323df8a-5c57-4d3e-a477-09aa8b66100a'
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
Float truncated when inserted into table
Hi,
I'm trying to insert float values into a table with a column of type NUMBER(4,2) and the values are getting truncated to integer values. My environment is :
Database: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
jdbc lib: 9.0.1.4
I tried it with the jdbc lib version 9.0.1 and it works, but I didn't figure a way to use it, since I'm using it in a 9iAS environment and there's no driver classes12dms.jar for this version. If I try to use the classes12.zip version I get an exception when trying to access the database complaining about some classes missing (These classes missing are in the classes12dms.jar)
Here's a simple test case:
import java.sql.*;
public class TesteFloat {
public TesteFloat() {
public static void main(String[] args) {
Connection con = null;
PreparedStatement stmt = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:hal9000","kitbordo","kitbordo");
stmt = con.prepareStatement("insert into teste (teste) values (?)");
for (int i = 0; i < 10; i++) {
stmt.setFloat(1,2.32f * i );
//stmt.addBatch();
stmt.executeUpdate();
//stmt.executeBatch();
con.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e) {
CREATE TABLE TESTE
TESTE NUMBER(4,2)
)Hi,
I'm trying to insert float values into a table with a column of type NUMBER(4,2) and the values are getting truncated to integer values. My environment is :
Database: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
jdbc lib: 9.0.1.4
I tried it with the jdbc lib version 9.0.1 and it works, but I didn't figure a way to use it, since I'm using it in a 9iAS environment and there's no driver classes12dms.jar for this version. If I try to use the classes12.zip version I get an exception when trying to access the database complaining about some classes missing (These classes missing are in the classes12dms.jar)
Here's a simple test case:
import java.sql.*;
public class TesteFloat {
public TesteFloat() {
public static void main(String[] args) {
Connection con = null;
PreparedStatement stmt = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:hal9000","kitbordo","kitbordo");
stmt = con.prepareStatement("insert into teste (teste) values (?)");
for (int i = 0; i < 10; i++) {
stmt.setFloat(1,2.32f * i );
//stmt.addBatch();
stmt.executeUpdate();
//stmt.executeBatch();
con.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e) {
CREATE TABLE TESTE
TESTE NUMBER(4,2)
) -
Sql insert statement will fail if the data value has empty line
Hi,
I notice if the insert statement in my .sql file contains data that has new line (enter key), the insert will fail.
For example:
insert into mytable (message)
values ('this is the first line
this is the second line that will cause insert statement to fail
so as this third line');
commit;
How to overcome this?
Please advise.
Thank you.
Message was edited by:
bchurn
Message was edited by:
bchurnIt did not return me any error. What is the error you are receiving ??
SQL> create table mytable (message varchar2(500));
Table created.
SQL> insert into mytable (message)
2 values ('this is the first line
3 this is the second line that will cause insert statement to fail
4 so as this third line');
1 row created.
SQL> @c:\test.txt
1 row created.contents of c:\test.txt
<<
insert into mytable (message)
values ('this is the first line
this is the second line that will cause insert statement to fail
so as this third line');
>> -
Russian characterset insert fails..Request for guidance.
Guys,
I've been trying to insert the Russian character string "СТАВРОПОЛЬСКИЙ КР" into my database object-column defined as VARCHAR (25) -using GUI.
The insert is failing, it doesn't give information about the cause of the failure though.
Could somone guide me...Could it be becaz of the lenght of the string exceeding 25 characters?
Is there a way that I can get the lenght of the string. Please note, it's Russian character string.
Thank you All!!!
-BhagatRussian characters will be displayed as inverted questions "¿¿¿¿¿ ¿¿¿¿¿¿" in toad.
So the query won't help determining the lenght of the string.
-Bhagat -
DBAdapter insert failing in Fusion Middleware SOA Suite 11g
Hi,
I am trying a simple example of inserting into database using DBAdapter. Here is the log message and am unable to figure out the problem it says log at DBAdapter logs can someone tell me where does DBAdapter logs exists. I tried the select and it works fine some how insert is failing.
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [InsertNewEmployee.Emp].
Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [InsertNewEmployee.Emp].
Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
at oracle.integration.platform.blocks.adapter.fw.jca.cci.EndpointInteractionException.getFabricInvocationException(EndpointInteractionException.java:75)
at oracle.integration.platform.blocks.adapter.AdapterReference.getFabricInvocationException(AdapterReference.java:287)
at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:273)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:194)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:204)
at sun.reflect.GeneratedMethodAccessor771.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy210.post(Unknown Source)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post2Mesh(MediatorServiceEngine.java:871)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:200)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:94)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:74)
at oracle.tip.mediator.service.OneWayActionHandler.process(OneWayActionHandler.java:47)
at oracle.tip.mediator.service.ActionProcessor.onMessage(ActionProcessor.java:64)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase(MessageDispatcher.java:121)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase(InitialMessageDispatcher.java:467)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:366)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:272)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch(InitialMessageDispatcher.java:138)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:656)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post(MediatorServiceEngine.java:482)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:194)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:204)
at sun.reflect.GeneratedMethodAccessor771.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy210.post(Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage(AdapterServiceMDB.java:511)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:376)
at oracle.tip.adapter.file.inbound.Publisher.publishMessage(Publisher.java:377)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.xlate(InboundTranslatorDelegate.java:455)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.doXlate(InboundTranslatorDelegate.java:116)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.doXlate(ProcessorDelegate.java:252)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:157)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:77)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:171)
at java.lang.Thread.run(Thread.java:619)
Caused by: BINDING.JCA-12563
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [InsertNewEmployee.Emp].
Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:427)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:510)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:494)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:463)
at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:236)
... 50 more
Caused by: BINDING.JCA-11616
DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [InsertNewEmployee.Emp].
Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered retriable, likely due to a communication failure. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers.
at oracle.tip.adapter.db.exceptions.DBResourceException.createRetriableException(DBResourceException.java:641)
at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:610)
at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:661)
at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:255)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:310)
... 54 more
Caused by: java.sql.SQLException: Cannot call rollback when using distributed transactions
at weblogic.jdbc.wrapper.JTAConnection.rollback(JTAConnection.java:379)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicRollbackTransaction(DatabaseAccessor.java:1410)
at oracle.toplink.internal.databaseaccess.DatasourceAccessor.rollbackTransaction(DatasourceAccessor.java:581)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.rollbackTransaction(DatabaseAccessor.java:1401)
at oracle.toplink.internal.sessions.AbstractSession.basicRollbackTransaction(AbstractSession.java:369)
at oracle.toplink.threetier.ClientSession.basicRollbackTransaction(ClientSession.java:135)
at oracle.toplink.internal.sessions.AbstractSession.rollbackTransaction(AbstractSession.java:3003)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.rollbackTransaction(UnitOfWorkImpl.java:4405)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.rollbackTransaction(UnitOfWorkImpl.java:4426)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1374)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1417)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitRootUnitOfWork(UnitOfWorkImpl.java:1167)
at oracle.toplink.internal.sessions.UnitOfWorkImpl.commit(UnitOfWorkImpl.java:939)
at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:203)
... 55 moreThanksCHeck this thread:
BINDING.JCA-12510 JCA Resource Adapter location error in SOA 11g Suite
Did you have set the correct parameters to the DBAdpater; it look lik it can not bind the parameters (BINDING JCA-12563).
Marc -
Insert statement in when-checkbox-checked trigger doesn't work
in a when-checkbox-checked trigger, I wrote the follwing code :
IF :sunday = 'Y' THEN
msg_alert('Y','I',false);
pkg_var.v_day_count := pkg_var.v_day_count + 1;
msg_alert('1','I',false);
:schtm_skmk.day_id := '1';
msg_alert('2 ',I',false);
INSERT INTO schtm
(ROUTE_ID, DAY_ID, FLIGHT_ID)
VALUES
(:schmf.ROUTE_ID, :schtm_skmk.day_id, 1);
COMMIT;
msg_alert('end insert schtm','I',false);
END IF;
if the checkbox is checked, I assigned value '1' to day_id. Then, I want to insert a row into table SCHTM. But, the insert statement fail. The msg_alert '2' pop up. The msg_alert 'end insert schtm' does not pop up, meaning the insert statement fail. It also fail after I replace the insert statement with the exact value of the item. But if I execute this statement in SQL plus, it insert a row into the database.
What is strange here is it did work before, I successfully insert 2 rows into database. But when I test it again just a while later, it never work anymore.
Please help.
Thanks,
Shu WenIt seems that you have missed ELSE. By the way there is only one INSERT ...
-
Problems with inserting elements into vectors
Hi,
I have a problem with the setElementAt() method for vectors.
I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
The code below is a for loop to do just this where count is the size of the previous vector.
for(int i=0;i<count; i++)
vLargest.setElementAt(zero,i);
}i have declared zero as a float
float zero = 0.0f;
the error that i'm getting is that it that the vector cannot be applied to a float.
Can anybody tell me what i'm doing wrong?
ThanksYes you need to store Objects in your Vector not primitives.
float is not an Object it is a primitive. But Float is an object. -
JDBC insert single quote ???
Hi,
I want to insert a string which could contain a single quote ( ' ) into my database . But if this is the case, the regular insert command fails, since the single quote from the string collides with the ones from the command. What can I do???Try placing an escape char "\".
So its like:
String s="Sachin\'s page";
If ur using it in xml use:
' to replace '.
Hope this helps.
Sachin -
Error while inserting data in Forms10G using TEXT_IO
Dear all i am using 10g Forms.
I am using Text_io to read the text file and putting into table and again reading the tables and putting into another text file .
I was testing in 3 tables which is the same copy of the original table but only the name is different .
But after testing when i change the table name to Original table name , it is not inserting for 1 table .
What could be the reason ?
I already check the columns and all , everything is current .
Edited by: Sandy on Sep 14, 2010 5:39 PMPlease use tags when posting your code over here and format it proper so others can read it more easily.
e.g.
[code]
procedure my_proc is
num_data number;
begin
select 1
into num_data
from dual;
if num_data = 2 then
end;
[/code]
Are you sure you are getting here:
[code]
INSERT INTO MU_PAY_OLB(RECORD_TYPE,LOAD_NO,TRAN_AMT,OLB_CODE,ACCT_NO,BEN_NAME,PAY_DTL,MACCS_IND)
VALUES(lval,l_val,DTL_AMT,lbank,DTL_BEN_AC_NO,DTL_BEN_NM,Null,'N');
[/code]
Also: only trap the exceptions you expect, and not ALL exceptions e.g.
[code]
begin
INSERT INTO MU_PAY_OLB(RECORD_TYPE,LOAD_NO,TRAN_AMT,OLB_CODE,ACCT_NO,BEN_NAME,PAY_DTL,MACCS_IND)
VALUES(lval,l_val,DTL_AMT,lbank,DTL_BEN_AC_NO,DTL_BEN_NM,Null,'N');
exception
when dup_val_on_index then
--do whatever you need to do in that case
end;
[/code]
Maybe your tablespace is full and thus your insert statement fails? You need to inform the user so he/she can inform the DBA.
and at last this one:
[code]
WHEN Others THEN
Text_IO.Fclose(in_file);
END;
[/code]
You are hiding all possible exceptions; it might be a numeric or value error as the line you are reading is longer then your line buffer, or $add_any_possible_exception_here. You only close the file and behave like nothing ever happened. If you need to close your text file in any case it should look like this:
[code]
exception
when others then
if text_io.is_open(in_file) then
text_io.fclose(in_file);
end if;
raise;
end;
[/code]
By that you are closing the file if necessary (the exception might occur after you closed the file and closing it again will cause another exception), and reraise your exception so it can be processed by the higher element in the call stack; maybe your calling procedure expects some exceptions in your procedure too and handles them respectively. If no one in the call stack expects the exception and traps it, it finds it's way to the end user (who is you in that case). If it throws an exception take a look where it happens and take actions.
So remove your when others exceptions and look if some other exceptions occur. By now there might occur an exceptions but as you are hiding them all we and you have no clue about if, when, why and where it happens. Remove / replace the exception handlers as shown and you should get a clue about if, when, why and where.
cheers
Maybe you are looking for
-
I have a water damaged iphone 5c. I was thinking about taking it to the Apple store and paying the 269 dollar service charge for them to attempt to fix it. My question is: If they can't fix it, will they replace my phone for that $269 dollars, or wil
-
Profti Center Determination for Non Leading Ledger
Hi, We are on ECC6, EHP4. We have activated non leadgin ledger and I am facing issue in asset accounting transaction type for Write up, I have created for Non leading ledger (IFRS) . Following is the issue. I have created the transaction type "Z71"
-
Iam trying to install my Photoshop CS4 onto my new iMac that I used on an older Macbook Pro that no longer works but when I try to install it I get an error code 6. Any help is greatly appreciated.
-
Hi I need some clarification in below scenario, In table MBEWH, value and moving average price is 0 for all periods except last period. For eg; Period Stock Value MAP 1 100 0 0 2 90
-
What programs used to create this site??
Hey there, I stumbled across this flash site and was wondering if any of you had any ideas which programs would have been used to create this site. Obviously flash for one, but would they be importing rendered clips from say 3ds max? or perhaps swift