Prohibit certain data in datetime text-item
Hello!
I'm trying to prohibit the user from entering the datetime at midnight hour (DD-MON-YYYY 00:00). Basicly the user can tab itself out of the text-item after inserting the day month and year. I want to make it so that he is forced to enter the hour and minute also.
I've looked through the property palette but i don't seem to find any with which i can do that.
Thx,
Iulian
hi
set the format mask in property.
format mask
dd/mm/yyyy hh24:mi:ssand u may try somethin like this too.
Declare
Date_Exception Exception ;
Begin
If length(:dual.test_date) = 6 then
:dual.test_date := to_char(to_date(:dual.test_date,'ddmmrr'),'dd/mm/yyyy');
Elsif length(:dual.test_date) = 8 then
:dual.test_date := to_char(to_date(:dual.test_date,'ddmmyyyy'),'dd/mm/yyyy');
Elsif length(:dual.test_date) = 10 then
:dual.test_date := to_char(to_date(:dual.test_date,'DD-MM-YYYY'),'dd/mm/yyyy');
Else
RAISE date_exception;
End If;
Exception
When date_exception Then
Message('acceptible date formats are: ddmmyy(yy), dd/mm/yyyy, dd-mm-yyyy');pause;
RAISE FORM_TRIGGER_FAILURE;
When Others Then
Message(sqlerrm);pause;
Raise form_trigger_failure;
End;
Re: Date Format Issue with Pre-Insert trigger
sarah
Similar Messages
-
Date format in text item-solved
Two text item with data type date.I insert dates in the text item in the format for ex.
01-jun-07 but the text item takes it as 01-jun-0007.
how to correct the format?
Message was edited by:
user588306Hello,
in the formate mask property of the text item write :
dd-mon-rrrr or dd-mon-yyyy
regards,
Abdetu.. -
Flex 4 Data Grid: Can text items be interactive?
This is more of a question about possibilities since I've not used datagrids beyond displaying SQL/PHP data in columns. I've already seen that the columns can be indivdually colored, so I suspect that many other properties can be changed as well.
Can the text items in a datagrid respond to mouse events much like the TextArea and other text controls? Can they have tooltips? PopUps? Also, can the text be formatted like html text?
Or is the datagrid a good match for displaying "records" but not what I want to do?
Thanks.You have to use item renderers for the datagrid columns.So you can display the data in whichever form you want and then you can show tooltips and other things that you want for the individual renderers.
-
How can display date and time in text item ?
Hello all,
I have placed two text items (named text_item1,text_item2).
I want to place the current date in one text item and place current time in another text item. how can i place this?Hi
This depends on ur needs
WHEN-NEW-FORM-INSTANCE > if u want to appear it on the very begining moment
--=============
u can use
WHEN-VALIDATE-ITEM > on ur date fields
Here is a link that may help u decide where to take off with this code...
http://www.dotnetspider.com/resources/22433-Triggers.aspx
http://www.slideshare.net/magupta26/oracle-forms-tutorial
Hope this helps ,
Regards,
Abdetu... -
How to validate Date value in Text Column
Hi All,
I have entered DATE value in text item field(Char Data Type), Now how can i validate, the entered date is valid or not.
Thanks in advance.Well, the easiest way would be to make the item of datatype DATE.
Another possibility is to try to convert the given value to a date in the WHEN-VALIDATE-ITEM-trigger, like
DECLARE
dt DATE;
BEGIN
dt:=TO_DATE(:BLOCK.ITEM);
-- if code comes here, the date is valid
EXCEPTION
WHEN OTHERS THEN
-- seems to be no valid date
MESSAGE('Error');
RAISE FORM_TRIGGER_FAILURE;
END;Edited by: Andreas Weiden on 19.12.2010 12:23 -
How to disable copy option for a text item in oracle forms
Hello experts,
I am using oracle forms 11g with weblogic server 10.3.5 at windows7.I have a text item in my oracle form and I have to disable to being copy from a text item in oracle forms.Actually I have to make two text item.First text item to type a password and another text item is also to type password.Here I want that the data from first text item should not be copy through the use of mouse or keyboard shortcut key.
thank you
regards
aadityaThank You To reply, Actually doing so as you said,My problem would not be solved.This would hide data in text item than I will not be able to copy that but in my case the data should not be concealed.Actually I have to make a Form to User registration and here is a strictly boundation to have a right email address of user.There would two text items for this purpose as: N_User_Email------> to type email address in text item.Here user would not be able to copy text written from N_User_Email R_User_Email ------> to type email address again as in N_User_Email.
-
hi
I have some text items, user enters data into these text item and presses ok button.
After that the data is inserted into the database, but the text items are not cleared.
What should I do to clear text items after an insert?Ricardinho wrote:
one last question:
During insert, I runinto an error message:
INSERT INTO DRV(DRIVER_NO,DRIVER_NAME,VEHICLE_REGISTER,DRIVER_CERTIFICATE,DRIVER_ABN,ADDRESS,PHONE,*DRIVER_NUMBER*,*VEHICLE*,*VOUCHER*) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10)
ORA-00904: Voucher invalid identifier
Eventhough I delete DRIVER_NUMBER,VEHICLE,VOUCHER items from the database and from the datablock, I still got this error message?
Any idea?ORA-00904 is the error code for invalid identifiers, your SQL clearly showing that the block still has the three columns as database items in your block.
make sure you don't have in any block the items set as database items.
Tony -
Text item of varchar2(2000) with vertical scrollbar not displaying properly
Hi,
I have a text item of varchar2(2000) with a vertical scroll bar.
I am populating data into the text item using a forms procedure.
(Look at the sample code below)
The problem is the rpadding is NOT displayed properly. I mean
the detail records are NOT shown straight below their respective column heading
in the text item. (BUT if I cut this stuff from the text item and paste it in a
notepad, then the alignment is correct and the data is shown below their
respective column headings)
My code is something like below ...
CURSOR c_get_lab_client_results
IS
SELECT res.lr_id lr_id, org.short_name org_name, TO_CHAR(res.specimen_taken_date,'DD-MON-YYYY') std, substr(res.accession_number,1,20) acc_num, res.lr_type lrtype, res.hdc_id hdcid
FROM bc_organisations org,
cq_laboratory_results res
WHERE cli_id = :clients.cli_id
AND lr_id = :results.lr_id
AND res.org_id = org.org_id
ORDER BY lr_id;
Begin
-- Header
SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD('ORGANISATION',16,' ')||' '||RPAD('SPECIMEN DATE',15,' ')||' '||RPAD('ACCESSION NUMBER',20)||' '||RPAD('RESULTS',16,' ')||chr(10)||chr(10)
INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
-- Detail
FOR c1 IN c_get_lab_client_results LOOP
ls_results := RPAD('XXXX',16,' '); -- Just for example
SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD(TO_CHAR(c1.org_name),16,' ')||' '||RPAD(c1.std,15,' ')||' '||RPAD(c1.acc_num,20)||' '||ls_results||chr(10)
INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
END LOOP;
End;
Thanks in advance.
CheersTry using a monospace font such as Courier New for the text item.
-
How to change data type and col. width of text item
hi,
how will we change the datatype and width of a text item in runtime.
set_item_property(itemname,fixed_length,20);--- it is for width.
please help me.
RegardsHello,
You cannot change the datatype at runtime.
Start with a CHAR item then do the corresponding cast (NUMBER or DATE)
Francois -
I am using pages '09. I have been trying to put together a report and I am using tables to help keep my data in line. My data is free text and would like to footnote certain data as to it origin, but footnoting is grey-out. How can I footnote in table mode inpages '09?
Footnotes can only be inserted in the main text area between the margins on a Word Processing document.
Peter -
Add text item data and display the output in another text item
Hi! All,
I have four text item. like HA,DA,basic_salary and total_sal.I want to add the data entered in the text item in HA,DA,basic_salary and display in total_sal text item.How can I do this.Please help in this matter.
Thanks,
Abha1.Select the text item TOTAL_SAL
2.Open property palette
3.Under Calculation node
Set calculation mode as Formula
Set Formula as nvl(:ha,0)+nvl(:da,0)+nvl(:basic_salary,0) -
How to insert values using pushputtons in text item & fetch data based on
Dear friends,
I want to insert values in the Text item using pushbutton e.g to insert 05CST884 into text item using pushbuttons '0' '5' 'C' 'S' 'T' '8' '8' '4' (alpha numeric buttons) in the layout editor and then fetch data based on the number entered with that of one in the table in the another text item2 in the layout editor.
Suggestions regarding how to develop and use effective triggers are welcome.At the block level (for the control block where all your push buttons are, let's call it block1) create a WHEN-BUTTON-PRESSED trigger. Your [A-Z] and [0-9] buttons should be on a dedicated non-database datablock to reduce problems. As stated previously, this trigger should just contain the code:
:block2.text_item := :block2.text_item||get_item_property(:system.trigger_item, label);
Also on the pushbutton block, create a backspacve button with its own dedicated WHEN-BUTTON-PRESSED trigger containing:
if length(:block2.text_item) > 0 then :block2.text_item := substr(:block2.text_item, 1, length(:block2.text_item)); end if;
This will hopefully erase the last character entered.
block2 should be based on the database table (see Property Palette --> Database) you wish to query and text_item should be based on the database item which contains the code you entered. All the other database items you wish to displayshould also be added to block2.
Add another FIND push button to block1 with the code:
go_block('block2');
execute_query;
Without writing the whole thing for you, I'd suggest you get a decent Forms tutorial book to guide you through the basics (Oracle Forms Developers Handbook). -
Difference between Two Date Should come into Text Item
Dear All,
i want to get difference between two date into text Item :P36_C in On Change java script.
i have two Date Item :P36_A and :P36_B .i have extract these date value from table then difference comes into Text Field :P36_C.
Now i want if i change Date into Item :P36_A or Item :P36_B then Defference between two date Should Come into Item :P36_C .
So i have use Java Script Code to do this
<script>
function diffdat(){
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
$x('P36_C').value =
getval((TO_DATE('P36_B', 'DD-MON-YYYY'))-
getval(TO_DATE('P36_A', 'DD-MON-YYYY')))+1;
</script>
i have put this into Item HTML Form Element Attributes
onChange="javascript:diffdat();"it's not woring .
How to work that Code with dates.
ThanksYou can always create your own difference function based on your own criteria. You can modify this to suit your needs.
CREATE OR REPLACE FUNCTION CALC_OFFICE_DAYS(date1 DATE, date2 DATE)
RETURN NUMBER
IS
v_begin_date DATE := date1;
v_end_date DATE := date2;
v_office_start_time VARCHAR2(10) := '09:30 AM';
v_office_end_time VARCHAR2(10) := '06:30 PM';
v_comp_begin_time DATE;
v_comp_end_time DATE;
v_days PLS_INTEGER := 0;
v_hrs NUMBER := 0;
v_ttltm NUMBER;
BEGIN
select trunc(v_end_date) - trunc(v_begin_date)
into v_days
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_begin_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_begin_time
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_end_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_end_time
from dual;
select (v_comp_end_time - v_comp_begin_time)/24 into v_hrs from dual;
IF v_hrs > 4 then
v_ttltm := v_days + .5;
ELSE
v_ttltm := v_days;
END IF;
return v_ttltm;
END;
As has been noted, this question is best posted on the PL/SQL forum. -
How to enter the data into data block text item which has an LOV associated
Hi,
I have a data block, one of the data block text item has an LOV assigned. when I populate this text item using the LOV and do "execute_query", it is taking the value in the text item and adding it to the search criteria, but when I enter a value manually in that text item and do "execute_query" it is showing me an alert(which I created) "Please enter a value".
My question is, why is not taking the value that I enter manually? Looks like before executing the query, this field is getting empty
How to avoid this problem and make sure that the value entered in the text item is added in the where clause of the query?
Any advice?
Thanks in advance
R.GProblem solved!
Before doing execute-query, all the text items are being cleared,so I used a global variable to store that value
Thanks anyway
R.G -
Help in inserting data to text item
I have a database item, iterval, which is CHAR type and values consist of
'SYSDATE+7','SYSDATE+1','SYSDATE+n/24'...where n is any number. I created a form with two text items, interval_l, which is a list item of CHAR type containing the values, EVERY WEEK, EVERY DAY, EVERY HOUR,etc. and I also have interval_num of NUM type which would contain n from interval. The problem that I am having is that I want to display the current value of interval, for example 'SYSDATE+5/24' as 'EVERY HOUR' in interval_l and '5' in interval_num. Do I need any triggers? I'm open to any suggestions.
Thanks in advance,
KristineYou use triggers to run when a specific event occurs. So I guess when you query your interval column from your DB table, then the right place to translate the value is in a post-query trigger on the block.
All you need is some pl/sql code to parse the values of Interval:
If substr(Interval,1,8) = 'SYSDATE+'
and substr(Interval,-3) = '/24' then
interval_l := 'EVERY HOUR';
interval_num := substr(Interval,9, length(Interval)-11 );
Else ...
Maybe you are looking for
-
I am setting up a new computer (windows 8) My contacts were in iCloud only...moved them into my outlook contacts and lost them on my iphone and ipad. won't let me move them back.
-
How to get song off my iPod Touch into iTunes
Hello, I just bought a new laptop and I'm trying to get all my music (non of which was purchased from iTunes) into iTunes on my laptop. I've tried a few apps that supposedly do this, but they didn't work and I don't have the option to use my Touch as
-
X-axis values - Set values based upon constant date
I am creating a line graph. I am plotting based upon date/time. I'd like to use a constant date across the x-axis. IE 8:00, 8:15, 8:30. Within the constant value there could be many points or no points. For example there could be a point at
-
Weu0092d like to get Custom reports. The base of reports is Security Audit Log
Wed like to get Custom reports. The base of reports is Security Audit Log files. This is files for SM20. What does the file structure look like? What is field of it? Thanks!
-
GB limit on MP3 format? mono 64k not showing up when dragged into track
I cannot drag and drop files I compressed to mono 64k MP3 files with Squeeze into Garage band. Are there limitations in GB regarding MP3 support? Thanks