How to extract the values of the other tables in the process upon request
Hi allIn Oracle Apex 4.1.
The Leave_transaction Table contains the following fields,
1.Leave_id
2.Emp_name
3.From_date
4.To_date
5.Remaining_days
The Emp_Master Table contains the following columns1.Emp_id
2.Emp_Name
3.Remaining_days
Holiday_master table contains a list of the dates of the holidays as 'From_Date '.I have the form based on the Leave_Transaction Table,
I created the process,
"Sur-Soumettre after calculations and validations of."
and posted the following PLSQL code,
declare
days number(3);
ex_days emp_master.remaining_days%type;
new_rem_days emp_master.remaining_days%type;
begin
select count(*) into days from (select dt
from(
select to_date(:p1_from_date, 'DD-Mon-YYYY') + rownum -1 dt
from dual
connect by level <= to_date(:p1_to_date, 'DD-Mon-YYYY') - to_date(:p1_from_date, 'DD-Mon-YYYY') + 1)
where to_char(dt,'fmday') not in ('sunday','saturday') minus (select holiday_start from holiday_master)) dual ;
select remaining_days into ex_days from emp_master where upper(emp_name) = upper(:APP_USER);
new_rem_days := ex_days - days;
update emp_master set
remaining_days = new_rem_days
where upper(emp_name) = upper(:APP_USER);
update leave_transaction set
remaining_days = new_rem_days
where upper(emp_name) = upper(:APP_USER) and
leave_id=(select max(leave_id) from leave_transaction);
end;
If the date is between from_date and To_date comes Saturday and Sunday or if any Date exists in the table of Hpliday_master he will exclude and return the count (*) rest of dates.For example,.
If the From_date is 04-may-2012'
and To_date is 08-may-2012,
Here the dates 5 May and 6 may are "Saturday" and "Sunday".
and if any date between From_date and To_date is exist in the Table Holiday_Master
That is to say that here it is 07-may-2012,
Then the remaining dates are (excluding sat, Sunday and dates in holiday_table).
04-may-2012,
08-may-2012.
the count (*) is 2.
I use the code above but it return 5.
I think that this
...where to_char(dt,'fmday') not in ('sunday','saturday') minus (select holiday_start from holiday_master))
code does not work.Can someone help me solve my problem.
Edited by: Gurujothi may 3, 2012 23:59
set serveroutput on;
declare
v_sql varchar2(100);
begin
v_sql := 'ALTER SESSION SET NLS_LANGUAGE= ''GERMAN''';
execute immediate v_sql;
dbms_output.put_line(v_sql);
for c in
(
select to_char(sysdate + level ,'fmday') day_
from dual
where to_char(sysdate + level,'fmday') not in ('sunday','saturday') connect by level < 8
) loop
v_sql := c.day_;
dbms_output.put_line(v_sql);
end loop;
v_sql := 'ALTER SESSION SET NLS_LANGUAGE= ''AMERICAN''';
execute immediate v_sql;
dbms_output.put_line(v_sql);
for c in
(
select to_char(sysdate + level ,'fmday') day_
from dual
where to_char(sysdate + level,'fmday') not in ('sunday','saturday') connect by level < 8
) loop
v_sql := c.day_;
dbms_output.put_line(v_sql);
end loop;
end;
/
ALTER SESSION SET NLS_LANGUAGE= 'GERMAN'
samstag
sonntag
montag
dienstag
mittwoch
donnerstag
freitag
ALTER SESSION SET NLS_LANGUAGE= 'AMERICAN'
monday
tuesday
wednesday
thursday
friday
PL/SQL procedure successfully completed.
Tags: Database
Similar Questions
-
How to extract the values of XMLTYPE column,
SQL > create table temporary global xmtype_tab (xmlfile xmltype);
SQL > select * from all_directories;
SYS RESTOREDIR/home / / dbimptask /.
insert into xmtype_tab values (xmltype (dbms_xslprocessor.read2clob ('RESTOREDIR ','LAS_SETUP.xml ')));
1 line of creation.
SQL > select * from xmtype_tab;
XMLFILE
--------------------------------------------------------------------------------
<? XML version = "1.0"? >
rowset <>
< ROW >
< DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >
How to extract the values inside each tag?
XML file has the following data...
rowset <>
< ROW >
< DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >
< > 9600 BAUD_RATE < / BAUD_RATE >
< ACK_TIMEOUT > 1 < / ACK_TIMEOUT >
< TUBE_TRAVEL_LIMIT > 4 < / TUBE_TRAVEL_LIMIT >
< SEND_SID_TIMEOUT > 1 < / SEND_SID_TIMEOUT >
< INDEX_Q_TIMEOUT > 2 < / INDEX_Q_TIMEOUT >
< HW_HANDSHAKING > 1 < / HW_HANDSHAKING >
< / ROW >
< / LINES > ';
I use the Oracle 10.2.0.3 version...Why does this work?
You are missing the tag of the ROWSET:
select extractvalue (xmlfile, '/ROWSET/ROW/BAUD_RATE') baud_rate from xmltype_tab where existsnode (xmlfile, '/ROWSET/ROW/BAUD_RATE') = 1;
-
I have an application of machine vision, in which the geometric pattern match technique was used to find the target in the images of type variant.
as we know, we do a geometric model by model OR editor in the editor we can adjust the parameters of the curve specified settings to get the desired curves and we derive the custom box to ignore during the match. then we save the use of the same model in our application of vision.
Now my question is coming. When I program my request for the geometric game. I have specified the parameters of the curve for the entrance of the IMAQ Advanced Setup learn ringtone 2, of course, I have to adjust this identical to the model, but I don't know how we extract the geometric model. I tried all the methods, for example, I can read data custom, IMAQ get characteristics of the geometric model(it's just for the basic functionality? so is there even a VI based edge?), even at anasys PNG file formats! But I can't read the info of the geometric model by myself!
It is also illogical to adjust the CURVE SETTINGS manually again for the " IMAQ Advanced Setup Learn Pattern 2" after that I already have in the template editor OR!
Hello
Why do you need to specify the curve settings once again, if you have already built a model using the template editor? You don't need to use "IMAQ Advanced Setup learn geometric model 2 VI" to find games (see the attached example).
You can wire the 'curve settings' control to 'IMAQ configuration geometrical game model 2 VI', but the values are not used if wire you a Boolean true to the node "use learning curve settings" (it's like that by default). To prove it, I enclose a small program with pre-created model (using the template editor) for a geometrical alignment. The model and the test of three images are also included.
Try changing the settings of the curve with the 'use know curve settings' enabled, and you will see the corresponding score remains the same. Disable the Boolean control, then try to change the curve settings.
Also take a look at the detailed help for "IMAQ configuration geometrical game model 2 VI", specifically the "learning curve parameters of use."
I hope this helps.
Best regards
K
-
How to extract the signal from the waveform of my power level designated?
Hi all
How can I extract the signal of the waveform accroding to the power level? I read the Trigger & Gate .vi, but this vi retrieves the signal duration. I want to extract the signal depending on the power level.
As shown in the following figures, the signal I want to deal with is between 130000 to 140000, if I Zoom, I can see the useful signal is between 135400 to 138200. The question is how to extract the signal in the area?
I tried the sub_NoiseEst_And_Chop_Shell.vi in the example of Packet_based_link also, but this Subvi seems to be a bit slow. Can someone give me the best advice? Thanks in advance!
I'm working on something similar, but have not had time to fully develop.
My idea was to use an envelope detector (low pass filter) and then use a detection of energy VI on the envelope.
Here is where I left
-
I downloaded a free trial of Adobe Creative cloud and dreamweaver CC. I am not able to download a .psd to see how to extract the HTML and CSS.
Download button is disabled. What is the case for a free trial?
Hey girijamg,
I asked that you try to open a page because snippet Panel will be disabled until there is a html page is open in DW.
Excerpt from Panel will be ready for the job that after any html page is open in DW.
Hope it makes sense.
Lalita
-
How to activate the trace for request to define in oracle application?
How to activate the trace for request to define in oracle application?
Please see and steps/comments for 'Presentation of simultaneous program' in (Doc ID 1516355.1).
Thank you
Hussein
-
How to automate the process of loading data using load file &; Task Scheduler
Hello
I do the automated processes to load the data into Hyperion Planning application using the file data_Load.bat & Scheduler of tasks.
I created Data_Load.bat file, but the rest of the process, I cannot complete.
Could help you me, how to automate the process of loading data using the file Data_load.bat & task Scheduler or what are the rest of the file is require it to achieve.
Thank youIn response to your question using the maxl for loading scripts?
If Yes, I've seen and deliver in the batch (ex: load_data.bat) that is you do not have the path of the maxl script complete with a batch when passing through the event the task scheduler will work, but the log file and / or error will not be created. Which means lots claims it linked task scheduler, although he did not do what you need to.
If you use maxl use this as the batch
"essmsh C:\data\DataLoad.mxl" or you can also use the full path for the maxl or work elsewhere. The only reason why I think that the maxl can then not work is if you do not have the updated batch updated to call on all LANE changes maxl or if you need to update your environment variables to correct the command essmsh to work in a command prompt.
-
How to implement the process Train in Jdev 10.1.3
Hello..
Anyone know where to find a tutorial on how to implement the process train in jdev 10.3.1
Thank youhttp://download-West.Oracle.com/docs/HTML/B25947_01/web_complex005.htm#CEGIGJID
-
How to extract the values inside the jquery element dialogue modal rigion
Hi all
My requeriment is
Click report link open jquey editable modal dialog and display all values with respective ID values.
1.I used page header HTML code below
< link rel = "stylesheet" href = " " http://AJAX.googleapis.com/AJAX/libs/jQueryUI/1.7.2/themes/
"Redmond/jquery - ui.css" type = "text/css" / >
" < script src =" http://AJAX.googleapis.com/AJAX/libs/jQuery/1.4.2/jQuery.js "> < / script > .
" < script src =" http://AJAX.googleapis.com/AJAX/libs/jQueryUI/1.7.2/jQuery-UI.js "> < / script > .
< script type = "text/javascript" >
$(function() {})
() $('#ModalForm').dialog
{
modal: true,
autoOpen: false,
Width: 600
buttons: {}
Back: function() {}
closeForm();
} ,
Approve: function() {}
addPerson();
},
Return_For_Correction: function() {}
addPerson();
},
Reject: function() {}
addPerson();
}
}
});
});
function openForm (TrxId)
{
Alert (TrxId);
$s ('P3_x_trx_id', TrxId);
$('#ModalForm').dialog ('open');
}
function closeForm()
{
$('#ModalForm_input[type="text"]').val (»);
$('#ModalForm').dialog ('close');
}
function addPerson()
{
var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is updateStatus', 0);
ajaxRequest.add ('P3_status', $v ('P3_status'));
var gReturn = ajaxRequest.get ();
If (gReturn)
{alert (gReturn)}
on the other
{ajaxRequest = null;
closeForm();
doSubmit ('SEARCH'); }
}
< /script >
2. static html Id - ModalForm region
3. region html Header-
< div id = "ModalForm" title = "View details" style = "display: none" >
4.footer-
< / div >
5. in the same page created 'extraction of line auotomatic' process by using the value of key PK P3_trx_id
6 Jquery modal region is created but not showing values.
Hi Dan,.
You must create a separate page for your modal dialog box,
Call this dialog in the parent page and pass the value modal page in some hidden item and use the value of the element to retrieve details on the modal dialog box.
1. change your report Page-> under the header HTML
2. change the link from which column you want to call the modal dialog box.
Target: URL
URL: javascript:f_modalDetails(#ID#);
instead ID, pass the value that you want to pass to the modal dialog box that shows you the data associated with the selected line.
3. go to the page of the form (modal dialog)
Change your close button that closes the modal dialog box.
Action: Redirect URL
Target URL: javascript:window.parent.closeModalDialog();
Close the Model dialog box using the "submit" button press
4. create a branch on the processing section of the Page of the page of the modal dialog box
Branch point: After Processing (After computation, validation and Processing)
Target type: Page of this Application
Page: Redirect to the same page
Request: CLOSE_MODAL
When you press the button: select the Send button
NOTE: Branch must be before all the unconditional branch on this page
5. create a dynamic Action on the Page modal dialog box
Event: Page load
Action: Run the JavaScript Code
Code: javascript:window.parent.closeModalDialog();
Kind regards
Jitendra
-
How to extract the values of column aliases based on different column values?
Hello gurus,
I have a table with the following struture-
And try to find the values of the column as"drop table T; create table T(Name, Symbol, Amount,dep) as select 'Anderia', 'AA', 1050000,'HR' from dual union all select 'Michael', 'ML',150000,'Sales' from DUAL union all select 'Bill', 'BL', 1050000,'Finance' from dual union all select 'Nancy', 'NY', 4000,'HR' from DUAL union all select 'Anderia', 'AA',3000,'HR' from dual union all select 'Michael', 'ML',1050000,'Sales' from DUAL union all select 'Bill', 'BL', 1200000,'Finance' from DUAL union all select 'Anderia', 'AA', 1200000,'HR' from DUAL union all select 'Vish', 'VH', 1200000,'Marketing' from DUAL;"
Name, symbol, dep, amount, % Total, Total $Cumm, rank but some additional as-columns
Amount HR, % HRTotal, $HR Cumm Total,
Finance amount, FinanceTotal %, $Finance Cumm Total
Sales amount, a percentage of Total sales, $Sales Cumm Total.
Amount marketing, MarketingTotal %, $Marketing Cumm Total
then I use the following query to retrieve the name, the symbol, the dep, amount, % Total, Total $Cumm, rank columns.
But I want to extract the following columns so... How can I do?select name , decode(grouping(symbol), 0, symbol, 'Total') symbol , dep , sum(amount) amount , sum(per_total) "% Total" , decode(grouping(symbol), 0, max(Cum_per_total), null) "% Cumm Total" , decode(grouping(symbol), 0, max(rank), null) rank from ( select name , symbol , dep , amount , per_total , sum(per_total) over(order by rk) cum_per_total , rank , rk from ( select name , symbol , dep , sum(amount) amount , round((sum(amount)/max(total_amount)) * 100,2) per_total , dense_rank () over (order by sum(amount) desc) as rank , row_number() over(order by sum(amount) desc) as rk from ( select name , symbol , amount , dep , sum(amount) over() total_amount , sum(amount) over () from t ) group by name, symbol, dep ) ) group by grouping sets((name, symbol, dep), ()) order by rank, max(rk) nulls last
Amount HR, % HRTotal, $HR Cumm Total,
Finance amount, FinanceTotal %, $Finance Cumm Total
Sales amount, a percentage of Total sales, $Sales Cumm Total.
Amount marketing, MarketingTotal %, $Marketing Cumm Total
as I want that all records, then will the dep..do-specific I need to use the case here?
Thanks for all your time and effort in advanceIf I understand your needs, you need pivot: SQL and PL/SQL FAQ
-
How to extract the node where the value of the node is the max in all of the XML document?
Hello
I have a transaction that refers to an xmltype in iRecruitment, containing multiple versions of the same node as follows:
(only for the example data)
{noformat} & lt; Transaction & gt;
& lt; data & gt;
& lt; ObjectVersionNumber & gt; 1 & lt; / object_version_number & gt;
& lt; EO & gt;
& lt; Attribute1 & gt; A & lt; / Attribute1 & gt;
& lt; Attribut2 & gt; B & lt; / attribut2 & gt;
& lt; /EO & gt;
& lt; / data & gt;
& lt; data & gt;
& lt; ObjectVersionNumber & gt; 2 & lt; / object_version_number & gt;
& lt; EO & gt;
& lt; Attribute1 & gt; A & lt; / Attribute1 & gt;
& lt; Attribut2 & gt; C & lt; / attribut2 & gt;
& lt; /EO & gt;
& lt; / data & gt;
& lt; data & gt;
& lt; ObjectVersionNumber & gt; X & lt; / object_version_number & gt;
& lt; EO & gt;
& lt; Attribute1 & gt;? & lt; / Attribute1 & gt;
& lt; Attribut2 & gt;? & lt; / attribut2 & gt;
& lt; /EO & gt;
& lt; / data & gt;
& lt; / Transaction & gt; {noformat}
I can extract a value for FULL-TIME 1 or 2, is not a problem.
However, how can I go on the selection of a value of an attribute below FULL-TIME X, where X is the maximum value of FULL-TIME in any node in the XML document?
I tried to the last node corresponding to my way, but it is not always the case that the FULL-TIME max will correspond to this scenario.
Any help would be greatly appreciated!
Thank you very much, Pete
Published by: Pete Mahon on February 24, 2009 12:11Here's a way
SQL> set long 100000 SQL> with XML as ( 2 select XMLTYPE( 3 ' 4
5 6 ') OBJECT_VALUE 27 from dual 28 ) 29 select DATA, OVN 30 from XML, 31 XMLTable 32 ( 33 '/Transaction/data' 34 passing OBJECT_VALUE 35 columns 36 DATA XMLType path '.', 37 OVN number path 'ObjectVersionNumber' 38 ) 39 where OVN = ( select MAX(OVN) 40 from XML, 41 XMLTable 42 ( 43 '/Transaction/data' 44 passing OBJECT_VALUE 45 columns 46 OVN number path 'ObjectVersionNumber' 47 ) 48 ) 49 SQL> / DATA -------------------------------------------------------------------------------- OVN ----------1 78 11 12 13A 9B 102 1415 18 19 20A 16C 173 2122 25 26? 23? 243 3 SQL>? ? -
How to extract the second sysdate value using the EXTRACT function
Hello
I want to extract the second sysdate value using the EXTRACT function.
When I run the following query I get an error;
SELECT extract (second OF SYSDATE) FROM dual;
ORA-30076: field of invalid extract for the source of the extract.
When I do to extract the month I get the correct result.
Is there some necessary formatting by specifying the sysdate (or any other date value) in the query. ?
Thank you.You can extract only the year/month / day, day
SQL> Select extract(year from sysdate) from dual; EXTRACT(YEARFROMSYSDATE) ------------------------ 2008 SQL> Select extract(day from sysdate) from dual; EXTRACT(DAYFROMSYSDATE) ----------------------- 20 SQL> Select extract(month from sysdate) from dual; EXTRACT(MONTHFROMSYSDATE) ------------------------- 11 IF you enter Minute or Seconds SQL> Select extract(minute from sysdate) from dual; Select extract(minute from sysdate) from dual * ERROR at line 1: ORA-30076: invalid extract field for extract source but with timestamp you can get the seconds SQL> select EXTRACT(second FROM current_timestamp) from dual; EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 39.473 SQL> select EXTRACT(second FROM current_timestamp) from dual; EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 57.474 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 59.787 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ .412 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ .99 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 1.458 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 1.896 SQL> / EXTRACT(SECONDFROMCURRENT_TIMESTAMP) ------------------------------------ 2.334
Edited by: Viswarayar Maran on November 20, 2008 14:30
-
How to: Extract the first three characters of a text field
Greetings-
What is the best method to extract the first three letters of a text field?
I need to extract the first three letters of a text field (surname in this case),
so I add other components to create an identification number for
a person.
This identification number which must be created consists of the
date of the person by birth, last 4 digits of social security number and
the first three letters of the person's first name.
Example:
== > Date of birth: 15/11/45
== > Last 4 SSN: 6654
== > Name: Smith
Identification number would be:
== > 1115456654SMI
Leonard B
That should do the trick:
I put your values in the variable, simply replace the names, according to the needs
This removes all the string of the / your birthday (if it's a string!) and puts it in the variable id:
It takes the 4 last letters/digits of your social security number string and adds it to the id:
It takes the first thre letters/numbers from your last name variable, capitalizes and adds to the identification string
It will be useful.
-
How to extract the images filled in numbers?
Hello community,
I have prepared a file number for one of my clients with basic information and photos of products. I now need to export to Excel, but it does not keep the images which were filled in the cells of the numbers.
Is there a way to extract the images of cells of numbers? I took these pictures on the internet directly, so I have stored them in a special place. I think, however, that they could be stored somewhere on my mac but cannot find them.
I have over 300 images inserted in 300 cells, so I'll try to avoid to find their return and save them properly.
Thanks for your help!
I've tried in the past to extract numbers background images but never succeeded.
I know that when you click on a cell and command + c to copy the content to the system Clipboard background images is included, because you can also click and command + v to paste the images follow the dough.
But how the numbers stores the image to the system Clipboard when you copy and paste is not, as far as I know, documented. It is so difficult to "get to work."
If you are handy with AppleScript, you can try + command + c to copy and then run this script.
the Clipboard as record
This will list the contents of the Clipboard. Give more information on how the image is stored in this folder could make it possible to shape a script to extract the images.
But that is as far as I'm away.
The folks at Mac OS technology discussions might know how.
SG
-
How to extract the ISO image to CD?
I would like to know any tool in Windows XP to extract the ISO image to CD.
Thanks in advance for your suggestions
I would like to know any tool in Windows XP to extract the ISO image to CD.
I think you're probably asking to write the contents of an ISO image to a CD. If this is the case, you will need to use a burning CD/DVD software to do the job. Windows XP has no native support for burning ISO images.
Nero, Roxio - these programs are well known actors in this area, but they come with a price tag. If you have these programs already installed in the computer, you can simply search the help content within these software to find out how to burn ISO images to use.
But, if you don't have this software, you can download ISO free burning programs to do the job. Search online for free ISO burning software and you'll get a ton of these programs.
This is a good program to burn ISO images:
http://www.ImgBurn.com/I hope that helps!
Maybe you are looking for
-
Cannot change my homepage the way you tell
I tried to install a new password the way you said, but that has not worked. tried to go to tools and do it their way and that does not work either. I'm puzzled dan
-
Lenovo P770 does not start [brick]
I'll start with a statement: I'm not a smart man.To try to get the GPS and compass works on my Lenovo P770 (S121), I managed to successfully brick it. I can still push files to the phone via USB, but I don't have the recalcitrant files for it. In fac
-
Vista SP2 unknown error: Code 8024200d
Try to install the Vista SP2 stops the same 8024200d error code. OK installed on other mobile home network 2. Same or different - question other 2 laptops, when I right click, properties, compatibility, they show that this compatibility cannot be de
-
Need a simple solution to find the unique address of the printer
Even after having printed pages with the code, I do not know what address. I need to see a sample of what it should look like. Thank you.
-
IPSEC connection to the foreign system disorder
Hello! I make an IPSEC for a V7 astaro on a clients site the origin is a UC540 with the IOS 15 I see the 'green' on the astaro... Tunnel so its ok, but not the packets go through: UC540 #show crypto ipsec his Interface: FastEthernet0/0 Tag crypto map