code or function to generate the next date of work for a given date
HelloFirst lets see the struncture table and the data in the table.
CREATE TABLE LT_CA_HOLIDAYS
(
HOLIDAY_DATE DATE NOT NULL,
IS_BANK_HOLIDAY CHAR(1 BYTE) NOT NULL,
DISPLAY_NAME VARCHAR2(35 BYTE) NOT NULL
)
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('12/25/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Christmas Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('01/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'New Years Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('01/17/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Martin Luther King Jr');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('02/21/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Washington s B-Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('05/30/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Memorial');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('07/04/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Independence Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('09/05/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Labor Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('10/10/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Columbus Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('11/11/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Verterans Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('11/24/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Thanksgiving Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('12/25/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Christmas Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('12/26/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Bank Observed Christmas');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('01/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'New Years Day');
Insert into LT_CA_HOLIDAYS
(HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
Values
(TO_DATE('01/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Bank Observed New Years Day');
COMMIT;
.The requirement goes something like this:
SATURDAY and SUNDAY weekend days ARE considered holidays.
The list of public holidays are in LT_CA_HOLIDAYS.
We will give a date as p_processdate.we need to check if the p_processdate is a holiday or a business day,
If p_processdate is a holiday, so we need to generate the next business day.
If p_processdate is a day's work, we have to check if p_processdate + 1 is a business day, IF p_processdate + 1 is a holiday then
We must generate the day following close p_processdate + 1.
Concerning
Hi Bro I edited by forum...
sending correct code
DECLARE
day_param date:=TO_DATE('07/01/2011','MM/DD/YYYY');
n_yes number;
BEGIN
LOOP
day_param:=day_param+1;
select count(*) into n_yes from LT_CA_HOLIDAYS WHERE TO_CHAR(HOLIDAY_DATE,'MM/DD/YYYY')=TO_CHAR(day_param ,'MM/DD/YYYY') ANd IS_BANK_HOLIDAY='Y' ;
IF(to_char (day_param,'DY') NOT IN ('SAT','SUN')) AND n_yes=0 THEN
EXIT;
END IF;
END LOOP;
DBMS_output.put_line('output'||day_param);
END;
output05-JUL-11
Tags: Database
Similar Questions
-
How to generate the array Diagnostic Utility ADU for Esxi server
How to run Diagnostic Utility ADU or HP Insight Diagnostics HP Insight Diagnostics table to collect the status tables and logs data FRO an Esxi Server
How to generate the array Diagnostic Utility ADU for Esxi server
Example:
Download the package .vib here: http://vibsdepot.hp.com/hpq/feb2013/esxi-5x-vibs/hpacucli/hpacucli-9.40-12.0.vib
and place it on a store of data seen by the host...
Install it using the CLI:
software esxcli vib install d vmfs/volumes /
/hpacucli-9.40-12.0.vib Now run it:
~ # cd/opt/hp/hpacucli/bin
/ opt/HP/hpacucli/bin # . / hpacucli
HP Array Configuration Utility CLI 9.40.12.0
Detection of controllers... Fact.
Type 'help' for a list of supported commands.
Type "exit" to close the console.
=> ctrl all diag file=/tmp/my_ADUreport.zip ris = on = on zip xml = on
Generation of diagnostic report... done
-Online output
/ opt/HP/hpacucli/bin #.
my_ADUreport.zip in / tmp can now be downloaded from the host...
It could be that useful...
/ Rubeck
-
Hi all
- I installed E-mail Feature Pack 4.1 extensibility 6.2 PLM.
- I use "GSMEmailFileBasedVariablesFormatPluginFactory" to send e-mail notifications when work flowing from one status to another.
- I am successfully able to generate notifications by e-mail for all GSM specifications with the content specified by me except the master specifications.
"@specTypeName @" placeholder for extensibility of the Email does not work for the specifications of the master.
Can you please help me solve the problem?
FYI,.
' @specTypeName @ ' placeholder works in all other GSM specifications.
Thank you
Nefertari
For the resolution of this problem, please see the following knowledge base document:
Document 2079386.1 - Notifications by email for the specifications of the master only lack the Type of specification field
Thank you
Stephen, Oracle Support
-
original title: the computers of network/administrator password
The administrator password for all computers on the network does not work for ONE of the computers on the network. I need to log on as an administrator to install software, but the password does not work. It works on other computers, but not this one. How is this possible and how can it be solved?
Hello
Microsoft technical support engineers cannot help you recover the passwords of the files and Microsoft who are lost or forgotten product features. For more information about this policy, please refer to the below sticky -
Several times after that I opened Google it does not connect to the internet. Has worked for a long time, and now it will not. Sometimes it opens if you "Refresh" sometimes not. Help, please. It has been stable over the years and now it will not work. I get no help when I diagnoise of problems, but I never. It has been checked and rechecked. PitStop does not even recognize a problem. I could change the homepage, but I prefer to use Google if it works. Frustrating.
You may need to update your toolbar, google has made some changes just about everything and possibly that the page is not where it used to be.
-
The blur tool. I can not get the blur tool to work for me.
The blur tool. I used Photoshop for photo editing until 2 years ago. I just started to use Photoshop again, and I can't get the blur tool to work for me. I just does not affect the pixels at all. I think I'm following the correct process for click on the blur tool and then configure the brush to do my procedure of blur. Help, please.
Hi Robert,.
Please do not forget that you work directly on the layer on which is the image you want to blur. Where you work on an empty layer, make sure that your auto to check the ' sample all layers ' (mine is unchecked) property in the top bar. Also, as has been suggested previously, check if the blending mode is set to normal.
If the problem persists, please let us know,
Kind regards
Martin Benes -
Help file XML generating the table data
Hello, I am new to generate XML and tried a host of options, including using variants of XMLELEMENT, XMLGEN and XMLDOM, all to nothing does not. I need to write code that will generate an XML file that will produce results such as below. Data will be taken from a table called cmdb_formatted_test and number of lines may vary. The code below seems to work almost however I get an error "not enough values. The select works if I don't mean to put the clob data in the variable.
[code]
DECLARE
l_file_name VARCHAR2 (30);
l_file_path VARCHAR2 (200);
l_xmldoc CLOB.
BEGIN
l_file_path: = 'cmdb_dir ';
l_file_name: = 'TEST_XML.xml ';
Select xmlelement ("xmlns:ns1 = 'CILoad' ns1:CIList'),
XMLELEMENT ("ns1:ConfigurationItem", XMLATTRIBUTES (c.transactionID, c.action),
XMLELEMENT ("ns1:RequiredElements",
XMLELEMENT ("ns1:AssetTag", c.assettag)
XMLELEMENT ("ns1:CIName", c.ciname)
XMLELEMENT ("ns1:FdaStatus", c.fdastatus)
XMLELEMENT ("ns1:OwnerGroup", c.ownergroup)
XMLELEMENT ("ns1:OwnerPerson", c.ownerperson)
XMLELEMENT ("ns1:SoxCritical", c.soxcritical)
XMLELEMENT ("ns1:Status", c.status)
XMLELEMENT ("ns1:Type", c.type)
) like"ADDITIONS".
). getclobval()
in l_xmldoc
of cmdb_formatted_test c;
dbms_xslprocessor.clob2file (l_xmldoc, l_file_path, l_file_name, nls_charset_id ('UTF8'));
END;
/
[/ code]
Need for XML output is attached
You don't have to try things at random, all of this is well documented, with examples:
Generate XML from the database data
Your query, although not correct, returns two columns. That's why Oracle is complaining when you try to search in a single variable.
Not tested, but the following should be close to what you want:
DECLARE l_file_name varchar2(30) := 'TEST_XML.xml'; l_file_path varchar2(30) := 'CMDB_DIR'; -- you probably want uppercase here l_xmldoc clob; BEGIN select '' || xmlserialize(document xmlelement("ns1:CIList" , xmlattributes('CILoad' as "xmlns:ns1") , xmlagg( xmlelement("ns1:ConfigurationItem" , xmlattributes( c.transactionID as "transactionID" , c.action as "action" ) , xmlelement("ns1:RequiredElements" , xmlelement("ns1:AssetTag", c.assettag) , xmlelement("ns1:CIName", c.ciname) , xmlelement("ns1:FdaStatus", c.fdastatus) , xmlelement("ns1:OwnerGroup", c.ownergroup) , xmlelement("ns1:OwnerPerson", c.ownerperson) , xmlelement("ns1:SoxCritical", c.soxcritical) , xmlelement("ns1:Status", c.status) , xmlelement("ns1:Type", c.type) ) , xmlelement("ns1:OptionalElements", null) ) ) ) as clob ) into l_xmldoc from cmdb_formatted_test c ; dbms_xslprocessor.clob2file(l_xmldoc, l_file_path, l_file_name, nls_charset_id('AL32UTF8')); END; /
-
request to get the next date which is not a public holiday
Hello world
I need help for a query. consider the following data
holiday
-------------
SELECT To_Date('12/28/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('08/31/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('05/25/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('05/04/2015','mm/dd/yyyy') double holiday
curr_DATE
-----------
SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/24/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/23/2015','mm/dd/yyyy') double holiday
data of curr_date are the main table. given a date, I want to join the vacation and the date of the Curr so that the result will be a date that is not a holiday. for example, what gives 28 Dec. the next available in curr_date < 28 dec date is dec 25. However, dec25th is a holiday on the guest table if the output should be dec 24.
Another example is the following: given dec 25 date, the previous date, unless that Dec. 25 is dec 24th dec 24 is not in the host table output should therefore be dec 24.
Another example: I'll add another line to the curr_date table. If the data will look like this
curr_DATE
-----------
SELECT To_Date('12/28/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/24/2015','mm/dd/yyyy') double holiday
UNION ALL
SELECT To_Date('12/23/2015','mm/dd/yyyy') double holiday
given dec 29, the next available in curr_date date is less than 29 dec 28 dec. However, dec28th is holiday in the host table. the next available date is dec 25 in curr_date, but once again dec25 in the host table. the next available date is 24, but this date is not in the host table output should therefore be 24/12/2015.
So basically I want to do this in the query by joining the two tables. can anyone help? pl/sql is ok if it cannot be done using quries.
Hello
If you want to use a join, here's one way:
SELECT MAX (c.holiday) AS last_non_holiday
OF curr_date c
LEFT OUTER JOIN holiday h ON h.holiday = c.holiday
WHERE c.holiday< to_date="" (:cutoff_date,="">
AND h.holiday IS NULL
;
-
Impossible to find a solution to control the next dates on multiple instances of the entity.
Hello
I have a simple scenario. I have two instances of an entity that match two records of a component of bussiness in Siebel. I need to put a validation that the date of the end of an instance is the eve of the start date of the other.
Using the functions Nextdate() etc. can be useful within the same instance, but the way to check on multiple instances?
Any suggestion is welcome.
If you want to exclude from the last instance, there are two options. You can set a Global attribute to the start date of the last session, for example
the date of beginning of last session = InstanceMaximum (sessions, the start date of the session)
... then use this attribute as a filter in your other rules. If there are some things where you want to run the logic on the same subset of instances (e.g., the subset that excludes the last instance), then it might be useful to create an inferred relationship:
1. in the properties file, create one-to-many relationship overall to the session. (Relationships that will be deducted must always be on many-to-many.)
2. give the new relationship a unique and descriptive name for example 'the sessions (excluding the last session) '.
3. write a membership rule to determine which instances of the entity are part of the new relationship, for example
the session is a member of the sessions (excluding the last session), if
start date of the session< the="" start="" date="" of="" the="" latest="">
4. When you want to redo the subset of instances of logic, use the relationship 'the sessions (excluding the last session)' rather than 'the sessions', for example
the end dates of the sessions are valid if
ForAll (sessions (excluding the last session), the session end date is certain)
Using the cross-entity argument version of my example above, the following rule could be set to TRUE:
the end dates of the sessions are valid if
ForAll (sessions (excluding the last session), the session end date is certain)
Whereas this rule would have the value FALSE:
the end dates of the sessions are valid if
ForAll (sessions, the closing date of the session is certain)
I hope that gives you enough to continue their career with your specific scenario!
See you soon,.
Jasmine
-
Moving the B2B Code from one instance to the next instance
Hi Alain,
I have a question to the moving code from the development environment to the next instance. For B2B operations, we did a lot of things in
B2B console as document defnitions, trading partners, listening to the channels. for your information, we do operations entering B2B for now.
As far as I know, we have the same configurations in the following SOA B2B Console instance as same trading partners, same channels listen,
same document defnitions everything. In our Application Composite BPEL, after obtaining the B2B adapter file, called an external Web Service and another local Web service. Can you please what exactly it takes to move the composite applications that involve the B2B as a Service adapter. I know configuration files must be added to the file of SAR while moving the code with Ant Scripts.But here in the plans of the config, I know that some hostname for external web services needs to be changed. And I do not know how to deal with B2B while moving the code. Please help as always!
Thank you
NGOHello, NGO,
You can export only the agreements that you want to move to next environments. It will include the profile information and document of the partner, but also the details of the contract. To do this, you can use the command line or console B2B -.
http://download.Oracle.com/docs/CD/E17904_01/integration.1111/e10229/b2b_imp_exp.htm#BABIGHGA
http://download.Oracle.com/docs/CD/E17904_01/integration.1111/e10229/scrpt_imp_exp_dep.htm#CEGIHBHBYou can consult the section "7.2, which is copied when you import or export from the import/export tab" link - below
http://download.Oracle.com/docs/CD/E17904_01/integration.1111/e10229/b2b_imp_exp.htm#BABIGHGA
So in the middle of the target, you only need to import the configuration using the command line or console B2B. It will automatically create partners, document definitions, agreements etc. After you import, change channel (like the connection details and certificates) details, the details of the contract if necessary (like TP identifiers) and deploy the agreements. You must also enable the channels look. Once the agreements are deployed, go with composite deployment.
Kind regards
AnujPublished by: Anuj Dwivedi on 12 Aug 2011 18:24
-
Retrieve data from PL/SQL block and generate the UNIX data file
Hi all
I comply the following Unix Shell Script code block. The following code was generated the file count_curdate.txt with all need info. The query gives the number of records, the partition_dt group
ABC ='sqlplus-s < < of folklore > count_curdate.txt
uname/paswd@ConnectString
SET THE OFF POSITION;
SELECT COUNT (*) | «, » || partition_dt of the XYZ group by partition_dt;
"exit";
END '
But now I need to change the above code to use dbms_application_info.set_module in it. Could someone let me know how to generate the file using PL/SQL in Shell Script block. I have tried following written code, but it generates count_curdate.txt file with 0 bytes.
ABC ='sqlplus-s < < of folklore > count_curdate.txt
uname/paswd@ConnectString
Set serveroutput on;
SET THE OFF POSITION;
Set feedback off;
BEGIN
DBMS_APPLICATION_INFO.set_module (' shm.ksh ',' get account per day ");
FOR again IN (SELECT COUNT (*):) «, » || partition_dt as 'DCount"of the XYZ of partition_dt group);
LOOP
DBMS_OUTPUT. Put_line (reccur. DCount);
END LOOP;
end;
/
"exit";
END 'Hello, your PL/SQL is not successfully completed, i.e.,.
This:
ABC=`sqlplus -s <
count_curdate.txt uname/paswd@connectstring set serveroutput on; SET HEADING OFF; set feedback off; BEGIN dbms_application_info.set_module ('shm.ksh','get count by day'); FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt); LOOP DBMS_OUTPUT.PUT_LINE(reccur.dcount); END LOOP; end; / exit; END` Should be this:
ABC=`sqlplus -s <
count_curdate.txt uname/paswd@connectstring set serveroutput on; SET HEADING OFF; set feedback off; BEGIN dbms_application_info.set_module ('shm.ksh','get count by day'); FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt); LOOP DBMS_OUTPUT.PUT_LINE(reccur.dcount); END LOOP; end; / exit; EOF` -
Hello, when installing Adobe Creative cloud, you get the error: program stopped working "Adobe Creative Cloud" Windows can check online for a solution to fix this error on the Internet. The next step really is to get an online solution and close the program, close the program. Signature of the problem:
Problem event name: BEX
Application name: Cloud.exe Creative
Application version: 3.4.3.189
The timestamp of the application: a 56702, 75
The name of the module with the error: StackHash_0a9e
Version of the module with the error: 0.0.0.0
The module of time with error stamp: 00000000
The exception of compensation: 00000000
Exception code: c0000005
Exception data: 00000008
OS version: 6.1.7601.2.1.0.768.2
Language code: 1049
Additional information 1: 0a9e
More information 2: 0a9e372d3b4ad19135b953a78882e789
Additional information 3: 0a9e
Additional information 4: 0a9e372d3b4ad19135b953a78882e789
uninstall all cc on your computer.
clean a http://www.adobe.com/support/contact/cscleanertool.html
Restart your computer
suspend your antivirus/antimalware
Right-click on the file to install the desktop application, and then click "Run as Administrator".
-
go to the next iteration of loop for and continue execution of the previous iteration
Hello everyone,
I want to run a loop with an offset to each iteration. I explain: I want to run a task multiple times (for loop), but with a variable delay in each iteration.
Thus, if we put t = 0 before you run the loop and I use 3 iterations. I put a writ of execution to the first ieration after 3 sec then skip to the next iteration of course without waiting the end of the previous iteration and run the current iteration after 1.5 s and go to the third ieration (once again without waiting for the latest iteration).
I conclude: this is a simultaneous execution of a for loop (10 to 50) from different eras (variable time between t = 0 and each running of each task.
The problem I found in the loop is the fact that I have to wait the end of the time delay in each iteration bfore going on to the next.
Best regards
In all languages, a loop iteration FOR happens AFTER previous. However, go with the parallelized FOR loop can happen to you.
-
New Windows 7 install. Set up the login admin PW. Whenever I have connection, the first test says wrong user or PW. The next test (no change (caps lock, etc.) this works.) Weird!
Any ideas?
* original title - transient Windows 7 lockout *.Hello
I suggest to change your windows password and check if the same problem occurs.
Change your Windows password: http://windows.microsoft.com/en-us/windows7/Change-your-Windows-password
For your reference: Troubleshoot Windows password problems.
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Windows-password-problems
(For Windows 7)
http://Windows.Microsoft.com/en-us/Windows7/solutions-to-common-problems-with-logging-on-to-Windows
Hope this information is useful.
-
Hi all
I have a project of webhelp with several books and browse sequences. The previous buttons as well as the following topic seem to operate with a single book. Is that how it is supposed to work? And if so, is there a way to make it work for OCD together through all the books? With the help of HR 2011.
Thanks for any help.
Diane
Hello
What you have to do is to create a large single sequence that runs through all of the topics in the table of contents. Exactly how do you this depends on your version of RoboHelp. For example, if you use the version 10 and earlier versions, choose the auto create option and enter 0 for the number of levels.
If it is version 11 or 2015 Release, there is an interesting option provided.
See you soon... Rick
Maybe you are looking for
-
some filters are direct all emails in one folder other than the "Inbox", as it should
Why some messages are redirected to one folder other than my Inbox? Some filters don't work properly and are sent to their respective folders. Messages without associated filter, located in a folder with no link to the message in another folder only.
-
I use outlook express to download my e-mails from gmail and used to be able to read the content of the email in Outlook Express. The content of my emails has now disappeared and been replaced by two attachments, a Firefox HTML, which has the content
-
Don't want search engine ASK with Firefox or in the toolbar
Whenever I download Mozilla Firefox, which I used it yesterday, I get ASK with her and she wants to be my search engine and in the toolbar--so I delete it all to get rid of it. I use iGoogle and I don't want to ASK.com . Can I get Mozilla without it
-
Series 500-700z HP Envy: AMD Stream Quick license missing information
Hello Monday or Tuesday, I installed the first major upgrade for Windows 10 - now version 1150. After downloading and installing, whenever I start my computer, I get the same error message. Quickflow AMD error: license information for using this sof
-
Qosmio X 300 - 14y is very slow
Hello First of all, I'm sorry for my English. (if you know Turkish, we can talk :)) 4 days ago, I bought Qosmio x 300-14 years. Vista points are 5.5 5.9, 5.9, 5.9, but 5.7.They're best points I'm not happy with my laptop. It is very slow for me. For