Validation on Integer data type attribute
Hi,
Working on jdev 11.1.1.3.0
I have to do validation on integer data type like, it should not allow 13.20(only single digit numbers.).
I am doing validation on AMImpl and converting the int into string
String per=Row.getPer().toString();// here if user enter 13.20, then per containing only 13 so its not going to inside if.
if(StringUtils.contains(per,"."))
return false;
Even i have written regular expression on my field but its working
can any one help me.
Hi,
Why don't you use the af:convertNumber in your tag?
Something like that:
<af:inputText>
<af:convertNumber>
</af:inputText>
Doc: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_convertNumber.html
Regards,
Similar Messages
-
How can i validate(compare) two date type attribute in EO.
Hi All,
jdev version 11.1.2.1.0
i have created one EO where two date type attribute ToDate and FromDate now i want to add validation rule.
which validate that difference b/w ToDate and FromDate not more than 3 month.
How can i validate this?You can create script expression
Something like
if((toDate.getTime()-fromDate.getTime())/(1000 * 60 * 60 * 24)>30)
return true;
else
return false;-Arun
P.S : Above example calculates based on number of Days (30). If you want 3 months, you need to put a logic - Simply 90 days? What about the months with 31 days and 28/29 days? etc. -
Hi,
I have an infopath web brower enabled form. In the form i have a date field.
I am passing the data from the database to that field using the C# code.
But, as the field from database is coming as string, i am getting an error, and i am not able to assign the value.
I get the date value from database as "3/25/2011 12:00:00 AM"
I used the below code:
[CODE]
if (objInfopathFormcData.myRecievedDate != null)
myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager).SetValue(objInfopathFormcData.myRecievedDate);
[/CODE]
I am getting the error as "Schema validation found non-data type errors".
How to set the value for a date field in Infopath.
Thank youHI,
I fixed it:
Below code is used to fix:
[CODE]
XPathNavigator xfield = null;
DateTime dtmyRecievedDate;
dtmyRecievedDate = Convert.ToDateTime(objInfopathFormcData.myRecievedDate);
if (objFormcData.FcCompletionDate != null)
xfield = myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager);
DeleteNil(xfield);
xfield.SetValue(dtmyRecievedDate.GetDateTimeFormats().GetValue(5).ToString());
// method to delete xsi:nil
private void DeleteNil(XPathNavigator nav1)
if (nav1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
nav1.DeleteSelf();
[/CODE]
Thank you -
How to set default value to date type attribute.
Hi,
How to set default value to date type attribute.
E.g I want to set u201C01/01/1999u201D to date attributes.
First i want to set value and then i want to fetch the same & want to check equals.
please suggest solution.
Regards,
SmitaHi,
In wdinit() method u can set the date
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
Date today = Calendar.getInstance().getTime();
String reportDate = df.format(today);
wdContext.currentContextElement().setFromDate(reportDate);
Another way you have set the this formate like that
1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
2. Select the type as "date"
3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
4.Bind the context attribute to the type created now.
Hope this helps u.
Best Regards
Vijay K -
Last 6 months of data based on date feild that is an integer data type
Hi Folks
I have a date column called 'YYYYMM' that is an Integer data type in YYYYMM format (eg. 201309). I want to return records from the last 6 months.
If the column was in a date format I could use something like
[YYYYMM] >DATEADD(M, -6, CURRENT_TIMESTAMP)
Therefore I assume I need to do a CONVERSION of INT into a date format with something like
CONVERT (DATE, [YYYYMM]
But I get the message "Explicit conversion from data type int to date is not allowed"
Can someone suggested a work around?
Many thanks Steveanother way is this
SELECT *
FROM Table
WHERE DATEADD(mm,(dateintfield%100)-1,DATEADD(yy,(dateintfield/100) -1900,0)) >=DATEADD(mm,DATEDIFF(mm,0,GETDATE())-6,0)AND DATEADD(mm,(dateintfield%100)-1,DATEADD(yy,(dateintfield/100) -1900,0)) < DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Date type attribute in web dynpro callable object
Hi all,
I am creating a callable object with date type attribute as input parameter in a web dynpro callable object.
date type I have used is java.sql.date.
But when I am exposing that callable object in GP its giving an error:
Technical Exception:
Web dynpro Component cannot be created.
And when i am changing date type as java.util.date then I am not able to asssign that date attribute in my view layout.
Can anyone plese help me.Hi Ritu ,
u have to convert the util date to sql date in the execute method .
do it as showm below in Execute method in the component Controller :
let the Attribute be planEndDate in the Context:
public void execute( com.sap.caf.eu.gp.co.api.IGPExecutionContext executionContext ) {
java.util.Date planEndDate = null;
planEndDate = (java.util.Date) inputStructure.getAttributeAsDate(IContextElement.PLAN_ENDDATE);
java.sql.Date sqlDate = new java.sql.Date(planEndDate.getTime());
wdContext.currentContextElement().setPlanEnddate(sqlDate);
Thanks and Regards -
"[Oracle][ODBC]Restricted data type attribute violation
Hi,
I have a program that use the database object,TQuery in Borland C++ Builder 5 to access information on an Oracle8i table. The program was working fine until I updated the Oracle8i ODBC driver from 8.1.5 to 8.1.6.
I am getting the error :
"[Oracle][ODBC]Restricted data type attribute violation."
I can't see what I have done wrong with the SQL statement in the query as it is only a select * from table statement. Can anyone help me with this ? Thank in advance.
C.M.I think I had found what is causing the problem. It looks like the latest Oracle ODBC driver doesn't like any table that
consists of any 2 fields of type NUMBER but with 1 of them having
NOT NULL. >example : >Name Null? Type>-------- --------
----------------- NO1 NUMBER>NO2 NOT NULL NUMBER>I think this is
a bug. >null
I am not sure what you mean by the statement
"the latest Oracle ODBC driver doesn't like any table that
consists of any 2 fields of type NUMBER but with 1 of them having
NOT NULL"
Do you mean there cannot be two not null number columns in a
table witht he latest Oracle ODBC driver.
I am running into the same problem as you did. I am getting a
restricted type violation, and have isolated the column and it is
a number(x,y). I have the the Oracle Client 8.01.06.00 driver
and I have PowerBuilder8.0 as the GUI.
Any help would be much appreciated,
Thanks in advance,
Khanh -
Greetings,
I'm creating a form that allows for emailing attachments however I am having an issue. When I try to attach a file, I get an "Schema validation found non-data type errors." error message. It seems like it's something with the XML structure and
I cannot find anything wrong.
Here is the code:
string myNamespace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Email/my:AttachmentGroup", NamespaceManager).AppendChild())
//Write to XML
InfoPathAttachmentEncoder myEncoder = new InfoPathAttachmentEncoder(currentFile);
writer.WriteStartElement("Attachments", myNamespace);
writer.WriteElementString("attachment", myNamespace, myEncoder.ToBase64String());
writer.WriteElementString("attachmentCheckbox", myNamespace, "false");
writer.WriteEndElement();
writer.Close();
Here is the structure of the XML (root node is myFields):
<my:Email>
<my:AttachmentGroup>
<my:Attachments>
<my:attachment xsi:nil="true"></my:attachment>
<my:attachmentCheckBox>false</my:attachmentCheckBox>
</my:Attachments>
</my:AttachmentGroup>
<my:emailAddress>[email protected]</my:emailAddress>
<my:subject>Paychex ESR Services Paperwork</my:subject>
<my:body/>
<my:selectAll>false</my:selectAll>
</my:Email>
Attachments is the repeating group in this case.
Can anyone spot where the error is coming from?
Thanks!HI,
I fixed it:
Below code is used to fix:
[CODE]
XPathNavigator xfield = null;
DateTime dtmyRecievedDate;
dtmyRecievedDate = Convert.ToDateTime(objInfopathFormcData.myRecievedDate);
if (objFormcData.FcCompletionDate != null)
xfield = myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager);
DeleteNil(xfield);
xfield.SetValue(dtmyRecievedDate.GetDateTimeFormats().GetValue(5).ToString());
// method to delete xsi:nil
private void DeleteNil(XPathNavigator nav1)
if (nav1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
nav1.DeleteSelf();
[/CODE]
Thank you -
Validation while create data type
HI All ,
I have a pop-up in my report that user can create data type in didc,
There is a simple way to support validation for data types ,
I have pop-up where the user need to provide name of attribute
he need to create and the data type for it (char ,string ,int etc )
and he also need to provide the leng of the attribute he want to create
(e.g. char10 ) and also decimal places .
the issue here that i need to do some validation in the pop-up
for e.g. if user choose
case 1
name - attribute1
datatype - string
leng - in this case he dont need to provide leng (string )
dec - dont need to provide (string )
case 2
name - attribute1
datatype - char
leng - 10
dec - dont need to provide (char )
Any idea how to do this validation in a simple way (maybe to use standard functionlity)
Regards
AlexHI Keshav.
What i did is created a popup with FM in the popup i have 4 field
the field with the data type which i want to trigger event to it is domain and not ref to FM
The ppoup have 4 field
attr name
datatype
length
decimal
so from what you are say there is not option to trigger event when the user press F4
and choose a entry from it ,
since what i want to do is that if user for instance chose string i want that the next to fields (length and dec ) will be
remove from the popup since he dont need them .
and for he choose char the the decimal field will remove from the popup
Any idea how to solve this issue ?
Regards
Alex
Edited by: Alex Dean on Oct 12, 2010 3:02 PM -
BC4j-- unable to set date type attribute in a row
when i m set a attribute which is of date type in row of a view.
it is giving me error " cannot create object of date type"
i'll apreciate the answer to this problem
thanx<%
SimpleDateFormat databaseFormat = new SimpleDateFormat();
SimpleDateFormat viewFormat = new SimpleDateFormat();
databaseFormat.applyPattern("yyyy-MM-dd");
viewFormat.applyPattern("MM/dd/yyyy");
// to convert “MM/dd/yyyy” to “yyyy-MM-dd” for updating database
String date_view=”12/31/2001”;
String date_db=new String(databaseFormat.format(viewFormat.parse
(date_view)));
...setAttribute(column_name,date_db);
%> -
Hi,
I am using OWB 10.1.0.2 and using the file module. In the flat file structure i want to pick the data type -
INTEGER(8) however it has no Integer type but has INTEGER EXTERNAL.
I want to use INTEGER(8) how can I use it. OWB dows have that type in file mod.
Thanks
HBNo Integer & Integer External are not the SAME.
INTEGER specifies binary data, while INTEGER EXTERNAL specifies character data that represents a number. I am loading Large Binary data.
So basically, INTEGER(n) is full-word binary integer, where n is an optionally supplied length of 1, 2, 4, or 8. Other imp thing is by default, INTEGER is treated as a SIGNED quantity
When using the INTEGER(8) - it instruct SQL*Loader to process the integers as 8-byte quantities, as oppose to the default 4-byte quantities. Integer(8) support was introduced in Oracle 9i.
So basically I need - INTEGER(8) to process large binary integers I8 and I don't see them in OWB 10.
Any help is appreciated.
Thanks
Harman -
JDBC TYPES.Integer Data Type--Oracle seems useless
I have a set of applications that work on every database I've
tried it on except Orocle. They rely very heavily on making a
query and then grabbing the correct data type (e.g., getInt() vs.
getString()) based on the int value returned in the
ResultSetMetaData. The problem here is that the type returned
for Integer columns, however, is always NUMBER and therefore
always has a decimal place and gets automatically converted into
a double. This wreaks havoc on all of the classes which assume
that certain columns will be int's (e.g., primary keys). Also,
since I'm programming servlets, I am often throwing the values
into forms where the values will be retrieved and have an
Integer.parseInt() run on them--Integer.parseInt() will not work
on Strings with decimal points.
I realize why Oracle does this (because an integer is a number
with no decimals) and what the workaround is (use a
NumberFormatter instead of Integer.parseInt() or use Oracle's
extensions to preset the datatype). But why should I have to
hack up my code just because Oracle programmers can't figure out
how to get its JDBC drivers to return the proper Type code?
Is there any other w
nullI have a set of applications that work on every database I've
tried it on except Orocle. They rely very heavily on making a
query and then grabbing the correct data type (e.g., getInt() vs.
getString()) based on the int value returned in the
ResultSetMetaData. The problem here is that the type returned
for Integer columns, however, is always NUMBER and therefore
always has a decimal place and gets automatically converted into
a double. This wreaks havoc on all of the classes which assume
that certain columns will be int's (e.g., primary keys). Also,
since I'm programming servlets, I am often throwing the values
into forms where the values will be retrieved and have an
Integer.parseInt() run on them--Integer.parseInt() will not work
on Strings with decimal points.
I realize why Oracle does this (because an integer is a number
with no decimals) and what the workaround is (use a
NumberFormatter instead of Integer.parseInt() or use Oracle's
extensions to preset the datatype). But why should I have to
hack up my code just because Oracle programmers can't figure out
how to get its JDBC drivers to return the proper Type code?
Is there any other w
null -
Entity DATE type attribute : Derieved From SQL Expression for date format
Hi,
I want to set one of the Entity's Date Attribute with specific format , for e.g DD-MM-YYYY
I see a Derieved From SQL Expression checkbox, how can I define the SQL Expression
can I use TO_DATE(EMP_START_DATE,'DD-MM-YYYY'), I want to insert a date in that format, when I am creating a row using viewObject.createRow()
Java Type is oracle.jbo.domain.Date which take YYYY-MM-DD as a string, I do not want to use this format
Thanks,Here is a solution, but I am sure it is not the best one. It will work in a hurry. Maybe you can create a helper method to generalize this conversion until something more succinct comes along for US:
This code assumes an import of jbo.oracle.domain.Date.
public void updateDateTest () {
AddressesViewImpl lVO = (AddressesViewImpl)this.getAddressesView1();
AddressesViewRowImpl lRow = (AddressesViewRowImpl)lVO.first();
System.out.println("create date for current record is currently: " +
lRow.getCreationDate());
java.util.Date today = new java.util.Date();
SimpleDateFormat dateFormat =
new SimpleDateFormat("dd-MM-yyyy");
SimpleDateFormat jboDateFormat =
new SimpleDateFormat("yyyy-MM-dd");
String lSampleDateString = "15-04-2010";
java.util.Date lSampleDate = null;
try {
lSampleDate = dateFormat.parse(lSampleDateString);
} catch (ParseException e) {
System.out.println("Parsing exception thrown: " + e.getMessage() +
"\n ==> caused by \n==>"+ e.getCause().getMessage());
lRow.setCreationDate(new Date(jboDateFormat.format(lSampleDate)));
System.out.println("about to commit; create date for current record is currently: " +
lRow.getCreationDate());
this.getDBTransaction().commit();
System.out.println("resetting to some other date; create date for current record is currently: " +
lRow.getCreationDate());
lRow.setCreationDate(new Date(jboDateFormat.format(today)));
this.getDBTransaction().commit();
}I defined this code in my Application Module Impl file and ran it with the BC tester. Here was its output:
Mar 18, 2010 8:27:54 AM oracle.jbo.jbotester.MainFrame main
INFO: BC4J Tester started.
Source breakpoint occurred at line 66 of FusionExperimentsAMImpl.java.
create date for current record is currently: 2009-02-02 12:09:54.0
about to commit; create date for current record is currently: 2010-04-15
resetting to some other date; create date for current record is currently: 2010-04-15I spent a little time looking around the forum for additional solutions. I think several years ago I even wrote a blog entry on this subject. If I remember how to do this right I will amend with more information. -
Query 1)I am creating table in oracle 8.1.7 as
Create table tablea
(fielda INTEGER NULL
Can anybody tell me what is max number of digits that can be stored in fielda.?
I mean INTEGER stands for what in terms of NUMBER datatype.
Query 2)I would be planning to migrate to oracle 9.2
So do I have to make anychange in Scripts for creating new fields of integer datatype.
Say after migrating to oracle 9.2
I want to add the New field fieldb of same type as fielda
So if I put as
Alter table tablea
Add fieldb INTEGER NULL
is it ok ??
or do i have to change something to NUMBER(p) to make it as same type as of fielda
Someone suggested me NUMBER is of different type in Oracle 9.2 than in 8.1.7
I am not 100% sure if anybody has faced such problem your suggestion is appreciated.
Please help...
Regards
MaheshThis is how INTEGER is defined in Oracle:
subtype INTEGER is NUMBER(38,0);
So, it is nothing but a NUMBER datatype with the maximum precision. -
Number / Integer data type
Hi,
How do we remove comma in Number / Integer type field. Is there any setting available or we need to use default field valeu with function.
SundarShilei is correct. If you do not want a comma use a text field.
Edited by: bobb on Mar 5, 2009 7:33 PM
Maybe you are looking for
-
Ipod nano 3rd gen (click wheel)
I currently have a ipod nano 3rd gen with a click wheel. I have uninstalled, reinstalled itunes and rebooted my computer already (I have windows XP). It shows up in "My Computer" as unknown but itunes will not reconize the ipod is connected, but does
-
Flash Player crashing on every website I go to
I'm running on windows 7 using firefox. I need help. Literally every page I go to flash player crashes about 4 times and I have to press "stop pluggin" and wait 30 seconds for the page to respond over and over. I'm about ready to either give up on ad
-
I can not simply load images from my computer & iphoto. I used to now i can not
I used to be able to simply attach & upload images. I used to hit the attach button, then I would see the options incuding pictures as an aoption, I would click on pictures & it would take me to my desktop pics & or iphoto as an option, if i chose ip
-
Process flow 2.6.4
hi i was not able to install processflow server 2.6.4. can any one give correct otn downlink. my oracle database version 10.2.0.1.0 owb Version Oracle Warehouse Builder Client 10.2.0.1.31 Oralce Warehouse Bulder Repository 10.2.0.1.0 Rerards Venkat
-
How can i set my itunes up with someone else itunes
how can i set my itunes up in my moms itunes so i can download music from her comeputer because my computer is been a pice of junk.