Query regarding 'EXCEPTION'.Please see.
I have a question regarding Exception.
Lets assume that I have a method that throws an 'ArithmeticException',but
instead of catching this exception,I will catch the 'Exception' object.
try {
}catch(Exception e){
} Now correct me if I am mistaken in my analysis :
Normally having a 'superclass and subclass heirarchy' gives you polymorphism.
The subclass will override the method defined in the superclass and gives it
its own implementation.
I can then use the 'superclass reference' as a argument to a method which can execute
the overridden method dynamically.
Because the subclass has overridden the base class method,polymorphism takes place.
Am I right in the above analysis?
Now look at the exception example on top.
I am passing the Exception reference to the catch clause (which is an indirect parent
of ArithmeticException).
My Question is:
1)Which method has ArithmeticException overridden for polymorphism to take place?
(ie,I am passing the superclass of the exception,and the JVM knows which exception to
generate)
2)Am I right in my analysis?
Lets assume that I have a method that throws an
'ArithmeticException',butThen your app is buggy.
instead of catching this exception,I will catch the
'Exception' object.Don't do that. Better fix your code.
Am I right in the above analysis?Yepp, I guess so.
1)Which method has ArithmeticException overridden for
polymorphism to take place?Look at its source. Probably none.
(ie,I am passing the superclass of the exception,and
the JVM knows which exception to
generate)That doesn't make sense. You're not passing anything. The code or JVM knows which exception to generate, and you just tell it which one to catch.
Similar Messages
-
Query regarding Exception and invocation.
I have a query regarding Exception.
In my code, which throws an ArithmeticException:
<code>
public class TestArithmeticException{
public static void main(String[] args)
int a,b ;
try {
b=0;
a = 50/b;
}catch(Exception ex) {
ex.printStackTrace()
</code>
The above code is catching exception of type Exception(which is superclass of all RuntimeExceptions)
and which inturn extends the Throwable class.
ie. Throwable -
Exception -
RuntimeException
ArithmeticException
Am I correct in my assumption below:
a Because ArithmeticException is an indirect subclass of Throwable and has access to its inherited methods,
it overrides the methods defined in 'Throwable', and then via polymorphism(superclass reference 'ex' in the catch clause)
invokes the method ex.printStackTrace() ?
Does it mean that all runtime exception child classes override the methods defined in Throwable, and then via polymorphism execute overridden
methods?Yes.
-
Hi all,
Sorry, i couldn't find any forum for exception so i am posting it here.
Whenever we have to define any custom exception we always extends Exception class, or in other term whenever we extends Exception class it is said to be checked exception.
My query is like even RuntimeException class also extends Exception class so why is it considered unchecked exception?
I am confused over here please solve my query.
Thanks.Because those are the rules. If the exception is a subclass of RuntimeException, it is unchecked and you don't have to account for it. If the exception is subclass of Exception but not a subclass of RuntimeException, you must either catch it or have a throws clause on the containing method.
The choice of whether to make an exception checked or unchecked is controversial; see for example the discussion in Chapter 9 of Joshua Bloch's book "Effective Java". Based on my experiences, I don't find much use for checked exceptions and don't like them. Other people smarter than me think they're great.
You should document any exceptions you throw with @throws javadoc comment, including unchecked exceptions.
Edited by: ghstark on Apr 13, 2009 2:00 PM: added sentence about @throws javadoc -
Query regarding the process for SAP TM 9.0 Certification
Hi Team,
I am a SAP TM consultant with an experience of more than 2 years in SAP TM. I would like to take the SAP TM 9.0 certification now.
Could you please let me know the complete details for applying for this certification?
Thanks in advance for the help and for your time.
Thanks & Regards,
Srikanth.Please see the education website. The certification coverage and prerequisites are here on TM certification:
https://training.sap.com/shop/certification/c_tm_90-sap-certified-application-associate---sap-transportation-management-… -
Query regarding Inline Query and a Join.Please see
I have a query regarding Inline Queries
I have 2 tables
TRADE and POSTING
TRADE has Primary Key:id_trade_ref and POSTING has Foriegn.Key: id_trade_ref
id_trade_ref 5V973781B has 5 records in POSTINGS
If i need to join these 2 tables,I use
1) Select t.id_entity,t.id_trade_ref,p.am_stock
from trade t,posting p
where t.id_trade_ref = '5V973781B'
and p.id_trade_ref = '5V973781B'
2) Now I can use the same as an Inline Query:
select
t.id_entity,
t.id_trade_ref,
( select p1.am_stock
from posting p1
where p1.id_entity = t.id_entity
and p1.id_trade_ref= t.id_trade_ref
and p1.id_posting_type in ( 'NEW', 'CAN')
from
trade t
where t.id_entity = 'DBL'
and t.id_trade_ref = '5V973781B'
My Query:
Of the two,which is a better option to use.?
Is Inline a better option or a normal join?I would rewrite the first one to:
Select t.id_entity,t.id_trade_ref,p.am_stock
from trade t,posting p
where t.id_trade_ref = '5V973781B'
and p.id_trade_ref = t.id_trade_ref
This way, you really make the join between the table.
I think the join is better because it uses less code. I do not think you will notice much performance win between one or the other, especially because it concerns only a few rows. -
I get this exception (and long stack trace) when attempting to start my weblogic server. I'm running Weblogic 7 with Portal 7 (sp 1). I'm using Oracle 8.1.7. I upgraded this application from weblogic portal 4.0, and never had this problem there. As part of the migration process, I ran the tool to migrate all of the database tables, and I re-synched the EBCC project using version 7 of EBCC. I did a search for this problem and found a few mentions of it that seemed to be related to Oracle's handling of CLOB data. Apparently, there is a patch, but I can't seem to find this patch. I'm also not sure if this is indeed the problem since I didn't have this issue with the older version of weblogic using the same database. Any suggestions?
If you have a support contract please open a case so we can work through
this problem.
Can you run an sqlplus session on your database, execute the commands
"delete from data_sync_item" and "commit", then resync to see if it will
get you around the problem. The data_sync_item table will be fully
populated after you sync. This should get you running.
Between 4.0 and 7.0 the DefaultRequestPropertySet.req file was reduced
in size -- the CLOB would be smaller in the data_sync_item table.
I would recommend using the Version Checker against your installation --
find it on the dev2dev.bea.com site to see if the upgrade installer work
ed properly. Also consider running the full installer to avoid possible
problems that might occur with upgrade installers.
As a result of that patch you referenced in 4.0 the CLOB handling logic
was changed in 7.0 -- this is why it is strange you are seeing cleaving
errors. In 7.0 SP2 to be release next week the data sync and
persistence code was changed also.
Are you using the OCI or Thin driver?
-- Jim
Rob Goldie wrote:
Jim Litton <replyto@newsgroup> wrote:
Rob,
The CLOB issue was related to wlportal4.0 and should not be a factor
in
7.0.
Could you post the entire stack trace?
####<Jan 27, 2003 4:21:47 PM EST> <Warning> <Data Synchronization> <PFIDEV5> <pfeAricept1Server>
<main> <kernel identity> <> <000000> <Application: gmiAriceptApp; Failed to retrieve
a schema URI (document namespace) for /request/DefaultRequestPropertySet.req;
please see the following exception for details.>
Exception[com.bea.p13n.management.data.doc.DocumentProcessingException: Unable
to analyze and/or cleave document]
at com.bea.p13n.management.data.doc.cleaver.CleavingDocumentProcessor.process(CleavingDocumentProcessor.java:94)
at com.bea.p13n.management.data.repository.internal.DataItemImpl.getSchemaUri(DataItemImpl.java:136)
at com.bea.p13n.management.data.repository.DataRepositoryFactory.createDataItem(DataRepositoryFactory.java:363)
at com.bea.p13n.management.data.repository.persistence.JdbcDataSource.createDataItems(JdbcDataSource.java:523)
at com.bea.p13n.management.data.repository.persistence.JdbcDataSource.refresh(JdbcDataSource.java:442)
at com.bea.p13n.management.data.repository.persistence.ReadOnlyJdbcPersistenceManager.refresh(ReadOnlyJdbcPersistenceManager.java:107)
at com.bea.p13n.management.data.repository.internal.AbstractDataRepository.<init>(AbstractDataRepository.java:193)
at com.bea.p13n.management.data.repository.internal.MasterDataRepository.<init>(MasterDataRepository.java:46)
at com.bea.p13n.management.data.repository.DataRepositoryFactory.getMasterDataRepository(DataRepositoryFactory.java:255)
at com.bea.p13n.placeholder.internal.PlaceholderServiceImpl.ejbCreate(PlaceholderServiceImpl.java:191)
at com.bea.p13n.placeholder.internal.PlaceholderServiceImpl_9p0jz2_Impl.ejbCreate(PlaceholderServiceImpl_9p0jz2_Impl.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:151)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:188)
at weblogic.ejb20.manager.StatelessManager.initializePool(StatelessManager.java:380)
at weblogic.ejb20.deployer.EJBDeployer.initializePools(EJBDeployer.java:1472)
at weblogic.ejb20.deployer.EJBDeployer.start(EJBDeployer.java:1367)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:864)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:81)
at weblogic.j2ee.Application.addComponent(Application.java:294)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:164)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:732)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:714)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:417)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:926)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:470)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:198)
at $Proxy9.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:4060)
at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:2259)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:373)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:235)
at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:61)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:806)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:295)
at weblogic.Server.main(Server.java:32)
Caused by: org.xml.sax.SAXException: No message available. Resource not found:
repository.cleaver.no.xsi.namespace.exception Resource bundle: com/bea/p13n/management/data/datasync
at com.bea.p13n.management.data.doc.cleaver.DocumentCleaver.mapNamespaces(DocumentCleaver.java:135)
at com.bea.p13n.management.data.doc.cleaver.DocumentCleaver.startElement(DocumentCleaver.java:235)
at weblogic.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1384)
at weblogic.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1299)
at weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1821)
at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:964)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:396)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1119)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
at com.bea.p13n.management.data.doc.cleaver.CleavingDocumentProcessor.process(CleavingDocumentProcessor.java:80)
at com.bea.p13n.management.data.repository.internal.DataItemImpl.getSchemaUri(DataItemImpl.java:136)
at com.bea.p13n.management.data.repository.DataRepositoryFactory.createDataItem(DataRepositoryFactory.java:363)
at com.bea.p13n.management.data.repository.persistence.JdbcDataSource.createDataItems(JdbcDataSource.java:523)
at com.bea.p13n.management.data.repository.persistence.JdbcDataSource.refresh(JdbcDataSource.java:442)
at com.bea.p13n.management.data.repository.persistence.ReadOnlyJdbcPersistenceManager.refresh(ReadOnlyJdbcPersistenceManager.java:107)
at com.bea.p13n.management.data.repository.internal.AbstractDataRepository.<init>(AbstractDataRepository.java:193)
at com.bea.p13n.management.data.repository.internal.MasterDataRepository.<init>(MasterDataRepository.java:46)
at com.bea.p13n.management.data.repository.DataRepositoryFactory.getMasterDataRepository(DataRepositoryFactory.java:255)
at com.bea.p13n.placeholder.internal.PlaceholderServiceImpl.ejbCreate(PlaceholderServiceImpl.java:191)
at com.bea.p13n.placeholder.internal.PlaceholderServiceImpl_9p0jz2_Impl.ejbCreate(PlaceholderServiceImpl_9p0jz2_Impl.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:151)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:188)
at weblogic.ejb20.manager.StatelessManager.initializePool(StatelessManager.java:380)
at weblogic.ejb20.deployer.EJBDeployer.initializePools(EJBDeployer.java:1472)
at weblogic.ejb20.deployer.EJBDeployer.start(EJBDeployer.java:1367)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:864)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:81)
at weblogic.j2ee.Application.addComponent(Application.java:294)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:164)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:732)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:714)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:417)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:926)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:470)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:198)
at $Proxy9.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:4060)
at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:2259)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:373)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:235)
at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:61)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:806)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:295)
at weblogic.Server.main(Server.java:32)
Are you using a UTF-8 Oracle database?
Yes
If you create a new User Profile in the EBCC and compare it to your
migrated .usr file do you see differences in the DTD's?
I recreated a new version of the .usr in the EBCC, and still got the same error.
I also tried deleting everything from the data-sync-item table and re-synching.
What does the DocumentManager section of your application-config.xml
look like?
<DocumentManager
ContentCacheName="documentContentCache"
ContentCaching="true"
DocumentConnectionPoolName="default"
MaxCachedContentSize="32768"
MetadataCacheName="documentMetadataCache"
MetadataCaching="true"
Name="default"
PropertyCase="none"
UserIdInCacheKey="false"
/>
What does the document.jar Targets="" parameter look like in config.xml?
<EJBComponent Name="document" Targets="pfeCluster" URI="document.jar"/>
-- Jim
Rob Goldie wrote:
I get this exception (and long stack trace) when attempting to start
my weblogic server. I'm running Weblogic 7 with Portal 7 (sp 1). I'm
using Oracle 8.1.7. I upgraded this application from weblogic portal
4.0, and never had this problem there. As part of the migration process,
I ran the tool to migrate all of the database tables, and I re-synched
the EBCC project using version 7 of EBCC. I did a search for this problem
and found a few mentions of it that seemed to be related to Oracle's
handling
of CLOB data. Apparently, there is a patch, but I can't seem to find
this patch. I'm also not sure if this is indeed the problem since I
didn't have this issue with the older version of weblogic using the
same database. Any suggestions? -
Query regarding G/LAccounts in psoting
Hi Experts,
I have one query regarding PCP0.
After executing PCP0,If We double click on the posting document we can see the number of G/L accounts in that posting Document.If we double click on each G/L Account it shows all the revision information indetail for all payments cumulated into that particular G/L Account.
Some of the G/L's are appearing as single line in the posting document and if we double click for the revision information it is showing all the Wagetypes with personnel numbers and the total of each wagetype.
Some of the G/L's we can see Multiple times for each individual.
Can any one please explain where does we set up the the revision information for the G/L Accounts .
Appreciate If anyone can help to know this information.
Thanks & Regards,
Sandhya.Hi Gopal,
Counting class are assigned to the Periodic work Schedule 1 to 9 are just arbitart sequence numbers and have no meaning in general they are used for linking Pweriodic Work schedules with differences.
You can use the class for absence and attendance counting to specify different methods of counting according to the period work schedule.
They have no other meaning apart from that.
Thanks and Regards
Swati -
Query regarding Crystal Reports Server
Hi,
I am new to Crystal Reports.
I have created a couple of .rpt files using CR2008 and I am loading these report files in my aspx pages using CrystalReportViewer control.
I am planning to host my webApp on IIS in production environment. Maximum simultaneous/concurrent connections to my reports would be 1 or 2.
My question is:
1. Do I need Crystal Reports Server in this scenario?
2. In future if the number of concurrent users to report increases then do I need to go for Crystal Reports Server? Will just buying and installing the Crystal reports server on production server work? or will I have to do some configuration or some other changes in the existing deployed reports? OR Will I have to deploy my existing reports on Crystal Report Server again?
Any help will be highly appreciated.
Thanks in advance,
ManishManish, please do not cross post:
Query regarding Crystal Reports Server
See the [Rules of Engagement|http://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] for more details.
Marking this thread as answered and locking...
- Ludek -
Query regarding updating rows in JTable
Query regarding updating rows in JTable
Hello,
I have a JTable with 6 columns and 1000s of rows (which are data read from flat files)
I can select 1 or more rows and change the values of the
columns. each time I do this I need to update the values
in the flat file.
Currently I assign the updated Jtable values to a vector
Vector rowVector = (Vector)defaultModel.getDataVector();
then I iterate over the vector and compare the values with the (old) data
in the JTable.
for(int rowCount = 0; rowCount<rowVector.size(); rowCount++){
Vector v = (Vector)rowVector.elementAt(rowCount);
//smsList is the Vector that contains the old JTable values
for(int i=0; i<smsList.size(); i++){
//If colums values have been changed; add that
//vector value to another vector
selectedsmsList.add(smsList.get(i));
for(int i=0; i<selectedsmsList.size(); i++){
//Update the values in the flat file
}This works fine except that it takes ages to iterate over the updated vecor and un-updated,old vector; is there any way to directly get the list of rows that were updated in the jtable; so that I can directly do an I/O operation to update the jtablke values?Just a suggestion.
You could add a listener and use a vector of booleans to keep track of the rows that have been changed. You could then iterate through this boolean vector and update the changed rows.
See
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#modelchange
Don't know whether this will be helpful.
Regards, Darryl -
Query regarding Treenode expansion
hi all,
I have a query regarding the expansion of a tree node.When i click at a tree node it is not expanding.Only when i click on the image to expand it is expanding.I tried with tree's Expand on select property but it is not working.can anyone help me please....
Thanks in advance
SreeHi ,
Have you tried the tutorials tech atricles in this area?
see
http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/tree_component.html
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/sitemaptree.html
This will help you learn using tree nodes.
Thanks
K -
Hello Experts,
I have one output type for sales documents. I am able to successfully trigger it for credit/debit memos but when I try to trigger it for standard orders then I am getting "Output not defined" error. Can anybody please tell me where in the config we can define output types for sales document types.
I have one more query. While trying to trigger one billing document output I am getting "Update Terminated" error. But for same billing document I am able to trigger other output types. If "Update Terminated" error is coming due to number range then should it not be coming for all output types since there is no output type specific number range defined.
Regards,
KaranHi,
please check the configuration settings
IMG-sales & distribution-basic functions-output control-output determination-output determination using the condition technique-maintain output determination for sales documents.
1. create condition table . Key combination for maintaining condition record.
2. access sequence. assign condition table to access sequence.
3. ouput condition type. Select appropriate for inquiry, quotation or sales order. Assign the access sequence to the ouput type.
4.ouput determination procedure. Here you assign the output type to this procedure.
5. assign output determination procedure. Assign the procedure at header level if you want full document ouput. Assign the procedure at Item category level if you want item level output.
6. VV11 - create condition records for sales document types or VV31 for billing document types.
create the order or billing document and see the result.
Regards,
csv -
Hi,
I want to create a query which gives me the information of employees who filled the timesheet for specific dates. It should should also return records of those dates for which employee do not entered any hours at all. Below dummy records will clear you my requirement.
I have an EMP table. Following are the records for specific date range [Range of 2 weeks] :-
select ename, hiredate, to_char(hiredate, 'Day') Day, to_char(hiredate, 'D') WeekDay
from emp
where hiredate between '16-Feb-81' and '27-FEB-81';
ENAME HIREDATE DAY W
AJEET 16-FEB-81 Monday 2
PRASHANT 26-FEB-81 Thursday 5
AJEET 23-FEB-81 Monday 2
PRASHANT 25-FEB-81 Wednesday 4
DEEPAK 21-FEB-81 Saturday 7
ALLEN 20-FEB-81 Friday 6
WARD 22-FEB-81 Sunday 1
7 rows selected.
I filtered those records which shows Saturday and Sunday. Because I don't want records of Weekend, only week days data [Monday to Friday] is required
Following records excluded Saturday and Sunday:-
select ename, hiredate, to_char(hiredate, 'Day') Day, to_char(hiredate, 'D') WeekDay from emp
where hiredate between '16-Feb-81' and '27-FEB-81'
and (to_char(hiredate, 'D') != 1 and to_char(hiredate, 'D') != 7);
ENAME HIREDATE DAY W
AJEET 23-FEB-81 Monday 2
PRASHANT 25-FEB-81 Wednesday 4
ALLEN 20-FEB-81 Friday 6
Finally following query will give those dates for which employee actually filled the timesheet and it will also return me those records for which each employee does not make any entry in table:-
See more detail after query result:
select ename, hiredate, to_char(hiredate, 'Day') Day, to_char(hiredate, 'D') WeekDay from emp
where ename in ('AJEET', 'PRASHANT')
and hiredate between '16-Feb-81' and '27-FEB-81'
and (to_char(hiredate, 'D') != 1 and to_char(hiredate, 'D') != 7)
union
select e.ename, x.hiredate, NULL, NULL
from emp e, (select (to_date('16-Feb-81')-1) + rownum hiredate from dual
connect by level <= (to_date('27-FEB-81') - to_date('16-Feb-81')) + 1) x
where e.ename in ('AJEET', 'PRASHANT')
and e.hiredate != x.hiredate
and (to_char(e.hiredate, 'D') != 1 and to_char(e.hiredate, 'D') != 7)
and (to_char(x.hiredate, 'D') != 1 and to_char(x.hiredate, 'D') != 7)
and e.hiredate between '16-Feb-81' and '27-FEB-81';
ENAME HIREDATE DAY W
AJEET 16-FEB-81 Monday 2
AJEET 16-FEB-81 / Should be ignored from output */
AJEET 17-FEB-81
AJEET 18-FEB-81
AJEET 19-FEB-81
AJEET 20-FEB-81
AJEET 23-FEB-81 Monday 2
AJEET 23-FEB-81 / Should be ignored from output */
AJEET 24-FEB-81
AJEET 25-FEB-81
AJEET 26-FEB-81
AJEET 27-FEB-81
PRASHANT 16-FEB-81
PRASHANT 17-FEB-81
PRASHANT 18-FEB-81
PRASHANT 19-FEB-81
PRASHANT 20-FEB-81
PRASHANT 23-FEB-81
PRASHANT 24-FEB-81
PRASHANT 25-FEB-81 Wednesday 4
PRASHANT 25-FEB-81 / Should be ignored from output */
PRASHANT 26-FEB-81 Thursday 5
PRASHANT 26-FEB-81 / Should be ignored from output */
PRASHANT 27-FEB-81
24 rows selected.
If you see AJEET has valid entry for 16-FEB-81 and 23-FEB-81. PRASHANT has valid entry for 25-FEB-81 and 26-FEB-81. But if you see there are two marked records* for each [AJEET and PRASHANT] are wronly printed here. These records are already return from first part of above query (above UNION clause), So these should be repeate from second part of that query (below UNION clause).
Finally, query output should ignore marked records. Please suggest me what changes are required in above query to get the expected output.
Expected Output
===========
ENAME HIREDATE DAY W
AJEET 16-FEB-81 Monday 2
AJEET 17-FEB-81
AJEET 18-FEB-81
AJEET 19-FEB-81
AJEET 20-FEB-81
AJEET 23-FEB-81 Monday 2
AJEET 24-FEB-81
AJEET 25-FEB-81
AJEET 26-FEB-81
AJEET 27-FEB-81
PRASHANT 16-FEB-81
PRASHANT 17-FEB-81
PRASHANT 18-FEB-81
PRASHANT 19-FEB-81
PRASHANT 20-FEB-81
PRASHANT 23-FEB-81
PRASHANT 24-FEB-81
PRASHANT 25-FEB-81 Wednesday 4
PRASHANT 26-FEB-81 Thursday 5
PRASHANT 27-FEB-81
20 rows selected.
Thanks and Regards,
Rohit Jain
Edited by: user2081225 on Jun 30, 2009 7:47 AM
Edited by: user2081225 on Jun 30, 2009 7:48 AMThanks dear, to bring this point up. Now it will be more clear and readable. Please see below:-
Note:- Each sets of curly braces represents data of each column.
I want to create a query which gives me the information of employees who filled the timesheet for specific dates. It should should also return records of those dates for which employee do not entered any hours at all. Below dummy records will clear you my requirement.
I have an EMP table. Following are the records for specific date range Range of 2 weeks :-
select '('||ename||')' Ename, '('||hiredate||')' Hiredate, '('||to_char(hiredate, 'Day')||')' Day, '('||to_char(hiredate, 'D')||')' WeekDay
from emp
where hiredate between '16-Feb-81' and '27-FEB-81';
ENAME HIREDATE DAY WEE
(AJEET) (16-FEB-81) (Monday ) (2)
(PRASHANT) (26-FEB-81) (Thursday ) (5)
(AJEET) (23-FEB-81) (Monday ) (2)
(PRASHANT) (25-FEB-81) (Wednesday) (4)
(DEEPAK) (21-FEB-81) (Saturday ) (7)
(ALLEN) (20-FEB-81) (Friday ) (6)
(WARD) (22-FEB-81) (Sunday ) (1)
7 rows selected.
I filtered those records which shows Saturday and Sunday. Because I don't want records of Weekend, only week days data Monday to Friday is required
Following records excluded Saturday and Sunday:-
select '('||ename||')' Ename, '('||hiredate||')' Hiredate, '('||to_char(hiredate, 'Day')||')' Day, '('||to_char(hiredate, 'D')||')' WeekDay from emp
where hiredate between '16-Feb-81' and '27-FEB-81'
and (to_char(hiredate, 'D') != 1 and to_char(hiredate, 'D') != 7);
ENAME HIREDATE DAY WEE
(AJEET) (16-FEB-81) (Monday ) (2)
(PRASHANT) (26-FEB-81) (Thursday ) (5)
(AJEET) (23-FEB-81) (Monday ) (2)
(PRASHANT) (25-FEB-81) (Wednesday) (4)
(ALLEN) (20-FEB-81) (Friday ) (6)
Finally following query will give those dates for which employee actually filled the timesheet and it will also return me those records for which each employee does not make any entry in table:-
See more detail after query result:
select '('||ename||')' Ename, '('||hiredate||')' Hiredate, '('||to_char(hiredate, 'Day')||')' Day, '('||to_char(hiredate, 'D')||')' WeekDay from emp
where ename in ('AJEET', 'PRASHANT')
and hiredate between '16-Feb-81' and '27-FEB-81'
and (to_char(hiredate, 'D') != 1 and to_char(hiredate, 'D') != 7)
union
select '('||e.ename||')', '('||x.hiredate||')', '('||NULL||')', '('||NULL||')'
from emp e, (select (to_date('16-Feb-81')-1) + rownum hiredate from dual
connect by level <= (to_date('27-FEB-81') - to_date('16-Feb-81')) + 1) x
where e.ename in ('AJEET', 'PRASHANT')
and e.hiredate != x.hiredate
and (to_char(e.hiredate, 'D') != 1 and to_char(e.hiredate, 'D') != 7)
and (to_char(x.hiredate, 'D') != 1 and to_char(x.hiredate, 'D') != 7)
and e.hiredate between '16-Feb-81' and '27-FEB-81';
ENAME HIREDATE DAY WEE
*(AJEET) (16-FEB-81) () () /* It should be ignored */
(AJEET) (16-FEB-81) (Monday ) (2)
(AJEET) (17-FEB-81) () ()
(AJEET) (18-FEB-81) () ()
(AJEET) (19-FEB-81) () ()
(AJEET) (20-FEB-81) () ()
*(AJEET) (23-FEB-81) () () /* It should be ignored */
(AJEET) (23-FEB-81) (Monday ) (2)
(AJEET) (24-FEB-81) () ()
(AJEET) (25-FEB-81) () ()
(AJEET) (26-FEB-81) () ()
(AJEET) (27-FEB-81) () ()
(PRASHANT) (16-FEB-81) () ()
(PRASHANT) (17-FEB-81) () ()
(PRASHANT) (18-FEB-81) () ()
(PRASHANT) (19-FEB-81) () ()
(PRASHANT) (20-FEB-81) () ()
(PRASHANT) (23-FEB-81) () ()
(PRASHANT) (24-FEB-81) () ()
*(PRASHANT) (25-FEB-81) () () /* It should be ignored */
(PRASHANT) (25-FEB-81) (Wednesday) (4)
*(PRASHANT) (26-FEB-81) () () /* It should be ignored */
(PRASHANT) (26-FEB-81) (Thursday ) (5)
(PRASHANT) (27-FEB-81) () ()
24 rows selected.
If you see AJEET has valid entry for 16-FEB-81 and 23-FEB-81. PRASHANT has valid entry for 25-FEB-81 and 26-FEB-81. But if you see there are two marked records* for each AJEET and PRASHANT are wronly printed here. These records are already return from first part of above query (above UNION clause), So these should be repeate from second part of that query (below UNION clause).
Finally, query output should ignore marked records. Please suggest me what changes are required in above query to get the expected output.
Expected Output
===========
ENAME HIREDATE DAY WEE
(AJEET) (16-FEB-81) (Monday ) (2)
(AJEET) (17-FEB-81) () ()
(AJEET) (18-FEB-81) () ()
(AJEET) (19-FEB-81) () ()
(AJEET) (20-FEB-81) () ()
(AJEET) (23-FEB-81) (Monday ) (2)
(AJEET) (24-FEB-81) () ()
(AJEET) (25-FEB-81) () ()
(AJEET) (26-FEB-81) () ()
(AJEET) (27-FEB-81) () ()
(PRASHANT) (16-FEB-81) () ()
(PRASHANT) (17-FEB-81) () ()
(PRASHANT) (18-FEB-81) () ()
(PRASHANT) (19-FEB-81) () ()
(PRASHANT) (20-FEB-81) () ()
(PRASHANT) (23-FEB-81) () ()
(PRASHANT) (24-FEB-81) () ()
(PRASHANT) (25-FEB-81) (Wednesday) (4)
(PRASHANT) (26-FEB-81) (Thursday ) (5)
(PRASHANT) (27-FEB-81) () ()
20 rows selected.
Thanks and Regards,
Rohit Jain -
Regarding Exceptions in Reporting!!!
Hi BI Experts,
Is there any way to get or change the available colors in Exceptions on a query.
I mean it gives three colors for exception reporting Green, Yellow and Red, but instead I want Green, <b>Blue</b> and Yellow.Hi Arun,
You can change the color of exception at workbook level not query level.
Please go through this Bhanu Gupta Post,
Customizing color for defined exceptions
and
Re: regarding exceptions
if it is useful assign points
Regards,
Senthil -
Hi all,
I have a query regarding the Pagination in the table component.I have a table and this table has been paginated with size 5. I am using an ObjectListdataprovider for populating data in table.Here i populate the ObjectList from another page and show it here in another page.Here we can chane the data.when i am clicking on the save it only considering the first 5 values dat is currently showing.This thing happens only when i didn't go the the second page using page navigation buttons.That is it ony saves the data that got focus.Can anyone have any solution?Please help me..
Thanks and Regards
SreeDo you have a message group component on the page to display runtime errors?
Did you check the server log (right-click Deployment Server and choose View Server Log) to see if any errors show up there?
Do you have any table colomn components bound to non-string fields? If so, did you drop the right type of converters on those components? -
Query regarding updation thru a Procedure
Hi,I have a query regarding updation.
1.I invoke a procedure in Oracle called submit thru my Java application.
The submit procedure saves the XML data in the database
and displays this data in a Front End GUI.
2. Now,I make a change in my Java application by adding new elements to the same row.This row now contains additional XML elements.
I would like to display the new row with the new elements in the GUI.
What is a better option for doing the above?
1.Delete the row being shown,save the new row with the changes in the database,and re display it?
2.Or,Update the row dynamically and refresh?
Any suggestions
Thanks,Hi,I have a query regarding updation.
1.I invoke a procedure in Oracle called submit thru
my Java application.
The submit procedure saves the XML data in the
database
and displays this data in a Front End GUI.
2. Now,I make a change in my Java application by
adding new elements to the same row.This row now
contains additional XML elements.
I would like to display the new row with the new
elements in the GUI.
What is a better option for doing the above?
1.Delete the row being shown,save the new row with
the changes in the database,and re display it?
2.Or,Update the row dynamically and refresh?
Any suggestions
Thanks,If you delete (it seems to me yours this process is regular and frequent) and re insert the new updated one record then High water mark will cause to scan yours table which may cause to degrade the performance.AFAIK you should go with update.But hold down dont implement it as i suggested lets see what are others solution here which may be more precious then mine.
Khurram
Maybe you are looking for
-
Change background color of a selected line of text in textfield
I have a list of items in a dynamic text field. When a line is clicked I would like to highlight it, or change the background color. Any ideas?
-
Hi, Just a quick question. I have a form in which one page is supposed to be hidden by default.When a user clicks yes on the first page of the form,the hidden page is supposed to be visible.If they click no,it remains hidden.I am using a template and
-
"java.lang.OutOfMemoryError: Java heap space" when comparing files
Hi, I need to take differences between the existing jazn-data.xml and the jazn-data.xml file downloaded from ADR and keep only the required changes. For this, I copied the contents of the new jazn file into the existing one and then tried to use the
-
Hello. This may be more of a general hardware issue, but I am posting this here because it may be a problem with Arch. So anyway I am using a computer with a G41MT-S2PT motherboard and an Audigy Fx soundcard. I bought the sound card because the sound
-
Install from external DVD drive
can i install Tiger from my external DVD firewire drive? how would i do this, it is my Imac G3 600 and it does not have a DVD drive built in. Xelapond