Conflicting Condtions within HR Database
We are trying to produce a report that will identify the number of leavers (that are paid by the organisation as defined by their previous Assignment Status derived by a function in the EUL AND a termination status/date between parameter start and end date) AND the number of people still working in a particular group within a hierarchy meeting a different set of conditions (Band <> 'Grades', Assignment status in (x,y,z). The hierarchy is defined by a number of caluclulations in the EUL.
e.g
Dept. Overall (Dept Core + Dept. Agencies) | Turnover | No. of Staff Turnover %
Dept. Core
Group 1
Group 2
Dept. Agencies
Agency 1
Agency 2
Non Core 1
Non Core 2
Not surprisingly this has not been an easy task and so far we have been unable to achieve this. Is this possible or should we just give the data for leavers and then get the users to compare this data with the output of a separate staff in post report?
Hi,
You can produce complex reports such as this in Discoverer, but you will probably need to create some views in the database. You could create a view specific to this report, but with this approach you can end up with a lot of views to maintain. Sometimes summary views containing statistics for the organisation, for example, number of leavers for each group, is the best approach. Then the summary views can be used in many reports. However, it all depends on the total reporting requirements.
Rod West
Similar Messages
-
Cross Reference within external Database using XREF API
Hi Experts,
Can we do Cross Reference within external Database using XREF API uses JDBC to access the Oracle Database Stored Procedures in SAP PI? How to use a JNDI Data source to access the DB and how to do the Connection Pooling will be done by the SAP J2EE server? Kindly let me know step by step proceedings.
Regards
ArchanaHello Archana,
It can be done with a Lookup call in a mapping.
Here's a little article about the topic in the SAP wiki:
http://wiki.sdn.sap.com/wiki/display/XI/HowtouseCrossReferencewithinexternal+Database
With kind regards
Sebastian -
Hii all,
I have a subscription which used to send report email daily 10 am morning
now today it does not sent an email the status i s showing above error message ..
why this occurs ?? at the time of subscription running time ??
i have checked there is not error of subscription it runs fine ..
only today errored ..
Kindly , help me
Dilip Patil..Hi Dilip,
Based on the error message "An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database." it seems the issue is caused by the Report Server catalog databases are
corrupted.
To fix this issue, I suggest that you use the Reporting Services Configuration Manager to recreate the Report Server catalog databases. In addition, please make sure report server instance can connect to the report server database. For more details about Configure
a Report Server Database Connection (SSRS Configuration Manager), please see the following document:
http://msdn.microsoft.com/en-IN/library/ms159133.aspx
Besides, if the issue is caused by the connection to the SQL Server Reporting Services Report Server catalog database is timeout. Please refer to the following thread:
http://social.technet.microsoft.com/Forums/en-US/db4ca6c2-5445-4ff9-9f63-e20f3859cc70/error-throwing-microsoftreportingservicesdiagnosticsutilitiesreportserverstorageexception-an?forum=sqlreportingservices
If the problem is still existed, I would appreciate it if you could give us detailed error log, it will help us move more quickly toward a solution.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Hi,
I have started getting this error since a week now when I try to schedule a report or change a schedule of a report.
An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. (rsReportServerDatabaseError) Get Online Help For more information about this error navigate to the report
server on the local server machine, or enable remote errors
We have SQL Server 2008 installed along with SSRS running on the server. I have never seen this happening before for almost a year now but suddenly it appeared. Along with this, report subscription is also messed up and some report are not been
emailed as they have a error like:
Failure sending mail: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.Mail will not be resent.
I am not sure what caused this but if anyone has any idea of what is going on it will be great.
Thanks you for your help.
Please reply soooon !!!Rich, hi, sorry for my english but I speak spanish...
Well, I was tried to recreate this issue and is really hard to recreate, however and as a rain from the sky, one of my customers receive the same error that you have, reviewing Windows Logs and SQL Traces there is nothing.
Just for discard security issues I decide to change permissions in my server.
1. Go to SQL Server Reporting Services Configuration Manager
2. Go to Databases
3. Verify the credentials used to connect to the database server
4. Go to your database server
5. Look for the login or user that is being used to connect to the database server from SSRS
6. Change the role of that user and convert it to Sysadmin (Relax, this is not the final solution)
7. Try again (Is not necesary to restart ANYTHING)
8. Now, your SSRS and Subscriptions must work fine
9. If your SSRS and subscriptions are working ok, you have to give some permissions to the user
10. Grant execute permissions on
master.dbo.xp_sqlagent_notify
master.dbo.xp_sqlagent_enum_jobs
master.dbo.xp_sqlagent_is_starting
msdb.dbo.sp_help_category
msdb.dbo.sp_add_category
msdb.dbo.sp_add_job
msdb.dbo.sp_add_jobserver
msdb.dbo.sp_add_jobstep
msdb.dbo.sp_add_jobschedule
msdb.dbo.sp_help_job
msdb.dbo.sp_delete_job
msdb.dbo.sp_help_jobschedule
msdb.dbo.sp_verify_job_identifiers
11. Grant select permissions on
msdb.dbo.sysjobs
msdb.dbo.syscategories
12. Grant public role to the user in the MSDB and Master DB
13. Remove the Sysadmin role to the user
14. Try again, now, your SSRS is ready to work
Regards
Pls let me know if work for you
Regards | John Bocachica | jboca.blogspot.com -
If I have an EntityBean that mappes to two tables within one database, when I create
that EJB, whoes reponsibilty to generate the primary key in database table? The
RDBMS or EJB?
Thanks,
JWRefer to http://e-docs.bea.com/wls/docs81/faq/ejb.html/#257430
"Jingwei Zhang" <[email protected]> wrote:
>
If I have an EntityBean that mappes to two tables within one database,
when I create
that EJB, whoes reponsibilty to generate the primary key in database
table? The
RDBMS or EJB?
Thanks,
JW -
Cloning Schema within same database in DG environment
Hi guys,
I have a Production database with Data Guard configured (2 physical standbys, one same DC, 2nd other DC). I need to clone a schema (size approx. 380GB) within the same database, ofcourse creating cloned schema with a new name.
Example:
======
Primary DB: wflprd
Standby 1: wflprddr1
Standby 2: wflprddr2
Source Schema: PegaRules - Size 380 GB
Desitnation Schema: NewSchema within same database
what are possible options available? expdp/impdp?
regards,
AnjumI believe my question is not understood correctly or may be I put the question incorrectly.
I understand expdp/impdp or exp/imp works but is this the only solution in case of large schema sizes and data guard in place.
log_archive_dest_1 = LOCATION=/u03/orarch/wflprd, valid_for=(ONLINE_LOGFILE,ALL_ROLES)
log_archive_dest_2 string service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=baswflprddatz02)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=wflprddr1_XPT)(INSTANCE_NAME=wflprddr1)(SERVER=dedicated)))", ARCH SYNC NO AFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="wflprddr1" register net_timeout=180 valid_for=(online_logfile,primary_role)
log_archive_dest_3 string service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=actwfldredatz01)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=wflprddr2_XPT)(INSTANCE_NAME=wflprddr2)(SERVER=dedicated)))", ARCH SYNC NO AFFIRM delay=1440 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="wflprddr2" register net_timeout=180 valid_for=(online_logfile,primary_role)
Objective: We have one big schema containing data of three different customers. We are segregating that big schema into different schemas, one for each customer. So, once schema is cloned within same database, irrelavent data is cleaned.
regards,
Anjum -
Deletion of data within the database tables
The user is trying to clean up the 2014 data within the database tables. He is running a delete function which keeps causing the log files
to exceed their limit. The tables are large and he is unable to delete the data in one command due to available size and logging. What is the best way to approach this?
Thanks,Hi venkatesh1985,
According to your description, the user fails to delete data in tables due to the limited space of log file. Based on my research, this issue could occur when you use the delete statement(DELETE FROM ExampleTable) in a single transaction and consume all
available space on your transaction log disk.
To avoid this issue, you could use the two methods below to delete the data.
1. Use a loop combined with TOP and delete rows in smaller transactions as the following example. This method requires you to delete all the tables one by one.
SELECT 1
WHILE @@ROWCOUNT > 0
BEGIN
DELETE TOP (1000)
FROM LargeTable
END
For more information about the process, please refer to the article:
http://dbadiaries.com/how-to-delete-millions-of-rows-using-t-sql-with-reduced-impact
2. If you want to delete all the data from all tables in the specific database, you could script the entire database and all database objects. Then drop the database and recreate it using the script as the steps below.
a. In Object Explorer, expand the node for the instance containing the database to be scripted.
b. Point to Tasks, and then click Generate Scripts and click Next.
c. Select the option of 'Script the entire database and all database objects'.
d. Specify how scripts should be saved. You could save the script to a file or new query window. Click Next, then click ok.
e. Drop the database, and run the script in the query window to recreate it. For more information, please refer to the article:
http://msdn.microsoft.com/en-us/library/bb895179.aspx#Introduction
In addition, if possible, please increase the size of the log file or move the log file to a different disk with more disk space.
Regards,
Michelle Li -
Call Class within the Database
I don't know if this is the right place to post, but. I'm trying to create an Applet that references a JAVA class stored in the database. My code looks something like this:
<applet code="Hello.class" codebase="http://www.somesite.com/pls/dad/" width="150" height="30"></applet>
Hello.class is stored within a 10g database. The codebase is a vitural url that connects to a schema within the database. Can this be done?? and How??Please elaborate. I believe the answer is yes, but it's not entirely clear what you mean.
- Phil -
Search for data within a database table
Hi everyone :)
I'm trying to make it so that the user can search for a record by id #. So, i made an input dialogue thing so the user can enter a record #. Basically, i want the data to appear in their textboxes based on the record # inputted by the user. My attempt is shown below, and when I run it, I get this:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Here's my code:
public JButton getSearch()
if (search==null)
search = new JButton("Search Database");
search.addActionListener
new ActionListener()
public void actionPerformed(ActionEvent ae)
try
String str_rec =
JOptionPane.showInputDialog(
getFrame(),"Enter Record No");
int recNo = 0;
try
recNo =
Integer.parseInt(str_rec);
catch (NumberFormatException nfe)
return;
String select = "SELECT studId,studFirstName,studLastName " +
"FROM Students " +
"WHERE studId = '" + recNo + "' ";
Statement statement = getConnector().getConnection().createStatement();
ResultSet result = statement.executeQuery(select);
System.out.println(recNo);
getView().getId().setText(str_rec);
getView().getFirstName().setText(result.getString("studFirstName"));
getView().getLastName().setText(result.getString("studLastName"));
catch (Exception e)
e.printStackTrace();
return search;
}I hope I explained everything properly. If you could please help me, I'd very much appreciate it.
Thanks in advance! :)
- spidey"WHERE studId = '" + recNo + "' ";Why are you putting quote marks around a number? What type of database column is studId? Probably a numeric type (not character), right? Quotes go around string/character stuff, not numeric stuff.
-
How to create an auto-filled in field within a database ?
Hello,
I look for a way to get a database field automatically filled in when adding a new record with a generated value:
The value of this field should consist of the actual date, a random alphanumerical or numerical string of five digits and some fix characters.
For example: 20060618-19771-test
"20060618" is the actual date in the format YYYYMMDD.
"19771" is the randomly generated numerical string (alternatively alphanumerical).
The two "-" and the string "test" are fix.
Does anyone have an idea how to realize this ?
Thank you for all your assistance.
With kind regards,
Tobias Eichner.Hi Tobias,
A much more useful post than the previous one liner.
The first problem you mention is the most difficult to get around using an entirely AppleWorks solution. AppleWorks does recalculate the whole database whenever a field definition is revised. The result of any calculation depending on the RAND() or NOW() functions Both Gunnar's and Francesco's solutions run into this problem as both use RAND() to generate the random number part of the field's value.
Yvan tackles this problem by calculating the value outside AppleWorks, using an AppleScript. This looks promising, but on running the script, I've noted a couple of problems (an error message when there's a single record in the DB; non-filling of the 'autofilled' field), and will drop a note to Yvan about these.
The most interesting (because easiest to implement)
one unfortunately depends upon the date formatting
set in the software which is different from the
desired field value.
My assumption here is that you're referring to Francesco's solution. The formatting problem (order of yyyymmdd and removal of the separators) is addressed in Gunnar's solution (which is essentially the same as Francesco's). See below for some revisions to address the recalculation problem.
And the first solution appears a bit too complicated
for me (sorry, I'm not a programmer, I tried to copy
it but failed).
The AppleScript solution is difficult to generate, but once written (by Yvan and/or others—you'll have only minor editing to do) and saved (by you) is simple to use (requires only selecting a menu item to create a new record with the field already filled).
If you can assist me, please let me know. Otherwise
don't mind, either I have to switch to a different
product (AW appears outdated in many ways) or
generate these field values manually as I currently
do (simplest solution but works
Switching to a different product is certainly a possibility, and it's true that AppleWorks is old software and that it is unlikely to ever be updated in future.
Revisions to Gunnar and Francesco's solutions:
As mentioned previously, the primary problem with these was instability of the value due to recalculation of the RAND() value in the formula. In the revised version below, a pseudo-random value is obtained by converting the time-of-day when the record was created to a text string, then selecting the final five characters in that string.
YEAR('Date')&RIGHT("00"&MONTH('Date'),2)&DAY('Date')&"-"&RIGHT('Time',5)&"-test"
The solution requires creation of two additional fields:
'Date' Type: Date, Options: "Insert current Date"
'Time' Type: Time, Options: "Insert current Time"
(The first is the same as Gunnar's 'helpfield1'.) Neither field has to be included in any layout; they exist only to provide data for the 'Autofill' field.
Advantages:
•The Date and Time fields are stable; once filled their values will not change. Consequently, the calculations depending (only) on the values in these fields will also be stable.
Disadvantages:
•The value in 'Time' is the fraction of the current day that has passed when the field is created. At certain specific times of day, this fraction, expressed as a decimal, will have fewer that 5 digits after the decimal (Example: at exactly 12:00 noon, the fraction is 0.5). That may lead to an error or to the center portion of the 'Autofill' data taking the form "-.5075-".
This will likely be a minor annoyance. Such a record may simply be deleted before entering any other data, and a new record created. Or the formula could be revised to strip the intial two characters ("0.") from the string, append the remainder to a string of five zeros, then take the final five characters of the result.
•The formula should be fine for NEW records. But for records already in existence when the formula and the two supporting fields are created, the Date and Time will be the date and time of creation of those fields. That will lead to a distinct lack of 'randomness' in the 'random' number part of the fields' value.
The solution, if necessary, is to add an IF() function to the formula that copies the value from the existing field if that field has been filled in, and generates the value if the existing field is empty (as it would be for a new record). The existing field should be removed from all layouts to prevent its being filled in new records, but should NOT be deleted from the DB in order to preserve existing data.
Revised formula (has not been tested) ('oldfield' is the field that holds the data in existing records):
IF(LEN('oldfield')>0,'oldfield',YEAR('Date')&RIGHT("00"&MONTH('Date'),2)&DAY('Da te')&"-"&RIGHT('Time',5)&"-test")
Regards,
Barry -
Hello
We just had this error today. We did not do ANY changes to our existing ReportServer database neither to our reports.
Our infrastructure - we have sharepoint 2010 and sql server 2008 r2 with reporting services installed.
I confirmed the following:
-->Disk space on database server OK:
-->ReportServer database not corrupted - I restored the database to my test server and ran DBCC CheckDB.
I am now looking at the Activity Monitor and have noticed that several SPID executed by the ReportServer database are blocked by a SPID executed by the ReportServerTempDB.
Would blocking be a possible cause to this problem?
Thank you all in advanceTake a look into this http://support.microsoft.com/kb/2146315
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Calling another database connection within a database connection
Dear All,
I am using an oracle form by connecting with oracle database and or runtime I have connected succesfully with ms sql server database wtih EXEC_SQL package. The syntax is as follows:
open connection with odbc
open cursor
parse ddl statement in the cursor
execute cursor
close cursor
close connection
All the above steps are working except the last one. while closeing the odbc connection it's giving internal errro.
So please show me how to disconnect succesfully through this package.
Thansk & Regards,
Habeeb.
[email protected]Dear All,
I am using an oracle form by connecting with oracle database and or runtime I have connected succesfully with ms sql server database wtih EXEC_SQL package. The syntax is as follows:
open connection with odbc
open cursor
parse ddl statement in the cursor
execute cursor
close cursor
close connection
All the above steps are working except the last one. while closeing the odbc connection it's giving internal errro.
So please show me how to disconnect succesfully through this package.
Thansk & Regards,
Habeeb.
[email protected] -
Determine if a date is active within a database?
Hey all. I'm trying to figure out a way to determine for 10 days if there was an active service on each day.
The service history data I have to look at is like so:
CUST ADDR ACTN DATE
1234 1234 IN 12/23/2007
1234 1234 READ 2/21/2008
1234 1234 READ 4/22/2008
1234 1234 OUT 6/23/2008
2345 1244 IN 3/6/2008
2345 1244 OUT 3/10/2008And what I want to do is determine if a customer was active from say 3/1/2008 - 3/10/2008. My current method was to query for dates on each day I'm trying to find out if service was active, and then building a string I can later run through a loop, but it seems like I'm making this way too complicated.
SELECT
fq.CUST
, fq.PREM
, fq.SRAT
, fq.PKUPDAY
, fq.START_DAY
|| (DECODE(SUBSTR(fq.IN_DAYS,1,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,1,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,1,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,2,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,2,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,2,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,3,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,3,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,3,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,4,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,4,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,4,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,5,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,5,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,5,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,6,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,6,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,6,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,7,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,7,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,7,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,8,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,8,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,8,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,9,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,9,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,9,1),'O','O','X')))
|| (DECODE(SUBSTR(fq.IN_DAYS,10,1),'I',DECODE(SUBSTR(fq.OUT_DAYS,10,1),'O','O','I'),DECODE(SUBSTR(fq.OUT_DAYS,10,1),'O','O','X'))) SVC_MAP
FROM
SELECT
bq.CUST
, bq.PREM
, bq.SRAT
CASE WHEN (bq.D_IN1 IS NOT NULL AND bq.D_OUT1 IS NOT NULL AND bq.D_IN1 <= bq.D_OUT1) THEN 'O' ELSE
CASE WHEN (bq.D_IN1 IS NOT NULL AND bq.D_OUT1 IS NOT NULL AND bq.D_IN1 > bq.D_OUT1) THEN 'I' ELSE
CASE WHEN (bq.D_IN1 IS NOT NULL AND bq.D_OUT1 IS NULL) THEN 'I' ELSE
CASE WHEN (bq.D_IN1 IS NULL AND bq.D_OUT1 IS NOT NULL) THEN 'O' ELSE
CASE WHEN (bq.D_IN1 IS NULL AND bq.D_OUT1 IS NULL) THEN 'X'
END
END
END
END
END
) START_DAY
CASE WHEN bq.D_IN2 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN3 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN4 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN5 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN6 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN7 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN8 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN9 IS NOT NULL THEN 'I' ELSE 'X' END
|| CASE WHEN bq.D_IN10 IS NOT NULL THEN 'I' ELSE 'X' END
) IN_DAYS
CASE WHEN bq.D_OUT2 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT3 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT4 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT5 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT6 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT7 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT8 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT9 IS NOT NULL THEN 'O' ELSE 'X' END
|| CASE WHEN bq.D_OUT10 IS NOT NULL THEN 'O' ELSE 'X' END
) OUT_DAYS
, bq.PKUPDAY
FROM
SELECT /*+ INDEX (UIMSMGR_02.UCRSERV UCRSERV_SRAT_CODE_INDEX UCRSERV_KEY_INDEX) */
db1.URRSHIS_CUST_CODE CUST
, db2.UCRSERV_PREM_CODE PREM
, db2.UCRSERV_SRAT_CODE SRAT
SELECT
MAX(sdb1.URRSHIS_ACTION_DATE)
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE <= TO_DATE('12/17/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN1
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/18/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/18/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN2
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/19/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/19/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN3
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/20/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/20/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN4
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/21/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/21/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN5
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/22/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/22/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN6
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/23/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/23/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN7
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/24/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/24/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN8
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/25/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/25/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN9
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'IN'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/26/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/26/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_IN10
SELECT
MAX(sdb1.URRSHIS_ACTION_DATE)
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE <= TO_DATE('12/17/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT1
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/18/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/18/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT2
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/19/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/19/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT3
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/20/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/20/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT4
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/21/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/21/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT5
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/22/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/22/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT6
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/23/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/23/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT7
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/24/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/24/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT8
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/25/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/25/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT9
SELECT
sdb1.URRSHIS_ACTION_DATE
FROM
URRSHIS sdb1
WHERE
sdb1.URRSHIS_ACTN_CODE = 'OUT'
AND sdb1.URRSHIS_CUST_CODE = db1.URRSHIS_CUST_CODE
AND sdb1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND sdb1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND sdb1.URRSHIS_STYP_CODE = 'GRES'
AND sdb1.URRSHIS_ACTION_DATE BETWEEN
TO_DATE('12/26/2007 00:00:00','mm/dd/yyyy hh24:mi:ss')
AND TO_DATE('12/26/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
) D_OUT10
, (CASE WHEN db2.UCRSERV_DAY_SU IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_M IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_TU IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_W IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_TH IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_F IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_SA IS NOT NULL THEN 'P' ELSE 'X' END) PKUPDAY
FROM
URRSHIS db1
, UCRSERV db2
WHERE
db2.UCRSERV_SRAT_CODE IN
SELECT
gr.UTVSRAT_CODE
FROM
UTVSRAT gr
WHERE
SUBSTR(gr.UTVSRAT_CODE,1,1) IN ('3','1')
AND SUBSTR(gr.UTVSRAT_CODE,-2) IN ('AB','BB','XB','AM','BM','XM')
OR
SUBSTR(gr.UTVSRAT_CODE,1,1) IN ('N','C')
AND gr.UTVSRAT_CODE != 'COFN'
AND db1.URRSHIS_PREM_CODE = db2.UCRSERV_PREM_CODE
AND db1.URRSHIS_SERV_NUM = db2.UCRSERV_NUM
AND db1.URRSHIS_ACTION_DATE <= TO_DATE('12/26/2007 23:59:59','mm/dd/yyyy hh24:mi:ss')
AND db1.URRSHIS_STYP_CODE = 'GRES'
GROUP BY
db1.URRSHIS_CUST_CODE
, db2.UCRSERV_PREM_CODE
, db2.UCRSERV_NUM
, db2.UCRSERV_STATUS_IND
, db2.UCRSERV_SRAT_CODE
, (CASE WHEN db2.UCRSERV_DAY_SU IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_M IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_TU IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_W IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_TH IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_F IS NOT NULL THEN 'P' ELSE 'X' END)
|| (CASE WHEN db2.UCRSERV_DAY_SA IS NOT NULL THEN 'P' ELSE 'X' END)
) bq
) fqOkay, so there's a bit more detail needed to understand what I'm trying to output.
There are also seven additional columns in the database for each day of the week, to indicate which day the customer has items picked up by the company. Ex:
CUST ... SU M TU W TH F SA
1234 ... X
1223 ... XWhat I want to do is pull this information, and then determine if the customer had service during a set time period (ex: 3/1 - 3/10), and then also determine if they had service on the pickup date. The goal is to charge accounts based on if they had an active pickup date during the time period (as some accounts might have been opened on 3/8, but because of the day of the week their pickup is on, they didn't actually have any service during that time and shouldn't be charged).
So in the end I just want the Customer # for the ones that should be charged. -
Sudo users within Oracle database
Hi, I know this might sound a little strange, but I thought someone might have been thru a similar situation, if not the same.
Our application has following users.
app0 (schema owner)
app0feed ( db account that is used to run feeds)
app0web ( db account used by the web app).
So when we clone our prod db for testing purposes, we want to be able to track individual users that are operating on these test databases.
We let users use app0, app0feed, app0web logins into these Test databases to do their work, running feeds etc, all these users don't have individual logins for these database so when they login to these test databases it's difficult for us to track the things that they do when they are dealing prod data.
Even though they login with app users we can easily identify them from the machine-name, program and other fields on v$session.
But I was wondering if there was anyway we can have them be themselves be able to do things as app0feed and app0web ( just like sudo on unix).
Where we sudo as Oracle to do DB admin related work on DB hosts.
Ofcourse I can grant all the privs that app0feed or app0web had to these individual users, but it's just duplicating things....so thought if there was anything similar to sudo, I have not come across any but thought someone might have had similar request.
Thanks in Advance
RamkiCentinul, It works like a charm when using this via SQLPLUS, but I am not sure how to use the connection string for Toad users.
$ sqlplus proxy_user[appuser]/proxy_user@DB
And also when using proxy users using JDBC there are some specific changes that are needed while making a JDBC connection using thin drivers.
OracleConnection conn = (OracleConnection) DriverManager.getConnection(
"jdbc:oracle:thin:pu_pool_user/pu_pool_user@localhost:1521:ora1012",
properties);
conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, properties);
this is a an exert from the following link.
http://www.it-eye.nl/weblog/2005/09/12/oracle-proxy-users-by-example/
These changes might be little hard to convince the Dev users to change their code when working with Test databases?.
Is there any way around this, without making code changes.
Thanks,
Ramki -
Does report generation possible frm 2 diff projects within single database
we have two seperate projects created in our eme DB. also we have few results present in first project say P1 and Few results are present in Project 2 say P2
Query is
Does it possible to generate Single report for P1 and P2?
if it is possible then this will be a big relief for us.
thanks
gajananpyes only if it is stored in the same database. If both projects results are stored in the same databse, you may view the crystal report graphs that is provided in addition to the built-in reports that is viewable using the report tab. To open the crystal report viewer, go to tools and select Crystal Report Viewer. So, once you have selected the report whose data you would like to see from both project, then click on Add Filters.
In the Add Filters popup, move all the projects you want from available to selected. Once you are completed adding filters, then click OK on the view report popup to render an html report with data from both the projects. Please let me know if this answer was helpful.
Maybe you are looking for
-
Right way for battery charging
Hi everybody! I bought an iPad Air when he was released. Surfing on Internet, I've heard conflicting opinions about the right way to charge the iPad (or the iPhone) to increase its battery life. What I want to ask is this: iit is true that once a mon
-
Why is my iMac running so slow and crashing all the time?
My iMac is last years model, running on Lion OS X. It's one year old, I had it Christmas 2011. It's 1TB with 4GB RAM. It's partitioned with Bootcamp, Windows 7, so it's 100GB Win7 and 900GB OS X. I'm only using 350GB of RAM altogether. It's started r
-
(nokia N8) Character encoding - reduced support (n...
I'm from Poland, and in my language i use special letters like ó,ż,ź,ą,ę. When i want write a massage and use one of above letters, my message is shorter 90 signs. In older Nokia's phone i change settings text messages (character encoding:full suppor
-
Cannot activate due to error in predecessor activity
Hi, The activity cannot be activated(moved to active workspace) as the predecessor activity results in compile error. I would like to remove the predecessor activity as it is not significant anymore and is rather a hindrance to my future activations.
-
Hi! I need help with my java programan and Access. I'm deploying a distributed program in Java. I'm storing some images in Access, in format .jpg. When I want to load these images in my Java client I don't Known how I can do it. I can see that Access