OpenSQLException - Cannot assign double value
Hello,
I have some table in database with field of type 'double'. I use JDBC to store data in this table and sometimes I would like to place special values in it, eg:
preparedStatement.setDouble(1, Double.MIN_VALUE);
Unfortunately I get exception like the one below.
My question is: what is the allowed range of values for type 'double' in database according to OpenSQL spec ?
Thanks!
Marcin Zduniak
com.sap.sql.log.OpenSQLException: Cannot assign double value 4.9E-324 to host variable 3 because it is not in the allowed range of +/- to +/-.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setDouble(CommonPreparedStatement.java:534)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setDouble(PreparedStatementWrapper.java:281)
at pl.com.bcc.hai.SpecificationBean0Persistent.ejb_iUpdate(SpecificationBean0Persistent.java:558)
... 42 more
Full exception chain:
com.sap.engine.services.ejb.exceptions.BaseEJBException: Transaction system failure in method pl.com.bcc.hai.SpecificationLocalLocalObjectImpl0.setTargetValue(java.lang.Double).
at pl.com.bcc.hai.SpecificationLocalLocalObjectImpl0.setTargetValue(SpecificationLocalLocalObjectImpl0.java:4537)
at pl.com.bcc.hai.conf.BCC_H_CConfig.setSTimeSeriesesAIM(BCC_H_CConfig.java:4129)
at pl.com.bcc.hai.conf.wdp.InternalBCC_H_CConfig.setSTimeSeriesesAIM(InternalBCC_H_CConfig.java:1038)
at pl.com.bcc.hai.conf.wdp.IPublicBCC_H_CConfig$ISTimeSeriesesElement.setAIM(IPublicBCC_H_CConfig.java:3651)
at pl.com.bcc.hai.conf.wdp.IPublicBCC_H_CConfig$ISTimeSeriesesElement.wdSetObject(IPublicBCC_H_CConfig.java:3786)
at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.wdSetObject(MappedNodeElement.java:365)
at pl.com.bcc.hai.conf.wdp.IPrivateSpecificationEditor$ISTimeSeriesesElement.wdSetObject(IPrivateSpecificationEditor.java:1737)
at com.sap.tc.webdynpro.progmodel.context.AttributePointer.setObject(AttributePointer.java:223)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.transportPendingUserInput(DataContainer.java:1267)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.transportPendingUserInput(DataContainer.java:474)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.transport(ClientComponent.java:548)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.transport(ClientComponent.java:552)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.transport(ClientApplication.java:701)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.transportData(WebDynproMainTask.java:717)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [1a55ffffffb01205ffffffd4ffffffdd] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:232)
at pl.com.bcc.hai.SpecificationLocalLocalObjectImpl0.setTargetValue(SpecificationLocalLocalObjectImpl0.java:4486)
... 35 more
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is pl.com.bcc.hai.SpecificationBean0Persistent.
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:220)
... 36 more
Caused by: com.sap.sql.log.OpenSQLException: Cannot assign double value 4.9E-324 to host variable 3 because it is not in the allowed range of +/- to +/-.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setDouble(CommonPreparedStatement.java:534)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setDouble(PreparedStatementWrapper.java:281)
at pl.com.bcc.hai.SpecificationBean0Persistent.ejb_iUpdate(SpecificationBean0Persistent.java:558)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:80)
... 41 more
com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [1a55ffffffb01205ffffffd4ffffffdd] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:232)
at pl.com.bcc.hai.SpecificationLocalLocalObjectImpl0.setTargetValue(SpecificationLocalLocalObjectImpl0.java:4486)
at pl.com.bcc.hai.conf.BCC_H_CConfig.setSTimeSeriesesAIM(BCC_H_CConfig.java:4129)
at pl.com.bcc.hai.conf.wdp.InternalBCC_H_CConfig.setSTimeSeriesesAIM(InternalBCC_H_CConfig.java:1038)
at pl.com.bcc.hai.conf.wdp.IPublicBCC_H_CConfig$ISTimeSeriesesElement.setAIM(IPublicBCC_H_CConfig.java:3651)
at pl.com.bcc.hai.conf.wdp.IPublicBCC_H_CConfig$ISTimeSeriesesElement.wdSetObject(IPublicBCC_H_CConfig.java:3786)
at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.wdSetObject(MappedNodeElement.java:365)
at pl.com.bcc.hai.conf.wdp.IPrivateSpecificationEditor$ISTimeSeriesesElement.wdSetObject(IPrivateSpecificationEditor.java:1737)
at com.sap.tc.webdynpro.progmodel.context.AttributePointer.setObject(AttributePointer.java:223)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.transportPendingUserInput(DataContainer.java:1267)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.transportPendingUserInput(DataContainer.java:474)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.transport(ClientComponent.java:548)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.transport(ClientComponent.java:552)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.transport(ClientApplication.java:701)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.transportData(WebDynproMainTask.java:717)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is pl.com.bcc.hai.SpecificationBean0Persistent.
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:220)
... 36 more
Caused by: com.sap.sql.log.OpenSQLException: Cannot assign double value 4.9E-324 to host variable 3 because it is not in the allowed range of +/- to +/-.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setDouble(CommonPreparedStatement.java:534)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setDouble(PreparedStatementWrapper.java:281)
at pl.com.bcc.hai.SpecificationBean0Persistent.ejb_iUpdate(SpecificationBean0Persistent.java:558)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:80)
... 41 more
Hi,
Thank you for your replay. I didn't touch DB directly, I defined db structure through NetWeaver Dictionary perspective and table that i'm interested in is defined like the one on this screen: http://zduniak.com/tmp/sap_dictionary_double.png
So I'm looking for generic solution (SAP OpenSQL), not specific to any particular DB vendor.
Maybe there is somewhere on help.sap.com (i couldn't find unfortunately) information what is the allowed range of values for type 'double' in database according to OpenSQL spec ?
Thank,
Marcin Zduniak
Similar Messages
-
OpenSQLException caught: Cannot assign a blank-padded string
Hi,
sometimes I get this exception, when updating a bo instance.
I didn't managed it to reproduce the error, because it is thrown in a complex background job.
Can anybody give me more information about the reason behind this?
Thanks,
Jens
stacktrace:
com.sap.sql.log.OpenSQLException: Cannot assign a blank-padded string to host variable 13.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:95)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:188)
at com.sap.sql.jdbc.common.dispatch.VarcharHostVariable.setString(VarcharHostVariable.java:34)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:626)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:380)
at com.sap.engine.services.orpersistence.jdbcaccess.StringBinder.setValue(StringBinder.java:33)
at com.sap.engine.services.orpersistence.core.StoreManager.bindParameterValues(StoreManager.java:387)
at com.sap.engine.services.orpersistence.core.StoreManager.executeStatement(StoreManager.java:652)
at com.sap.engine.services.orpersistence.core.StoreManager.updateEntity(StoreManager.java:625)
at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.flush(PersistenceContextImpl.java:300)
at com.sap.engine.services.orpersistence.entitymanager.EntityManagerImpl.flush(EntityManagerImpl.java:121)
at com.sap.engine.services.orpersistence.entitymanager.EntityManagerHandleImpl.flush(EntityManagerHandleImpl.java:50)
at com.sap.engine.services.orpersistence.container.EntityManagerProxy.flush(EntityManagerProxy.java:105)
at com.sap.caf.rt.bol.da.jpa.JPADataAccessService.store(JPADataAccessService.java:495)
at com.sap.caf.rt.bol.da.jpa.JPADataAccessService.store(JPADataAccessService.java:483)
at com.siemens.sm3k.mntstrat.modeled.bonode.functionfailure.functionfailure.FunctionFailureBean.update(FunctionFailureBean.java:137)Hi,
I got the same exception with the following code:
stringVarible="someString"+someMethod.getValue();
here getValue returns String.But sometimes it may return null valu also.when it returns null value,the same SQL Exception will occure becuse we are trying to save a string in SQL which is blank padded.
I think your code is also having the similar problem.
Sampath -
Management Report - Cannot assign an empty string to host variable 10
We ran a Management Report for the first time after completing the User/Role/Profile Full Sync and the user/Role/Profile Batch Risk Analysis. The job failed with the following error:
Oct 16, 2008 12:13:29 PM com.virsa.cc.xsys.bg.BatchRiskAnalysis runBkgMgmReport
WARNING: Exception in Management Report Job: Cannot assign an empty string to host variable 10.
com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 10.
We are on GRC 5.3 support pack 4. Has anybody encountered this error? What does host variable 10 refer to?I checked our USOBT_C table and we have a lot of empty values. If this is allowed to be empty in SAP and this is the table that is uploaded into CC, why would all the fields in CC tables then be defined as NOT NULL? We suspect that since we had uploaded USOBT_C under 5.2 and if this had been an issue before, it may have been corrected when we upgraded to 5.3 but then the old data is still in our system. Is there an easy way to get around or correct this?
Thanks. -
Good day Kiran Kandepalli and Others.
I have successfully executed the background jobs -
Full User, Role, Profile Synchronization & a
Full Batch Risk Analysis
When I run the Management Reports I receive the following error -
Error while executing the Job:Cannot assign an empty string to host variable 10.
Has anybody had this error message before?
When I check table VIRSA_CC_PRMVL, variable 10 is set to No in Nullable collumn.Hi Sahad,
Thanks for your response. I have checked the usr02 table and logs and do not see any empty fields or strings. This process worked for 5.2 but fails in 5.3. Here is the excerpt from the log for the Management Report run. It seems to fail consistenly at a certain point. If I knew what the batch job was looking for in host variable 10 I might be able to resolve the problem. It seems to fail when it starts to report on users.
Thanks.
Dan.
INFO: -
Scheduling Job =>935----
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BgJob run
INFO: --- Starting Job ID:935 (RISK_ANALYSIS_BATCH) - tst
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BgJob setStatus
INFO: Job ID: 935 Status: Running
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BgJob findJobHistory
FINEST: --- @@@@@@@@@@@ Find the Job History -
1
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BgJob updateJobHistory
FINEST: --- @@@@@@@@@@@ Updating the Job History -
1@@Msg is tst started :threadid: 0
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.dao.BgJobHistoryDAO insert
INFO: -
Background Job History: job id=935, status=1, message=tst started :threadid: 0
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BatchRiskAnalysis performBatchSyncAndAnalysis
INFO: --- Batch Sync/Analysis/Mgmt Report started ---
Jan 23, 2009 8:04:16 AM com.virsa.cc.xsys.bg.BatchRiskAnalysis runBkgMgmReport
INFO: --- Running the Background Management Report -
Jan 23, 2009 8:04:39 AM com.virsa.cc.xsys.mgmbground.dao.MgmStats execute
INFO: Start insert int cc_mgriskd all violations.... 1232726679108
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.bg.BatchRiskAnalysis runBkgMgmReport
WARNING: Exception in Management Report Job: Cannot assign an empty string to host variable 10.
com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 10.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.types.VarcharResultColumn.setString(VarcharResultColumn.java:57)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:511)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:355)
at com.virsa.cc.xsys.mgmbground.dao.MgmStats.execute(MgmStats.java:314)
at com.virsa.cc.xsys.bg.BatchRiskAnalysis.runBkgMgmReport(BatchRiskAnalysis.java:1182)
at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchSyncAndAnalysis(BatchRiskAnalysis.java:1430)
at com.virsa.cc.xsys.bg.BgJob.runJob(BgJob.java:402)
at com.virsa.cc.xsys.bg.BgJob.run(BgJob.java:264)
at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.scheduleJob(AnalysisDaemonBgJob.java:240)
at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.start(AnalysisDaemonBgJob.java:80)
at com.virsa.cc.comp.BgJobInvokerView.wdDoModifyView(BgJobInvokerView.java:436)
at com.virsa.cc.comp.wdp.InternalBgJobInvokerView.wdDoModifyView(InternalBgJobInvokerView.java:1225)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.bg.BgJob run
WARNING: *** Job Exception: Cannot assign an empty string to host variable 10.
com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 10.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.types.VarcharResultColumn.setString(VarcharResultColumn.java:57)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:511)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:355)
at com.virsa.cc.xsys.mgmbground.dao.MgmStats.execute(MgmStats.java:314)
at com.virsa.cc.xsys.bg.BatchRiskAnalysis.runBkgMgmReport(BatchRiskAnalysis.java:1182)
at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchSyncAndAnalysis(BatchRiskAnalysis.java:1430)
at com.virsa.cc.xsys.bg.BgJob.runJob(BgJob.java:402)
at com.virsa.cc.xsys.bg.BgJob.run(BgJob.java:264)
at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.scheduleJob(AnalysisDaemonBgJob.java:240)
at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.start(AnalysisDaemonBgJob.java:80)
at com.virsa.cc.comp.BgJobInvokerView.wdDoModifyView(BgJobInvokerView.java:436)
at com.virsa.cc.comp.wdp.InternalBgJobInvokerView.wdDoModifyView(InternalBgJobInvokerView.java:1225)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.bg.BgJob setStatus
INFO: Job ID: 935 Status: Error
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.bg.BgJob updateJobHistory
FINEST: --- @@@@@@@@@@@ Updating the Job History -
2@@Msg is Error while executing the Job:Cannot assign an empty string to host variable 10.
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.bg.dao.BgJobHistoryDAO insert
INFO: -
Background Job History: job id=935, status=2, message=Error while executing the Job:Cannot assign an empty string to host variable 10.
Jan 23, 2009 8:04:49 AM com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob scheduleJob
INFO: -
Complted Job =>935---- -
Cannot assign an empty string to host variable 1
Guys,
I am getting the following problem while trying to create an entity bean., cmp field is not blank string yet I am getting the error. can you please help out?
_33##0#0#Info##Plain###Remote Exception in Create: CreateA2iLogin: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method a2i.beans.login.LoginHomeImpl0.create(java.lang.String).
at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:408)
at a2i.beans.login.LoginHome_Stub.create(LoginHome_Stub.java:56)
at com.nibco.a2i.beans.A2iLogin.createA2iLogin(A2iLogin.java:118)
at com.nibco.a2i.beans.A2iLogin.<init>(A2iLogin.java:38)
at com.nibco.training.servlet.SayHelloServlet.doPost(SayHelloServlet.java:121)
at com.nibco.training.servlet.SayHelloServlet.doGet(SayHelloServlet.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
Caused by: com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().
at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:118)
at com.sap.engine.services.ejb.entity.ContextFP.store0(ContextFP.java:103)
at com.sap.engine.services.ejb.entity.Context.passivate(Context.java:235)
at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:401)
... 21 more
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is a2i.beans.login.LoginBean0Persistent.
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.finishWork(TransactionContext.java:454)
at a2i.beans.login.LoginBean0PM.ejbStore(LoginBean0PM.java:184)
at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:115)
... 24 more
Caused by: com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 1.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:584)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:341)
at a2i.beans.login.LoginBean0Persistent.ejb_iInsert(LoginBean0Persistent.java:335)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
... 29 more
; nested exception is:
com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().#
#1.5#001143A7AF4000680000005900000F4C00040C3E95D97A60#1139362848402#System.out#sap.com/A2IEARCURR#System.out#Guest#0####edec5450984311da917b001143a7af40#SAPEngine_Application_Thread[impl:3]_33##0#0#Info##Plain###Success 2#Guys,
I am getting the following problem while trying to create an entity bean., cmp field is not blank string yet I am getting the error. can you please help out?
_33##0#0#Info##Plain###Remote Exception in Create: CreateA2iLogin: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method a2i.beans.login.LoginHomeImpl0.create(java.lang.String).
at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:408)
at a2i.beans.login.LoginHome_Stub.create(LoginHome_Stub.java:56)
at com.nibco.a2i.beans.A2iLogin.createA2iLogin(A2iLogin.java:118)
at com.nibco.a2i.beans.A2iLogin.<init>(A2iLogin.java:38)
at com.nibco.training.servlet.SayHelloServlet.doPost(SayHelloServlet.java:121)
at com.nibco.training.servlet.SayHelloServlet.doGet(SayHelloServlet.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
Caused by: com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().
at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:118)
at com.sap.engine.services.ejb.entity.ContextFP.store0(ContextFP.java:103)
at com.sap.engine.services.ejb.entity.Context.passivate(Context.java:235)
at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:401)
... 21 more
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is a2i.beans.login.LoginBean0Persistent.
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.finishWork(TransactionContext.java:454)
at a2i.beans.login.LoginBean0PM.ejbStore(LoginBean0PM.java:184)
at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:115)
... 24 more
Caused by: com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 1.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:584)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:341)
at a2i.beans.login.LoginBean0Persistent.ejb_iInsert(LoginBean0Persistent.java:335)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
... 29 more
; nested exception is:
com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().#
#1.5#001143A7AF4000680000005900000F4C00040C3E95D97A60#1139362848402#System.out#sap.com/A2IEARCURR#System.out#Guest#0####edec5450984311da917b001143a7af40#SAPEngine_Application_Thread[impl:3]_33##0#0#Info##Plain###Success 2# -
Cannot assign value to a Variable of Complex Type beyond index 1
Hello:
I have a variable defined as a complex type as followed. I tried to assign a value to each of the two elements but it only allows me to assign to the 'element#1.
This statement that tries to assign a value into element#2 will not work, if I assign with '[1]' for the first element it will work:
<copy> <---- THIS WORKS
<from expression="'John'"/>
<to variable="My_Variable"
part="My_Collection"
query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[1]/ns9:pname"/>
</copy>
<copy> <---- THIS DOES NOT WORK
<from expression="'John'"/>
<to variable="My_Variable"
part="My_Collection"
query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[2]/ns9:pname"/>
</copy>
Is there something wrong with my definition below that allows only element#1 to be refererenced but not element#2???? Am I missing some kind of initialization that is needed to initialize both elements????
Here are my message and Complex Type definitions:
<variable name="My_Variable" messageType="ns8:args_out_msg"/>
<message name="args_out_msg">
<part name="My_Collection" element="db:My_Collection"/>
</message>
<element name="My_Collection">
<complexType>
<sequence>
<element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
<element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<complexType name="Collection_Type">
<sequence>
<element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</sequence>
</complexType>
<complexType name="Collection_Type_Struct">
<sequence>
<element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
<simpleType>
<restriction base="string">
<maxLength value="25"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
The error msg it gives me is as followed:
[2010/09/04 00:47:59] Error in <assign> expression: <to> value is empty at line "254". The XPath expression : "" returns zero node, when applied to document shown below:less
oracle.xml.parser.v2.XMLElement@1fa7874
[2010/09/04 00:47:59] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.less
-<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
-<part name="summary">
<summary>
XPath query string returns zero node.
According to BPEL4WS spec 1.1 section 14.3, The assign activity <to> part query should not return zero node.
Please check the BPEL source at line number "254" and verify the <to> part xpath query.
</summary>
</part>
</selectionFailure>
Thanks
NewbieHello:
Base on the suggestion to use 'append' instead of 'copy', I tried to define a 'singleNode' which is of type 'Collection_Type_Struct' so I can append this individual 'struct' into my array (i.e. as the 2nd. element of my array "/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"), but I am getting an error in defining this variable as:
<variable name="singleNode" element="Collection_Type_Struct"/> <--- error
Can someone tell me how should I define "singleNode" so I can put a value in it and then append this 'singleNode' into the array:
<variable name="singleNode" element=" how to define this????"/>
<assign>
<copy>
<frem expression="'Element2Value'"/>
<to variable="singleNode"
part="My_Collection"
query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item/ns9:pname"/>
</copy>
</assign>
<bpelx:assign>
<bpelx:append>
<from variable="singleNode" query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"/>
<to variable="My_Variable"
"part="My_Collection"
query="/ns9:My_Collection/ns9:Collection"/>
</bpelx:append>
</bpelx:assign>
Again here is my definition in my .xsd file:
<element name="My_Collection">
<complexType>
<sequence>
<element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
<element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<complexType name="Collection_Type">
<sequence>
<element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</sequence>
</complexType>
<complexType name="Collection_Type_Struct">
<sequence>
<element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
<simpleType>
<restriction base="string">
<maxLength value="25"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
Thanks for any help!!!! -
Execute SQL Task: Cannot assign value to the variable
DECLARE
@PartitionDate varchar(8),
@Date int
SELECT
@PartitionDate = MAX(PartitionDate)
FROM PartitionLog (NOLOCK)
SELECT
@Date = MIN(DateKey)
FROM DimDate WHERE CAST(DateKey as varchar(8)) > @PartitionDate
IF NOT CONVERT(varchar(8),GETDATE(),112) = @PartitionDate
SELECT @PartitionDate = CAST(DateKey as varchar(8))
FROM DimDate (NOLOCK)
WHERE DateKey = @Date
SELECT @PartitionDate AS PartitionDate ,
'IISDW_' + @PartitionDate AS PartitionName
GO
I have the above SQL stmt in the excute SQL task and declared 2 variable "PartitionDate" and "PartitionName" in the Package, the RESULT SET I hav given as "Single Row" and when I run the ETL I get the error as
[Execute SQL Task] Error: An error occurred while assigning a value to variable "PartitionDate": "Exception from HRESULT: 0xC0015005".Does your package variable datatype match the datatype of your parameter?
Is your Package variable assigned to the parameter in the task editor?
And does the parameter name in the task editor match the parameter names in your stored procedure? -
Cannot assign an empty string to a parameter with JDBC type VARCHAR
Hi,
I am seeing the aforementioned error in the logs. I am guessing its happening whenever I am starting an agent instance in PCo. Can somebody explain whats going on?
Regards,
Chanti.
Heres the complete detail from logs -
Log Record Details
Message: Unable to retreive path for , com.sap.sql.log.OpenSQLException: Failed to set the parameter 1 of the statement >>SELECT ID, PARENTID, FULLPATH, CREATED, CREATEDBY, MODIFIED, MODIFIEDBY, REMOTEPATH, CHECKEDOUTBY FROM XMII_PATHS WHERE FULLPATH = ? <<: Cannot assign an empty string to a parameter with JDBC type >>VARCHAR<<.
Date: 2010-03-12
Time: 11:32:37:435
Category: com.sap.xmii.system.FileManager
Location: com.sap.xmii.system.FileManager
Application: sap.com/xappsxmiiearSounds like a UI browsing bug (when no path is selected from a catalog tree folder browser) - I would suggest logging a support ticket so that it can be addressed.
-
Unable to display double values in Excel sheet using JExcel API
Hi
I am writing code to generate report in the form of Excel Sheet using JExcel API.
Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
Any kind of reply might help me lot.
Thank U.If you enable the submit zero option, it still happens? This is a new feature on the display tabl
#NumericZero Enhancements
To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
· Excel formatting for the cell is retained.
· All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
· This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
1. (Highest) Metadata errors
2. #No access
3. #Invalid/Meaningless
4. #No data\Missing -
NullPointerException - Cannot get the value from variable f_cashGiven
In SubCheckout.java (a POS), what I want is when Payment button (f_cashPayment) is pressed, the action "Cash" is performed, get the value from Cash Given (f_cashGiven), do the subtraction and post the value as Cash Return (f_cashReturn). The code is filled in actionPerformed. But I cannot get the value by using f_cashGiven.getValue() from VNumber class. It returns NULL. This should be quite straight forward, but I do not know what is wrong. Please help!
Enclosed please find the source code of SubCheckout.java and VNumber.java
This is the code of SubCheckout.java :
* The contents of this file are subject to the Compiere License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
* are Copyright (C) 1999-2005 Jorg Janke.
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
* Contributor(s): ______________________________________.
package org.compiere.pos;
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
import javax.swing.border.*;
import org.compiere.grid.ed.*;
import org.compiere.swing.*;
import org.compiere.util.*;
* POS Checkout Sub Panel
* @author Jorg Janke
* @version $Id: SubCheckout.java,v 1.3 2005/03/11 20:28:22 jjanke Exp $
public class SubCheckout extends PosSubPanel implements ActionListener
* Constructor
* @param posPanel POS Panel
public SubCheckout (PosPanel posPanel)
super (posPanel);
} // PosSubCheckout
private CButton f_register = null;
private CButton f_summary = null;
private CButton f_process = null;
private CButton f_print = null;
private CLabel f_lcreditCardNumber = null;
private CTextField f_creditCardNumber = null;
private CLabel f_lcreditCardExp = null;
private CTextField f_creditCardExp = null;
private CLabel f_lcreditCardVV = null;
private CTextField f_creditCardVV = null;
private CButton f_cashPayment = null;
private CLabel f_lcashGiven = null;
private VNumber f_cashGiven = null;
private CLabel f_lcashReturn = null;
private VNumber f_cashReturn = null;
private CButton f_creditPayment = null;
/** Logger */
private static CLogger log = CLogger.getCLogger(SubCheckout.class);
* Initialize
public void init()
// Title
TitledBorder border = new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"));
setBorder(border);
// Content
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = INSETS2;
// -- 0
gbc.gridx = 0;
f_register = createButtonAction("Register", null);
gbc.gridy = 0;
add (f_register, gbc);
f_summary = createButtonAction("Summary", null);
gbc.gridy = 1;
add (f_summary, gbc);
f_process = createButtonAction("Process", null);
gbc.gridy = 2;
add (f_process, gbc);
f_print = createButtonAction("Print", null);
gbc.gridy = 3;
add (f_print, gbc);
// -- 1 -- Cash
gbc.gridx = 1;
gbc.gridheight = 2;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = .1;
CPanel cash = new CPanel(new GridBagLayout());
cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
gbc.gridy = 0;
add (cash, gbc);
GridBagConstraints gbc0 = new GridBagConstraints();
gbc0.insets = INSETS2;
gbc0.anchor = GridBagConstraints.WEST;
f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
cash.add (f_lcashGiven, gbc0);
f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount,
Msg.translate(Env.getCtx(), "CashGiven"));
f_cashGiven.addActionListener(this);
f_cashGiven.setColumns(10, 25);
cash.add (f_cashGiven, gbc0);
f_cashGiven.setValue(Env.ZERO);
f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
cash.add (f_lcashReturn, gbc0);
f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount,
"CashReturn");
f_cashReturn.setColumns(10, 25);
cash.add (f_cashReturn, gbc0);
f_cashReturn.setValue(Env.ZERO);
f_cashPayment = createButtonAction("Payment", null);
f_cashPayment.setActionCommand("Cash");
gbc0.anchor = GridBagConstraints.EAST;
gbc0.weightx = 0.1;
cash.add (f_cashPayment, gbc0);
// -- 1 -- Creditcard
CPanel creditcard = new CPanel(new GridBagLayout());
creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType")));
gbc.gridy = 2;
add (creditcard, gbc);
GridBagConstraints gbc1 = new GridBagConstraints();
gbc1.insets = INSETS2;
gbc1.anchor = GridBagConstraints.WEST;
gbc1.gridx = 0;
gbc1.gridy = 0;
f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber"));
creditcard.add (f_lcreditCardNumber, gbc1);
gbc1.gridy = 1;
f_creditCardNumber = new CTextField(18);
creditcard.add (f_creditCardNumber, gbc1);
gbc1.gridx = 1;
gbc1.gridy = 0;
f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp"));
creditcard.add (f_lcreditCardExp, gbc1);
gbc1.gridy = 1;
f_creditCardExp = new CTextField(5);
creditcard.add (f_creditCardExp, gbc1);
gbc1.gridx = 2;
gbc1.gridy = 0;
f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV"));
creditcard.add (f_lcreditCardVV, gbc1);
gbc1.gridy = 1;
f_creditCardVV = new CTextField(5);
creditcard.add (f_creditCardVV, gbc1);
gbc1.gridx = 3;
gbc1.gridy = 0;
gbc1.gridheight = 2;
f_creditPayment = createButtonAction("Payment", null);
f_creditPayment.setActionCommand("CreditCard");
gbc1.anchor = GridBagConstraints.EAST;
gbc1.weightx = 0.1;
creditcard.add (f_creditPayment, gbc1);
} // init
* Get Panel Position
public GridBagConstraints getGridBagConstraints()
GridBagConstraints gbc = super.getGridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 3;
return gbc;
} // getGridBagConstraints
* Dispose - Free Resources
public void dispose()
super.dispose();
} // dispose
* Action Listener
* @param e event
public void actionPerformed (ActionEvent e)
String action = e.getActionCommand();
if (action == null || action.length() == 0)
return;
log.info( "PosSubCheckout - actionPerformed: " + action);
if (e.getSource() == f_cashGiven) {
f_cashGiven.setValue(f_cashGiven.getValue());
System.out.println("f_cashGiven"+f_cashGiven.getDisplay());
// Register
// Summary
// Print
if (action.equals("Cash")) {
BigDecimal CashGiven, GrandTotal, CashReturn;
System.out.println("Cash given is "+f_cashGiven.getDisplay());
CashGiven = (BigDecimal)f_cashGiven.getValue();
GrandTotal = (BigDecimal)p_posPanel.f_curLine.getOrder().getGrandTotal();
CashReturn = CashGiven.subtract(GrandTotal);
f_cashReturn.setValue(CashReturn);
// Cash (Payment)
// CreditCard (Payment)
} // actionPerformed
} // PosSubCheckoutThis is the code of VNumber.java :
* The contents of this file are subject to the Compiere License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
* are Copyright (C) 1999-2005 Jorg Janke.
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
* Contributor(s): ______________________________________.
package org.compiere.grid.ed;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.math.*;
import java.text.*;
import java.util.logging.*;
import javax.swing.*;
import javax.swing.text.*;
import org.compiere.apps.*;
import org.compiere.model.*;
import org.compiere.swing.*;
import org.compiere.util.*;
* Number Control
* @author Jorg Janke
* @version $Id: VNumber.java,v 1.41 2005/09/03 01:57:16 jjanke Exp $
public final class VNumber extends JComponent
implements VEditor, ActionListener, KeyListener, FocusListener
/** Number of Columns (12) */
public final static int SIZE = 12;
* IDE Bean Constructor
public VNumber()
this("Number", false, false, true, DisplayType.Number, "Number");
} // VNumber
* Create right aligned Number field.
* no popup, if WindowNo == 0 (for IDs)
* @param columnName column name
* @param mandatory mandatory
* @param isReadOnly read only
* @param isUpdateable updateable
* @param displayType display type
* @param title title
public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
int displayType, String title)
super();
super.setName(columnName);
m_columnName = columnName;
m_title = title;
setDisplayType(displayType);
LookAndFeel.installBorder(this, "TextField.border");
this.setLayout(new BorderLayout());
// this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length
// int height = m_text.getPreferredSize().height;
// setMinimumSize(new Dimension (30,height));
// *** Text ***
m_text.setBorder(null);
m_text.setHorizontalAlignment(JTextField.TRAILING);
m_text.addKeyListener(this);
m_text.addFocusListener(this);
// Background
setMandatory(mandatory);
this.add(m_text, BorderLayout.CENTER);
// *** Button ***
m_button.setIcon(Env.getImageIcon("Calculator10.gif"));
m_button.setMargin(new Insets(0, 0, 0, 0));
m_button.setFocusable(false);
m_button.addActionListener(this);
this.add (m_button, BorderLayout.EAST);
// Prefereed Size
this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length
// Size
setColumns(SIZE, CComboBox.FIELD_HIGHT-4);
// ReadWrite
if (isReadOnly || !isUpdateable)
setReadWrite(false);
else
setReadWrite(true);
} // VNumber
* Dispose
public void dispose()
m_text = null;
m_button = null;
m_mField = null;
} // dispose
* Set Document
* @param doc document
protected void setDocument(Document doc)
m_text.setDocument(doc);
} // getDocument
private String m_columnName;
protected int m_displayType; // Currency / UoM via Context
private DecimalFormat m_format;
private String m_title;
private boolean m_setting;
private String m_oldText;
private String m_initialText;
private boolean m_rangeSet = false;
private Double m_minValue;
private Double m_maxValue;
private boolean m_modified = false;
/** The Field */
private CTextField m_text = new CTextField(SIZE); // Standard
/** The Button */
private CButton m_button = new CButton();
private MField m_mField = null;
/** Logger */
private static CLogger log = CLogger.getCLogger(VNumber.class);
* Set no of Columns
* @param columns columns
public void setColumns (int columns, int height)
m_text.setPreferredSize(null);
m_text.setColumns(columns);
Dimension size = m_text.getPreferredSize();
if (height > size.height) // default 16
size.height = height;
if (CComboBox.FIELD_HIGHT-4 > size.height)
size.height = VLookup.FIELD_HIGHT-4;
this.setPreferredSize(size); // causes r/o to be the same length
this.setMinimumSize(new Dimension (columns*10, size.height));
m_button.setPreferredSize(new Dimension(size.height, size.height));
} // setColumns
* Set Range with min & max
* @param minValue min value
* @param maxValue max value
* @return true, if accepted
public boolean setRange(Double minValue, Double maxValue)
m_rangeSet = true;
m_minValue = minValue;
m_maxValue = maxValue;
return m_rangeSet;
} // setRange
* Set Range with min & max = parse US style number w/o Gouping
* @param minValue min value
* @param maxValue max value
* @return true if accepted
public boolean setRange(String minValue, String maxValue)
if (minValue == null || maxValue == null)
return false;
try
m_minValue = Double.valueOf(minValue);
m_maxValue = Double.valueOf(maxValue);
catch (NumberFormatException nfe)
return false;
m_rangeSet = true;
return m_rangeSet;
} // setRange
* Set and check DisplayType
* @param displayType display type
public void setDisplayType (int displayType)
m_displayType = displayType;
if (!DisplayType.isNumeric(displayType))
m_displayType = DisplayType.Number;
m_format = DisplayType.getNumberFormat(displayType);
m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title));
} // setDisplayType
* Set ReadWrite
* @param value value
public void setReadWrite (boolean value)
if (m_text.isReadWrite() != value)
m_text.setReadWrite(value);
if (m_button.isReadWrite() != value)
m_button.setReadWrite(value);
// Don't show button if not ReadWrite
if (m_button.isVisible() != value)
m_button.setVisible(value);
} // setReadWrite
* IsReadWrite
* @return true if rw
public boolean isReadWrite()
return m_text.isReadWrite();
} // isReadWrite
* Set Mandatory (and back bolor)
* @param mandatory mandatory
public void setMandatory (boolean mandatory)
m_text.setMandatory(mandatory);
} // setMandatory
* Is it mandatory
* @return true if mandatory
public boolean isMandatory()
return m_text.isMandatory();
} // isMandatory
* Set Background
* @param color color
public void setBackground(Color color)
m_text.setBackground(color);
} // setBackground
* Set Background
* @param error error
public void setBackground (boolean error)
m_text.setBackground(error);
} // setBackground
* Set Foreground
* @param fg foreground
public void setForeground(Color fg)
m_text.setForeground(fg);
} // setForeground
* Set Editor to value
* @param value value
public void setValue(Object value)
log.finest("Value=" + value);
if (value == null)
m_oldText = "";
else
m_oldText = m_format.format(value);
// only set when not updated here
if (m_setting)
return;
m_text.setText (m_oldText);
m_initialText = m_oldText;
m_modified = false;
} // setValue
* Property Change Listener
* @param evt event
public void propertyChange (PropertyChangeEvent evt)
if (evt.getPropertyName().equals(org.compiere.model.MField.PROPERTY))
setValue(evt.getNewValue());
} // propertyChange
* Return Editor value
* @return value value (big decimal or integer)
public Object getValue()
if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0)
return null;
String value = m_text.getText();
// return 0 if text deleted
if (value == null || value.length() == 0)
if (!m_modified)
return null;
if (m_displayType == DisplayType.Integer)
return new Integer(0);
return Env.ZERO;
if (value.equals(".") || value.equals(",") || value.equals("-"))
value = "0";
try
Number number = m_format.parse(value);
value = number.toString(); // converts it to US w/o thousands
BigDecimal bd = new BigDecimal(value);
if (m_displayType == DisplayType.Integer)
return new Integer(bd.intValue());
if (bd.signum() == 0)
return bd;
return bd.setScale(m_format.getMaximumFractionDigits(), BigDecimal.ROUND_HALF_UP);
catch (Exception e)
log.log(Level.SEVERE, "Value=" + value, e);
if (m_displayType == DisplayType.Integer)
return new Integer(0);
return Env.ZERO;
} // getValue
* Return Display Value
* @return value
public String getDisplay()
return m_text.getText();
} // getDisplay
* Get Title
* @return title
public String getTitle()
return m_title;
} // getTitle
* Plus - add one.
* Also sets Value
* @return new value
public Object plus()
Object value = getValue();
if (value == null)
if (m_displayType == DisplayType.Integer)
value = new Integer(0);
else
value = Env.ZERO;
// Add
if (value instanceof BigDecimal)
value = ((BigDecimal)value).add(Env.ONE);
else
value = new Integer(((Integer)value).intValue() + 1);
setValue(value);
return value;
} // plus
* Minus - subtract one, but not below minimum.
* Also sets Value
* @param minimum minimum
* @return new value
public Object minus (int minimum)
Object value = getValue();
if (value == null)
if (m_displayType == DisplayType.Integer)
value = new Integer(minimum);
else
value = new BigDecimal(minimum);
setValue(value);
return value;
// Subtract
if (value instanceof BigDecimal)
BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE);
BigDecimal min = new BigDecimal(minimum);
if (bd.compareTo(min) < 0)
value = min;
else
value = bd;
else
int i = ((Integer)value).intValue();
i--;
if (i < minimum)
i = minimum;
value = new Integer(i);
setValue(value);
return value;
} // minus
* Action Listener
* @param e event
public void actionPerformed (ActionEvent e)
log.config(e.getActionCommand());
if (ValuePreference.NAME.equals(e.getActionCommand()))
if (MRole.getDefault().isShowPreference())
ValuePreference.start (m_mField, getValue());
return;
if (e.getSource() == m_button)
m_button.setEnabled(false);
String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title);
m_text.setText(str);
m_button.setEnabled(true);
try
fireVetoableChange (m_columnName, m_oldText, getValue());
catch (PropertyVetoException pve) {}
m_text.requestFocus();
} // actionPerformed
* Key Listener Interface
* @param e event
public void keyTyped(KeyEvent e) {}
public void keyPressed(KeyEvent e) {}
* Key Listener.
* - Escape - Restore old Text
* - firstChange - signal change
* @param e event
public void keyReleased(KeyEvent e)
log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar()
+ " -> " + m_text.getText());
// ESC
if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
m_text.setText(m_initialText);
m_modified = true;
m_setting = true;
try
if (e.getKeyCode() == KeyEvent.VK_ENTER) // 10
fireVetoableChange (m_columnName, m_oldText, getValue());
fireActionPerformed();
else // indicate change
fireVetoableChange (m_columnName, m_oldText, null);
catch (PropertyVetoException pve) {}
m_setting = false;
} // keyReleased
* Focus Gained
* @param e event
public void focusGained (FocusEvent e)
if (m_text != null)
m_text.selectAll();
} // focusGained
* Data Binding to MTable (via GridController.vetoableChange).
* @param e event
public void focusLost (FocusEvent e)
// log.finest(e.toString());
// APanel - Escape
if (e.getOppositeComponent() instanceof AGlassPane)
m_text.setText(m_initialText);
return;
try
fireVetoableChange (m_columnName, m_initialText, getValue());
fireActionPerformed();
catch (PropertyVetoException pve) {}
} // focusLost
* Invalid Entry - Start Calculator
* @param jc parent
* @param value value
* @param format format
* @param displayType display type
* @param title title
* @return value
public static String startCalculator(Container jc, String value,
DecimalFormat format, int displayType, String title)
log.config("Value=" + value);
BigDecimal startValue = new BigDecimal(0.0);
try
if (value != null && value.length() > 0)
Number number = format.parse(value);
startValue = new BigDecimal (number.toString());
catch (ParseException pe)
log.info("InvalidEntry - " + pe.getMessage());
// Find frame
Frame frame = Env.getFrame(jc);
// Actual Call
Calculator calc = new Calculator(frame, title,
displayType, format, startValue);
AEnv.showCenterWindow(frame, calc);
BigDecimal result = calc.getNumber();
log.config( "Result=" + result);
calc = null;
if (result != null)
return format.format(result);
else
return value; // original value
} // startCalculator
* Set Field/WindowNo for ValuePreference
* @param mField field
public void setField (MField mField)
m_mField = mField;
if (m_mField != null
&& MRole.getDefault().isShowPreference())
ValuePreference.addMenu (this, popupMenu);
} // setField
* Remove Action Listner
* @param l Action Listener
public void removeActionListener(ActionListener l)
listenerList.remove(ActionListener.class, l);
} // removeActionListener
* Add Action Listner
* @param l Action Listener
public void addActionListener(ActionListener l)
listenerList.add(ActionListener.class, l);
} // addActionListener
* Fire Action Event to listeners
protected void fireActionPerformed()
int modifiers = 0;
AWTEvent currentEvent = EventQueue.getCurrentEvent();
if (currentEvent instanceof InputEvent)
modifiers = ((InputEvent)currentEvent).getModifiers();
else if (currentEvent instanceof ActionEvent)
modifiers = ((ActionEvent)currentEvent).getModifiers();
ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED,
"VNumber", EventQueue.getMostRecentEventTime(), modifiers);
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// Process the listeners last to first, notifying those that are interested in this event
for (int i = listeners.length-2; i>=0; i-=2)
if (listeners==ActionListener.class)
((ActionListener)listeners[i+1]).actionPerformed(ae);
} // fireActionPerformed
} // VNumberIf getValue() returns null, you need to trace the execution of the code and figure out which sequence of code is leading to the return of null. This method looks complex - a lot of if statements. If you do not have a debugger, put System.out.println statements inside the method to figure out what's going on.
-
I cannot change the value in about:newtab from "newtab" to "blank." The dialog is displayed but when I click Ok, the value is not changed.
===Answer===
Comment on usual method and solution, by a forum Moderator.
As long as there are no confounding factors, such as certain extensions, or a user.jsfile the procedure is as follows
# Open a new tab and type "about:config" in the address bar.
# In the Search bar type: "newtab"
# Locate and double click "browser.newtab.url"
# In the "Enter String Value" box change "'''about:newtab'''" to "'''about:blank'''" and click OK.
# Verify that the value has changed and now all new tabs will be blank.
See post under by ''pirate048'' [/questions/976589?page=2#answer-509482] ~J99Have to say that I rather agree with Mark..all we want is a simple, unadorned clean page that doe not track and show usage!! WHY NOT!! Is it too simple for developers..we aren't all (nor do we want to be!) software experts! Come on Mozilla..tidy up and clean up..it might be a quicker programme too!!
-
How i can assign multiple values to tabuler text item (Help)
HI
IM PROGRAMMING ONE FORM AND I PUT THERE TABULER TEXT ITEM
I WANT ASSIGN 63 VALUES TO THIS TEXT ITEM ONE BY ONE BY CODE I MEAN PUT FIRST VALUE IN THE FIRST TEXT ITEM ROW THEN SECOND TO THE SECOND TEXT ITEM AND LIKE THIS UNTIL I REACH TO THE LAST
I MAKE LOV PUT I CAN ASSIGN ONE VALUE BY ONE VALUE EACH TIME DOUBLE CLICK ON THE TEXT ITEM ASSIGN ONE VALUE THEN DOUBLE CLICK ON THE SECOND ROW PUT MY BOSS WANT ASSIGN ALL VALUES 63 FROM ONE CLICK ON BUTTONThen you will have to create a when-validate-item trigger with a cursor based on your selection of your LOV . Loop through that cursor assigning the next in the next record by using the built-in function next_record. (put you selection for you value in a hidden item for example.
something like this:
Declare
cursor c is
select returnValueFromLOV
from <yourtable>
where yourdisplay value = :hidden_tem;
begin
for r in c loop
next_record;
item := r. returnValueFromLOV;
end loop;
exception
when no_data_found
your error handling;
end;
Hope it put you on the road to reach what you want
Erwin -
Hi,
I'm using forms6i.
I have an item in my form , say, Invoicebase, whose default value to be fetched from another table and to be shown in the form while loading.
The query to fetch the default value involves a where condition, like where company = :Global.company
But I'm assigining value to this global variable in when-new-form-instance.
So where(which trigger) should i write the query to fetch the default value?
I cannot assign value in when-new-record-instance trigger because , it wil change the form status, and if without entering any value i try to quit it wil ask for Close Form?
I can only do that in when-create-record trigger, but at that time the global variable wil not be initialized and the query would not have worked!
Please help me handle this
Thanks
Edited by: Divya on Jan 30, 2011 4:32 AMStay with the WHEn-CREATE-RECORD-trigger and put the code to initialize teh global into the PRE-FORM-trigger.
-
Assigning a value to a substitute variable
Hi, I would like to know if it is possible to assign a value to a substitute variable.
This is what I'm doing:
- Prompting user for input
ACCEPT uom CHAR PROMPT 'Enter number of UOM system you would like: ' DEF '0'
(displayed list of options are numbers 0-5)
- Based on input, open corresponding file
(start i:\utc\all\oracle\uom\uom_column_heading_&&uom..sql)
Problem:
- Default selection is 0, meaning use the CURRENT UOM system (a number, 1-5)
- That being said, &&uom must be assigned a 1-5 value in order to open the file that corresponds to the CURRENT UOM system
Let me know if any additional information is needed.
Thanks!I apologize for the format. I tried to make it more legible, but was not able to. FYI: It appears to be easier to read in "Edit" view.
Thanks, I tried the &&uom := your_function(); suggestion, but I am getting an error. It looks like the "value" of &&uom is being read in the assignment statement, not the variable name.
I have copied the piece of the code, for your reference.
ACCEPT uom CHAR PROMPT 'Enter number of UOM system you would like: ' DEF '0'
DECLARE
v_uom_sys_selection NUMBER;
v_curr_uom_sys VARCHAR2 (50);
v_uom_num NUMBER;
BEGIN
v_uom_sys_selection := to_number(&uom);
v_curr_uom_sys := EG.GET_CURRENT_UOM();
v_uom_num := eg.get_user_selected_uomnum(v_curr_uom_sys);
&&uom := to_char(v_uom_num);
dbms_output.put_line('v_uom_num = ' || v_uom_num);
dbms_output.put_line('&&uom = ' || &&uom);
END;
--prompt "&&uom"
start i:\utc\all\oracle\uom\uom_column_heading_&&uom..sql
Below are the results I get when commenting out the &&uom := to_char(v_uom_num); line. NOTE: the "value" of &&uom = 0.
v_uom_num = 1
0 = 0
If I leave that line in, I get the following error:
PLS-00103: Encountered the symbol "0" when expecting one of the following:
begin case declare end exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe
The symbol "<an identifier> was inserted before "0" to continue.
Message was edited by:
user449676 -
I want to assign the value of a Javascript variable to JSP Variable
I want to assign the value of a Javascript variable to JSP Variable .. for example :
<%
Bla Bla Bla
%>
<script>
var JavaScriptVariable="hello"
</script>
<%
String JSPVariable=// The Value of JavaScriptVariable ;
%>
How can i do that ??
Thanks>I want to assign the value of a Javascript variable to JSP Variable
cannot be done.Friend try to understand concepts properly Javascript is always excuted by the browser @clientside where as JSPCode is executed Websever(ServletContainer) @serverside.Through you are combining JSP Code blocks(Tags,Expressions,scriptlets...) & javascript under a single page webserver can only identify what is their under JSP Code blocks.
Hope this could be an appropriate answer for your question.
However,you can as well submit a request by encoding your URL with request parameters and the submit to the page and then collect it using request.getParameter(name).
But under a single context state it is not possible
REGARDS,
RaHuL
Maybe you are looking for
-
My phone was stolen and I discontinued cell service to the phone through my provider. However, before discontinuing service, I locked my phone from the icloud. Now that it is no longer being serviced by the service provider, will the phone remain loc
-
My itouch 5g won't charge or even turn on... Help please
I have a 5th gen itouch. And it's been working perfectly fine until this morning. The battery died last night so I plugged it in to charge and nothing happened. I simply thought I just broke my cable so I plugged it into several others that belonged
-
How can Nokia get away with it?!
Words cannot express how angry I am today, Nokia are taking every opportunity to make sure I never buy one of their handsets EVER again. A few days ago I discovered the new v5 firmware was available for my N70, fantastic I thought, perhaps this will
-
How to include attributes as parameters in a query?
Dear Gurus, I need to create a parameter/filter in a BEx query using the attributes of 0MATERIAL like 0BRAND and 0CATEGORY. How do i do it? Thanks a lot in advance for the time and help. Raj Message was edited by: Raj Singh
-
Just subscribed, paid and finally doesn't succeed !!!
Just subscribed and paid for a yearly fee but I am unable to access to the process ; Adobe always asked me to "subscribe again" (but I already paid). I want simply to know HOW DO I DO FOR converting a PDF file to an EXCEL one ; I hope it will respec