Data validation
Hi all
There is a particular requirement. I need to validate data in a column. Help, please.
Here's the column filling code 'typ_of_bill '.
'0'|| claim.facilitycode | claim.billclasscode | claim.frequencycode as typ_of_bill
claim.facilitycode CHAR (1 BYTE)
claim.billclasscode CHAR (1 BYTE)
claim.frequencycode CHAR (1 BYTE)
typ_of_bill VARCHAR2 (4 BYTE)
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
My task is to validate the data in the column.
substr(typ_of_bill,1,1) - zero defect
, substr(typ_of_bill,2,1) - this must be between 1 to 9
, substr(typ_of_bill,3,1) - this must be between 1 to 9
, substr (typ_of_bill, 4, 1) - this must be between 1 to 9 and the letters a, B, C, D, E, F, G, H, I, J, K, M, P, O
VALID: "012D".
INVALID: '012Z '.
INVALID: '0A2A '.
Please help me how I can validate these data? Table can have 10000 lines.
Thank you.
Hello
What do you exactly mean by "validating"?
You want to see which rows have values invalid typ_of_bill? If so
SELECT *- or what you want
FROM table_x
If NOT REGEXP_LIKE (typ_of_bill
', ' ^ 0 [123456789] ${2} [123456789ABCDEFGHIJKMPO].
)
;
To make sure only valid strings entered in this column, you can use REGEXP_LIKE in a CHECK constraint. You can also CHECK constraints on 3 columns that typ_of_bill depends on.
Do you really need a column tyop_of_bill at all? Maybe he should a virtual column, or maybe a view would be better.
Tags: Database
Similar Questions
-
Using the Dynamic Range name in the Data Validation
Maybe it's the time of day but I'm being a little dimwit here!
I use = OFFSET(Data!$G$5,0,0,Vlastrow,1) for the range name Tbl_Names. When I select F5 to check that the range is highlighted it seems everything is in order.
On a leaf, I have a Data Validation that uses a list where the Source is = Indirect ($G$ 7). G7 is the text "Tbl_Names". The table of Validation and the content of the G7 is on the same sheet.
Where am I going wrong please?
Thank you
John
John
This issue is beyond the scope of this site and must be placed on Technet or MSDN
-
Export to spreadsheet does not show the formatting data Validation rules
Currently in Hyperion Planning 11.1.2.3, have basic color formatting based on Data Validation rules. However, when you use the option export to a worksheet, the Formatting disappears.
Understand the connection to Hyperion planning is kept only on Smart View, if she will not apply export on the worksheet?
Thank you
Mauricette
I think that the formatting will be lost during the selection of the option export spreadsheet because it is about a raw format, if you want to format would be preferable to use the Smart View method.
See you soon
John
-
Hi all
I put a rule in my form of data validation, as follows,
If the current cell value = 0 then the cellular processes like the color green.
After applying the condition above, I opened my data form but its green display, even for the cells that contain null values.
How can I avoid it. Kindly guide me to overcome.
Thanks and greetings
GérardTry:
If the current cell value = 0 and cell value not equal to value #Missing then process cell active.See you soon... !!
Rahul S. -
Beginner: Question of Date validator on live docs example.
Study this example below raise questions, I can not find easy answers for in the livedocs.
1.) why do we need (just a structure object) model? In the date validator I note that we can not put source = "{dateInput.tyext}" "
2.0) the model has an id of "alternateDate", this change makes no difference.
2.1) connected to question 2, how dateValidator uses model because it has no reference to the model.
3.) don't the code below work when you have more than 1 effective date, do you need a model and a separate validator date for each date entry field? This creates a circular problem as there seems to be a link between the dateValidator implicit and model... confused. This means that I have no way to link the models to date validators.
Tire of http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=validators_1.html
<mx:Model id="alternateDate">
<dateInfo>
<date>{dateInput.text}</date>
</dateInfo>
</mx:Model>
<mx:DateValidator id="stringDateV"
source="{dateInput}" property="text"
inputFormat="dd/mm/yyyy"
allowedFormatChars="*#~/"/>
<mx:Form>
<mx:FormItem label="Date of Birth (dd/mm/yyyy)">
<mx:TextInput id="dateInput"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Check Date" click="stringDateV.validate();"/>
</mx:FormItem>
</mx:Form>I don't see what the model is being used for either - I suspect that it is a mistake in the documentation.
You can not put source = "{dateInput.tyext}", but you can have source "{dateInput}" = and = 'text' property. " The example already done that, IE. He observes the TextInput control directly. If you remove the template in the example should always work.
-
VLD-0202 rule Data Validation error
Hi all:
I have 5 tables of rules on my profile data. I have many FK
CUENTA FK ANNUITY
FK EXENTO CUENTA
CUENTA FK CONTRATO
FK TIPO_IMPUESTO ANNUITY
When to create data in step 4 correction (Data Validation rule) and mistake to see the:
VLD-0202: duplicate foreign keys detected bettween FK_64 and FK71
VLD-0202: duplicate foreign keys detected bettween FK_65 and FK72
VLD-0202: duplicate foreign keys detected bettween FK_66 and FK73
But I have no whit FK this name, because I have rename the FK with another more representative name of the word.
How then-FK corresponds to this error?
I have delete all FK profile and returned to generate the data correction, but the error continue...
Thanks for your help!can not reimport you the table?
-
The ADF Table data validation and highlighting
I have an ADF table, supported by a VO. Gets the data loaded from a spreadsheet file. There are some required columns marked with the required attribute. the columns do not get highlighted when loaded data are empty. How can I get auto table validated during the loading of data and WITHOUT a commit / submit to the rear end table?
My requirement is.
1 load the data into the table.
2. a way to highlight the rows or columns that have no values (how?) I tried the style inline for column as #{row.bindings.invamt == null?' background-color: Red;': ' background-color: White;'}, but no luck.
3. validate data from db.
User, tell us your version of jdev, please!
If the table is editable, you can add this to the inputText of the column
contentStyle = ' #{empty row.bindings.PhoneNumber.inputValue?» "{- color: red;':"} ".
For the PhoneNumber column. If the table is read only the cellular connection is
973564 wrote:
I have an ADF table, supported by a VO. Gets the data loaded from a spreadsheet file. There are some required columns marked with the required attribute. the columns do not get highlighted when loaded data are empty. How can I get auto table validated during the loading of data and WITHOUT a commit / submit to the rear end table?
My requirement is.
1 load the data into the table.
2. a way to highlight the rows or columns that have no values (how?) I tried the style inline for column as #{row.bindings.invamt == null?' background-color: Red;': ' background-color: White;'}, but no luck.
3. validate data from db.
contentStyle = ' #{blank line.» Phone number? "{- color: red;':"} ".
So I guess that the connection you are using is not correct.
Timo
-
CREATE TABLE TEST ( FROM_DATE DATE, TO_DATE DATE, USER_NAME VARCHAR2(100 CHAR) ) Insert into TEST (FROM_DATE,TO_DATE,USER_NAME) values (to_date('14-OCT-13','DD-MON-RR'),to_date('16-OCT-13','DD-MON-RR'),'test1'); Insert into TEST (FROM_DATE,TO_DATE,USER_NAME) values (to_date('13-OCT-13','DD-MON-RR'),to_date('13-OCT-13','DD-MON-RR'),'test1');
my query as:
Select * from test where (trunc (from_date) > = to_date (' 10/15/2013 ',' dd/mm/yyyy'))
and trunc (to_date) < = to_date (' 10/15/2013 ',' dd/mm/yyyy'))
If I get home on October 15, 2013 should not take this record. because there is slope under October 14, 2013 to October 16, 2013
Select count (1) in test where (trunc (from_date) > = to_date (' 10/15/2013 ',' dd/mm/yyyy'))
and trunc (to_date) < = to_date (' 10/15/2013 ',' dd/mm/yyyy'))
The counter is zero, I can allow the record to insert if I trigger the error.
Enter data once and so far should do not allow double or are not among the ranges of data.
Here is an example to make the control and insert it using a single SQL statement...
SQL > CREATE TABLE TEST
2 (
DATE_FROM DATE 3.
4 DATE_TO, - name changed as TO_DATE is not a column name good
USER_NAME 5 VARCHAR2 (100 CHAR)
6 )
7.Table created.
SQL > Insert into TEST values (to_date('14-OCT-2013','DD-MON-YYYY'),to_date('16-OCT-2013','DD-MON-YYYY'),'test1');
1 line of creation.
SQL > Insert into TEST values (to_date('13-OCT-2013','DD-MON-YYYY'),to_date('13-OCT-2013','DD-MON-YYYY'),'test1');
1 line of creation.
SQL > commit;
Validation complete.
SQL > merger in test
2 a aid (select 'test1' as user_name
3, to_date('15-OCT-2013','DD-MON-YYYY') as req_dt_from
4, to_date('15-OCT-2013','DD-MON-YYYY') as req_dt_to
5 double) x
6 on (test.user_name = x.user_name
7 and x.req_dt_from<=>=>
8 and x.req_dt_to > = test.date_from
9 )
10 when not matched then
11 insert values (x.req_dt_from, x.req_dt_to, x.user_name);0 lines merged.
SQL > merger in test
2 a aid (select 'test1' as user_name
3, to_date('17-OCT-2013','DD-MON-YYYY') as req_dt_from
4, to_date('18-OCT-2013','DD-MON-YYYY') as req_dt_to
5 double) x
6 on (test.user_name = x.user_name
7 and x.req_dt_from<=>=>
8 and x.req_dt_to > = test.date_from
9 )
10 when not matched then
11 insert values (x.req_dt_from, x.req_dt_to, x.user_name);1 row merged.
SQL > select * from test;
DATE_FROM DATE_TO USER_NAME
-------------------- -------------------- ----------------------------------------------------------------------------------
October 16, 2013 test1 of 00:00:00 00:00:00 October 14, 2013
13 October 2013 test1 of 00:00:00 00:00:00 October 13, 2013
18 October 2013 test1 of 00:00:00 00:00:00 October 17, 2013 -
I have the following script that I used for a PDF form in Acrobat X, but it does not work when I get it in the Javascript in the ES2 Editor. Is it possible to create a script that does the same thing in LiveCycle Designer ES2? I want to let the user enter a date using numbers only, and have the scope to add slashes if necessary, in addition to the validation of a suitable date. Thanks for any help.
Validation of date Acrobat
Custom validation Java Script for entering dates using only numbers
courtesy of Ricardo Falegnami
adding of slashes
var PROMOTIONDate = event.value;
validate date
If (PROMOTIONDate! = "") {/ / process non-empty string}
var mydate = [];
mydate [0] = util.scand ("DDMMYYYY", Nouvelle_date);
mydate [1] = util.scand ("MMDDYY", Nouvelle_date);
mydate [2] = util.scand ("mddyyyy", PROMOTIONDate);
mydate [3] = util.scand ("mmdyyyy", PROMOTIONDate);
mydate [4] = util.scand ("mdyyyy", PROMOTIONDate);
mydate [5] = util.scand ("mdyy", PROMOTIONDate);
isDate var = false;
for (var i = 0; i < oMyDate.length; i ++) {}
If (mydate [i]! == null) {}
Event.Value = util.printd ("mm/dd/yyyy", mydate [i]); strict format
isDate = true;
break;
}
}
Stay in the field if invalid
If (isDate = false) {}
App.Alert ("Invalid date entered - Please use DDMMYYYY (for example, 10152014)", 0, 1, "Date of Validation" "); check the validity
Event.Value = "";
event.target.setFocus ();
}
}
Hello
I'm guessing that you put this in the case of the field output. If so, replace the three occurrences of event.value to this.rawValue and the event.target.setFocus () at xfa.host.setFocus (this)
Concerning
Bruce
-
Hi all
I have two field form as the Start Date and end Date I need to put a validation such that the end date do not start before the data. but I get an error. Please suggest how can achieve us?
The two fields are of type DATE.
Thank you.Well, your code simply indicates the user date is bad - it does not fail the form to keep save them. Add 'RAISE Form_Trigger_Failure' to your code after you have posted the alert. For example:
declare ALERT_BUTTON1 number; Begin -- set_item_property(:XXONT_CREDITP_HEADERS.END_DATE,format_mask,'DD-MON-RRRR'); if :XXONT_CREDITP_HEADERS.START_DATE IS NOT NULL THEN IF trunc(:XXONT_CREDITP_HEADERS.START_DATE) < trunc(:XXONT_CREDITP_HEADERS.END_DATE) THEN ALERT_BUTTON1 := show_alert('INVALID_DATE'); RAISE Form_Trigger_Failure; End If; end if; end ;
Craig...
-
Filing date validation required...
Hi all
"I have a date like: P3_EVENT_START_DATE = February 2, 2013.
--------------------------------------
I need to do Validations for the following scenario
example of
one): P3_EVENT_START_DATE = February 22, 2013 = > DD IF you add any number... he had to throw the error message...
(b): P3_EVENT_START_DATE ='FEBd-02-2013' = > LUN if you add any tank need of validation.
(c): P3_EVENT_START_DATE ='02 - FEB - 20135 "= > YYYY if you need to change the format of year for validation."
Formate of should be DD-MON-YYYY... only...
I need solution for the highest of the query, please help me on this...Hello
create a validation of type 'Function returning a Boolean' and put something like
DECLARE TEST date; BEGIN TEST := TO_DATE(:YOUR_ITEM, 'DD-MON-YYYY'); RETURN TRUE; EXCEPTION WHEN OTHERS THEN RETURN FALSE; END;
the expression of Validation 1.
Enter your message in the "Error Message" box and that it should be.
I hope this helps...
Thank you
Sandro -
Hello
I have two text fields with a custom format for the date in mm/dd/yyyy. One is a start date and the other is an end date
I would like to set up a dialoge box or app.alert that is displayed for the user to enter another date if the date of entry into the end date is more than 3 months from the start date
Could someone help me with a java script for this please
See you soon
Michael
Yes, it is a custom for the EndDate field validation script. Something like this:
Event.RC = true;
If {(event.value)
var startDateString = this.getField("StartDate").value;
If (startDateString =="") {}
App.Alert ("error! You must first fill in the Starting Date field. ») ;
Event.RC = false;
} else {}
startDate var = util.scand ("mm/dd/yyyy", startDateString);
endDate var = util.scand ("mm/dd/yyyy", event.value);
startDate.setDate (startDate.getDate () + 93); This is another way to do
startDate.setMonth (startDate.getMonth () + 3);
If (endDate.getTime () > startDate.getTime ()) {}
App.Alert ("error! This date may not more than 3 months after the start date. ») ;
Event.RC = false;
}
}
}
(Lines that start with "/ /" are commented out.) You can experiment with them and see which ones works best for you)
One thing to keep in mind, however, is that this script only will be triggered when the EndDate field is changed, then I recommend to reset this field whenever StartDate is published. Otherwise, you might get incorrect (or prohibited) values entered into them if someone between the start date and end date, and then change the start date...
-
Date Validation /Conversion as string to date
Hello Oracle experts
I'm trying to find the right date conversion/validation. The problem is that I get as string(dd-Mon-yy) format date in a text file. I need to load it into an Oracle table in the form of text, then post the text as a date is valid.
I can check the day and year. But how to check the month. If the date is * 1 April 11 * it's OK but if it is as * ODA / 01/11 * so how to check the string of months is one channel of 12 months. I mean from January to December.
If I use the conversion to this day, I get the error ORA-1843.
with t1 as
(
SELECT ' 01-CCA-11' stringdate FROM DUAL Union all the
SELECT 1 December 11 ' stringdate FROM DUAL Union all the
SELECT ' 01-Juk-11' stringdate FROM DUAL Union all the
SELECT 1st April 11 ' stringdate FROM DUAL
)
The first and 3 record is incorrect month.
Help, please.
I use
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options
Thank you
RajeshIf you want to just check the month (and assuming that the month is English), you could do something like
SQL> ed Wrote file afiedt.buf 1 with x as ( 2 (SELECT '01-Apd-11' stringdate FROM DUAL union all 3 SELECT '01-Dec-11' stringdate FROM DUAL union all 4 SELECT '01-Juk-11' stringdate FROM DUAL union all 5 SELECT '01-Apr-11' stringdate FROM DUAL )) 6 select (case when regexp_instr( 7 x.stringdate, 8 '-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-' ) > 0 9 then 'Valid' 10 else 'Invalid' 11 end) status, 12 stringdate 13* from x SQL> / STATUS STRINGDAT ------- --------- Invalid 01-Apd-11 Valid 01-Dec-11 Invalid 01-Juk-11 Valid 01-Apr-11
Justin
Published by: Justin cave on July 30, 2011 19:32
-
OK I'm lost and sought and made changes to what I do, but not sure I correct datasets or written something wrong.
I have two date fields in my form. A Start Date and an end Date
I put a validation that indicates the Start Date/time cannot be greater than the end Date/time or so I think that's what he said. But if I put and a date in the form of an hour after the beginning of end date, it throws the error
Here are my details and maybe I'm just storing data wrong or something
Validation ENDDATE: PL/SQL error:
If to_date(:P6_DTGSTART) > to_date(:P6_DTGEND)
raise_application_error (-20001, 'End Date must be greater than the Start Date.');
end if;
When I look at the data stored in the database SQL Workshop, this is what I see
DTGSTART 11-29-2010
DTGEND
The entry in the form is a DatePicker to the format: DD-MON-YYYY HH24
If the entry as well as:
Start date/time November 29, 2010 09:25
End date/time November 29, 2010 10:25
The end date may be on the same date, but time must be greater than the start date/time
Thank you
WallyCheck it out now...
Thank you
Machaan -
Connection to the database, data validation
Hello
I'm still learning AS3 and I'm trying to set up the input validation user (text box) by 2 points (name and password) by checking with a SQL Server database on my site.
I have configured using a standard request/response.write script ASP page. It works I tested the ASP, and it works. The ASP receives 2 variables, if all goes well each of a name-value pair and then checks the DB, if the name and the password received from the Flash SWF football match a name and password in the comic book, sends back a 'YES' and, if not, sends back a 'NO '.
I have some difficulty accessing written AS3 and it works properly. Here's what I have so far which displays the errors, causing a flicker when you preview and still doesn't work. Suggestions, help set the script would be appreciated.
Stop()
nextBtn.addEventListener (MouseEvent.CLICK, nextBtnClick, false, 0, true);
function nextBtnClick(e:MouseEvent):void {}
var input1:String = T1.text;
var input2:String = T2.text;
var variables: URLVariables = new URLVariables ("input1 = input1.value & input2 = input2.value");
var request: URLRequest = new URLRequest();
request.url = " " http://www.xyz.com/script.asp "; Once the SWF file is uploaded to the site, the URL will change to ' / script.asp '
Request.Method = URLRequestMethod.POST;
Request.Data = variables;
var loader: URLLoader = new URLLoader();
loader.dataFormat = pouvez;
loader.addEventListener (Event.COMPLETE, completeHandler);
Try
{
Loader.Load (request);
}
catch (error: error)
{
trace ("Error");
}
}function completeHandler(event:Event):void
{
var age: URLRequest = new URLRequest (event.target.data.input1.input2);
trace (input1, input2);
}Thanks for your help.
Kind regards
Use the text property of your textfields:
var name: String = T1.text;
var password: string = T2.text;
var variables: URLVariables = new URLVariables("name="+name_tf.text+"&password="+password_tf.text);
var request: URLRequest = new URLRequest();
Maybe you are looking for
-
Bluetooth drivers for Windows 7 on a Satellite P200 - 1 K 8
Looking to upgrade my Vista Home Premium to Windows 7 Ultimate but I see that I would need a newer driver for this run the bluetooth...Someone at - he tried this and find out if something works?See you soon!
-
my e-sata port no longer works, it does not recognize the bios, it works fine via usb, I bought a new speaker/interface, it is not that I ordered a new cable which will be here next week, will then check back in. Does anyone have any ideas? Thank you
-
I have a HP 6560 b with Windows 7. Only in the last days, this problem. When the monitor goes to sleep, I can't wake him up. I can hear the computer wake up - the fan starts - but the screen remains dark. I have to reboot to get to the back of th
-
Remove Trogan "Win7 Antivirus 2012"
I'm working on a desktop Hp Pavalion p6710f Edition Windows7 Home Premium 64 I have a 'Win7 Antivirus 2012' trogan virus. Anyone know how to remove it? Impossible to get on the internet... to download nothing to delete. Tried safe mode and used "last
-
BlackBerry Smartphones Newbie needs help with TOWER
Hello world I hope someone can help me. I was wondering if there is a way I can retrieve my email address from my office (Outlook express) and import it onto my Blackberry? I don't have the address, about half of them, to tedious to do it manually...