Validate datatype
how can i validate an input from user is in a correct datatype? for example, the user input a wrong datatype string into an int datatype field. in that case i need to notify the user and allow him to re-enter the value.
If you are expecting an int, then check whether the given string is an int.
This is a way for doing this
try{
Integer.praseInt(inputString);
//no problem..
catch(Exception e){
//Inform user that you expect an int
In the same way check for other data types
-apppu
Similar Messages
-
Validate datatype of an attribute
Hi,
Need to validate whether value of an attribute is an instance of the datatype of the attribute.
Will the following code work ?
IWDNodeElement element = wdContext.nodePlants.getCurrentElement();
IWDAttributeInfo attrInfo = (IWDAttributeInfo)element;
if (element.getAtrributeText("test") instanceof attrInfo.getDataType()){
//code here
Do let me know.
Thanks !
SriHi
See u need not write any piece of code suppose where u r trying to Validate will Take care of that but ur Action shuld be Validating Action instead of Non-Validating Action.
See the Order of Actions is
1. WebDynpro will Validate First its own rules
2. Next is ur customized Validations will Take Place.
Try having some Empty Action on Input Field i.e onEnter of InputField Like that
See while creating Action for the Button Submission u Dont Check the CheckBox.
if u check it webDynpro will not Validate if not it Validates.
Hi
U need to check whether it is null or not but need not Validate whether it is Numeric or Not.
Wishes
Krishna kanth
Message was edited by: krishna kanth
Message was edited by: krishna kanth -
OSB Validate action problem with xs:short datatype
Hi,
In the XSD, intPayment is defined as xs:short.
We have the validate action in OSB proxy.
If we pass below, everything is fine : (correct)
<intPayment>96</intPayment>
If we pass below, OSB is throwing a validate error indicating fractional digits after decimal point. (correct)
<intPayment>96.01</intPayment>
But if we pass below, OSB validate action is not catching :
<intPayment>96.00</intPayment>
I am assuming that OSB validate action should throw an error that 96.00 is not a valid value. (xs:short restricts any fractional digits after decimal point).
Can you pl help me?
Thanks,
S
Edited by: user13058197 on Jan 13, 2011 10:29 AM
Edited by: user13058197 on Jan 13, 2011 12:16 PMI am assuming that OSB validate action should throw an error that 96.00 is not a valid value. (xs:short restricts any fractional digits after decimal point). Your assumption is incorrect and OSB is working as designed (actually as per XML standard). Actually short datatype is derived from int, int is derived from long, long is derived from integer and integer is derived from decimal.
Definition of Integer (http://www.w3.org/TR/xmlschema-2/#integer) says -
[Definition:] integer is ·derived· from decimal by fixing the value of ·fractionDigits· to be 0and disallowing the trailing decimal point. This results in the standard mathematical concept of the integer numbers. The ·value space· of integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of integer is decimal. And hence xs:short accepts 96.00 but does not accept 96.01
Regards,
Anuj -
How can i validate the data in the control file?
Consider that the SQLLoader reads the Input data File from the path and it loads the data into the tables based up on the descrition specified in the control File.
First, the table to be filled is created:
create table sql_loader_1 ( load_time date, field_1 Numeric, field_2 varchar2(10)
Sample Control File :
load_1.ctl
load data
infile 'load_1.dat' "str '\r\n'"
insert into table sql_loader_1
load_time sysdate,
field_2 position( 1:10),
field_1 position(11:20)
Note that the positions 11 through 20 are loaded into field_1 and positions 1 through 10 into field_2. The field load_time is filled with the current time (sysdate) of the load.
Here's the data. The name of the file (load_1.dat) had been specified with the infile statement in the control file.
load_1.dat
0123456789abcdefghij
foo bar
here comes a very long line
and the next is
short
Here i want to validate the field_1 (Numeric Datatype) since the data file contains the character value (i.e)abcdefghijGood question for this forum:
Export/Import/SQL Loader & External Tables
Werner -
Is it possible to validate a schema defined date
Hi,
Is it possible to validate a schema defined date in xsd as of a null type.
<xs:element name="ContractDt">
<xs:restriction base="xs:date"/>
</xs:element>
In xml file if i want to keep date null and still should be valid......how do i do it
For eg: <ContractDt></ContractDt>
<ContractDt>1990-12-12</ContractDt>
Both the above should be valid.............and any other thing should be invalid. I know we can use patterns and ennumeration to achive this but...............all the other validations that come along schema defined datatype date are required........
Any help.
Regards,
AruHi,
I meant this...........
<xs:element name="ContractDt" nillable="true">
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
Hope my requirement is clear...
Aru -
VLD-2550 and 2551: CLOB datatype errors
Hi All
I've been trying to solve thi sproblem but have not been able to find a solution.
Basically I have a Col1 (of table A) of clob datatype which is to be mapped to Col2 (table B).
But when I validate the map I get the error:
VLD-2550 : BLOB,CLOB or NBLOB data from remote source cannot have transformations (validation details : If you have CLOB,BLOB as remote data source, it must be directly mapped to a target entity)
and
VLD-2551: BLOB LCOB or NBLOB from remote data source must have generation mode set to SET-BASED.
My map has a one to one mapping between the cols of tables A and B. Col1 is directly linked to Col2 (if thats what is meant by no transformations for CLOb types)
Thanks a lotHi ,
If your source table (which have the CLOB ) is in remote machine then you need to configure the mapping in SET base mode and you should directly connect that source column to the target column .
If you still get those kind of validation waring then simple ignore them .
It is a defect in OWB . Refer Bug 5989066 : VALIDATION OF MAP WITH BLOB OBJECTS THROWS VLD-2550 AND VLD-2551 WARNINGS , which is yet to be fixed .
Thanks,
Sutirtha -
Function module to validate input value
Hi all,
can you please provide me the name of the function module to validate input value.
I have a case where i have to validate decimal values. sometimes users may enter wrong decimal values by mistake instead of "0.23" "0..23' and it gives CONVT_NO_NUMBER runtime error so have to come up with some solutions to validate user input.
Please provide me Function module if anybody knows.
Thanks,Try this one
data: lv_htype TYPE dd01v-datatype.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = my_number
IMPORTING
htype = lv_htype.
IF lv_htype NE 'NUMC'.
Raise an error here...
ENDIF. -
Hello all
I'm new to Oracle (have used other DBMSs) and I'm missing a couple of datatypes, so I'm looking for advice as to how to replace them:
boolean: I will need to handle 3-valued logic (true, false and NULL) directly in SQL syntax, i.e. COALESCE, IN, etc.
cidr/inet: how do you handle IPv4 network addresses? I can think of a CHAR(15) and store it directly as a string, but I would like to be able to operate on it to some extent, i.e. validate network masks, broadcast address, etc. Are there some add-on datatypes/operators to handle this?
TIA,
cl.For boolean values, you normally define a CHAR(1) (or VARCHAR2(1)) with a CHECK constraint that restricts the values to one of two values, i.e.
CREATE TABLE t (
bool_col CHAR(1) CHECK( bool_col IN( 'Y', 'N' ) )
)In PL/SQL, you can then use the BOOLEAN data type if you'd like.
For IP addresses, my default would be to declare a VARCHAR2(15) and store the information there. For manipulation, I'd define an IP Address object that would encapsulate whatever IP address logic you want. If you're on 10g, you can also use the regular expression package to define a constraint that ensures a well-formed address.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Need code for this Small validation on when-validate-item
Hi All,
I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
1) It Cannot be "blank"
2) It cannot be "Not older than today"
can you please put me code for this small validation. I am new to Forms.
Thanks in Advance,
ReddyI always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger. -
How to validate a date in xquery transformation
i am doing the xquery transformation for mfl(non-xml) and xml
i have a date-pickup and i should validate this field as my datatype is date , instead of date i am getting the data as 00000000 ,my date-pickup format is yyyymmdd
can we do a validation for this specific field and all the failed date validations should be written as blank tag in xsd
Please give me a suggestion for thisHi,
There's a xquery extension function that you can use for that
fn-bea:date-from-string-with-format
The fn-bea:date-from-string-with-format() function returns a new date value from a string source value according to the specified pattern.
The function has the following signature:
fn-bea:date-from-string-with-format($format as xs:string?, $dateString as xs:string?) as xs:date?
where $format is the pattern and $dateString is the date. For more information about specifying patterns, see Date and Time Patterns.
Examples:
fn-bea:date-from-string-with-format("yyyy-MM-dd G", "2005-06-22 AD") returns the specified date in the current time zone.
fn-bea:date-from-string-with-format("yyyy-MM-dd", "2002-July-22") generates an error because the date string does not match the specified format.
fn-bea:date-from-string-with-format(“yyyy-MMM-dd”, “2005-JUL-22”) returns the specified date in the current time zone.
http://docs.oracle.com/cd/E13162_01/odsi/docs10gr3/xquery/extensions.html#wp1297249
Cheers,
Vlad
It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts)
https://forums.oracle.com/forums/ann.jspa?annID=893 -
WSDL, custom datatypes, fault element name issues
Hello all,
I am having a LOT of problems with BEAs webservices. I am posting
this here in the hope that someone can help me and tell me what I am
doing incorrectly. I am running
WebLogic Server 7.0 SP1 Mon Sep 9 22:46:58 PDT 2002 206753
WebLogic XMLX Module 7.0 SP1 Mon Sep 9 22:54:41 PDT 2002 206753
Background:
My goal is to make my company's product web services aware. I take an
EJB, try to run it through the standard ant tasks and generate a web
services accessible EJB. Sounds pretty easy, but complex types seem
to make this quite difficult.
I have been able to create a web service accessible EJB (only since
7.0.1), but I am quite unhappy with the quality of what I am able to
produce.
I have a datatype which acts as a key, but it does not follow the
javabeans idiom - i.e. it does not have a default constructor or
accessor methods and I am not in the position to change it. I have
created a codec for this class which works and an xml schema (both by
hand). Its name is AgentKey. I have also had to use the autotyper to
create codecs and typemapping entries for java.util.Properties,
I can connect using the WebLogic classes and I am now trying to
interact using MS Excel and Apache's Axis as my test clients.
Issues:
My first question deals with generating a client. There seem to be
two ways to generate a client. Firstly via the <client> subtask of
<servicegen><service>, the second way via <clientgen> task. Since I
am using a custom data type (AgentKey) I have to manually insert the
AgentKey schema into the web-services.xml file generated by
servicegen. When I try to generate a client via the
servicegen/service/client task there is no opportunity for me to
insert this datatype schema information and I therefore get the
following messages (lots of them, but I'm only including one):
[servicegen] WARNINIG: Unable to find a javaType for the xmlType:['java:net.agentis.apml.runtime']:AgentKey.
Make sure that you have registered this xml type in the type mapping
[servicegen] Using SOAPElement instead
BTW: I am also receiving the same problem with java.util.Properties.
BTW: WARNING is misspelt
If I attempt to generate a client class via the <clientgen> task, I
need to supply either a wsdl or ear file as a parameter. I cannot
supply a wsdl file because I haven't deployed the EAR yet (and I don't
want to until the EAR has the client classes in it), and I can't
supply the EAR because I want the ear to include the client classes.
It is a bit of a catch 22 situation. Is there a solution I can't see?
NOTE: it would be very, very nice if you added a schemaMapping
attribute to the <servicegen/service> task so the web-services.xml
file didn't have to be manually hacked. Something similar to the
typemapping attribute already in the servicegen/service task would do
it.
My next problem deals with the validity of the WSDL. I am seeing that
the WSDL created has exceptions defined multiple times. I saw a
message from Manjo saying that it looked like a bug. I agree and
would like to get a copy of the patch. On a more significant note,
when is either SP2 or 7.1 due for release?
Another problem with the WSDL (once you have cleansed the multiple
exception messages) is that the fault elements of the
binding/operation elements require names and they don't have any. For
example, this is straight from the deployed EJB WSDL file:
<binding name="ExampleAgentPortSoapBinding" type="tns:ExampleAgentPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="serviceWithPrimitiveDatatypes">
<soap:operation soapAction="" style="rpc"/>
<input>
<soap:body use="encoded" namespace="http://sillyurl.com/reallysilly"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://sillyurl.com/reallysilly"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault>
<soap:body use="encoded" namespace="http://sillyurl.com/reallysilly"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
<operation ...
The schema definition at http://schemas.xmlsoap.org/wsdl/ says the
fault element require a name attribute:
<complexType name =" tBindingOperationFault">
<complexContent>
<extension base="wsdl:tExtensibleDocumented">
<attribute name="name" type="NCName" use="required"/>
</extension>
</complexContent>
</complexType>
The name of the fault should be the same name as the fault in the
portType definition. In my example the name is "AgentisException" as
evidenced by this snippet:
<portType name="ExampleAgentPort">
<operation name="serviceWithPrimitiveDatatypes">
<input message="tns:serviceWithPrimitiveDatatypes"/>
<output message="tns:serviceWithPrimitiveDatatypesResponse"/>
<fault name="AgentisException" message="tns:AgentisException"/>
</operation>
Once these changes have been made then the WSDL will validate. Are
there plans to fix these bugs?
On a different note, when I try to interact with a method that uses a
custom data type, such as AgentKey, via the "WebLogic Webservice
standard testing home page" the custom data type without a default
constructor cannot be rendered correctly. For instance, the AgentKey
value is:
<!-- Do not know how to create a sample instance for this part due to the following
exception:java.lang.InstantiationException: net.agentis.apml.runtime.AgentKey.
Pls replace this with the correct XML before invoking the service. --->
<agentKey/>
Since I can't deploy a valid WSDL, I can't get either Axis or Excel to
connect to my web services.
When I attempt to invoke Axis' (beta 1.1) wsdl2java I recieve the
following message.
java.io.IOException: ERROR: Fault is missing a name= attribute in operation
"serviceWithPrimitiveDatatypes", in binding {http://sillyurl.com/reallysilly}ExampleAgentPortSoapBinding.
This seems understandable considering the issues I mentioned earlier.
Unfortunately Excel doesn't really give me anything to go with. If I
type in the WSDL URI then it will give me a list of methods I can
invoke, but if I try to add the service I get the very unhelpful "The
Web Service References Tool could not generate the requested code.
Any changes that were made to your project have been rolled back."
Any help with those two issues would be greatly appreciated also.
One final issue is that I cannot seem to fix is taskdef'ing
<servicegen> properly from Ant. I can do the actual taskdef but then
it cannot find classes from within the weblogic.jar. If I run the
setExamplesEnv.cmd first the I don't need to do the taskdef and
everything works fine. Has anyone else had this issue? (we can't run
that command on our clients desktops before we build our build scripts
- anyway, I've put it down to one of those weird Ant classpath
issues.)
In summary:
Problems I can see and would like some help on are:
- multiple exception messages
- fault operations with no name
- the ability to generate client code with complex data types before
the EAR is deployed.
Could the product team add
- a clean way to add in schema datatypes without having to manually
hack the web-services.xml file.
I know this has been quite a long email, but it has been months in the
making. Anyone's time would be greatly appreciated.
Mark Mansour
Agentis Software
[email protected]Hi Mark,
From your base post:
My next problem deals with the validity of the WSDL. I am seeing that
the WSDL created has exceptions defined multiple times. I saw a
message from Manjo saying that it looked like a bug. I agree and
would like to get a copy of the patch. On a more significant note,
when is either SP2 or 7.1 due for release?I would recommend starting here with support since getting valid WSDL seems to be the root of most of
your issues.
Concerning the upcoming release, I believe it is scheduled for late this quarter; contact Michael
([email protected]) for more information.
Also, at the bottom of this post:
I would just like to see an automated way to do this (I've had to write my own
utility to do this for me :(Does the autotype ant task help in this situation? Have you taken a look at this?
http://e-docs.bea.com/wls/docs70/webserv/anttasks.html#1080062
Thanks,
Bruce
Mark Mansour wrote:
Hiya Bruce,
I will try and get some time to follow this up with the support people too.
In response:
Problems I can see and would like some help on are:
- multiple exception messages
In your client code, you can set the following property to avoid the exceptionmessages so that the typemapping
registry can be setup.
//dont parse wsdl till we set the typemapping
System.setProperty( "weblogic.webservice.servicenamechecking","false" );
This is not a client issue. The WSDL is generating incorrect WSDL. Here is a
little snippet :
<message name="AgentisException" >
<part name="AgentisException" xmlns:partns="http://www.w3.org/2001/XMLSchema"
type="partns:string" />
</message>
<message name="setTraceLevel" >
<part name="agentKey" xmlns:partns="java:net.agentis.apml.runtime" type="partns:AgentKey"
/>
<part name="intVal" xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int"
/>
</message>
<message name="AgentisException" >
<part name="AgentisException" xmlns:partns="http://www.w3.org/2001/XMLSchema"
type="partns:string" />
</message>
As you can see the AgentisException is defined twice (in my real WSDL it is redefined
every time a method has the AgentisException in its interface (which in my case
is 5 times))
- fault operations with no nameI believe the fault issues that you have raised have been addressed in the upcomingrelease that will be
available for beta testing shortly. Contact [email protected] if you
want to participate in the beta.
great. Is there any ETA on the final release date?
- the ability to generate client code with complex data types before
the EAR is deployed.
There is an example to show how to do this: http://dev2dev.bea.com/direct/webservice/dyncmplx.zip
Unfortunately this doesn't solve my problem. I still don't have an EAR or WSDL
file from which I can generate a client to be included in the final EAR file that
gets deployed to the server. My original post explains this a bit better.
Could the product team add
- a clean way to add in schema datatypes without having to manually
hack the web-services.xml file.
Take a look at http://dev2dev.bea.com/direct/webservice/wswa.html#qz50 and others
in this area.
This was more in reference to the building of the web services in the first place
rather than registering custom datatypes at runtime. The manual procedure is
documented at http://edocs.bea.com/wls/docs70/webserv/customdata.html#1058102,
I would just like to see an automated way to do this (I've had to write my own
utility to do this for me :(
Hope this helps,
Bruce
Thanks Bruce.
Mark -
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 -
DB Adapter - DB2 Graphic Datatype Error
Hello,
I am running into an issue with using the DB Adapter to insert into a DB2 database hosted on an AS/400. The column I am attempting to insert into is a graphic datatype which contains character data. The table is a JD Edwards table where character data is stored in graphic columns.
My development environment consists of the following:
J Developer 11.1.1.5
SOA Suite 11.1.1.5
DB2/400 Version 6, release 1
JDBC Driver - IBM JT400.jar
WebLogic 10.3.5
When I run the composite application in WebLogic, the process faults at the insert statement (error messages are posted below). When I look at my or-mappings.xml file I find the following mapping for the column causing the error:
<attribute-mapping xsi:type="direct-mapping">
<attribute-name>absic</attribute-name>
<field table="F0101" name="ABSIC" xsi:type="column"/>
<attribute-classification>[B</attribute-classification>
</attribute-mapping>
The attribute-classification seems incorrect. In J Developer 10, the attribute-classification was java.lang.String. When I manually change this attribute to java.lang.String, the application works correctly. This same error happens on all graphic datatype columns. At the top of the or-mappings.xml file, there is a reference to eclipselink. In J Developer 10, I think there was a reference to Toplink vs Eclipselink. So it appears that J Developer is now using EclipseLink by default to create the or-mappings.xml file.
I would rather not have to change the attribute-classification each time I want to create an insert statement. Is there a way to fix/configure how J Developer/EclipseLink creates this mapping? Is it safe to manually edit the or-mappings.xml file?
Thanks in advance.
The error messages I receive are:
<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [F0101.F0101]. Caused by Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince". Please see the logs for the full DBAdapter logging output prior to this exception. ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2 UDB for AS/400. Please validate your platformClassName setting. This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail> Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince"</detail></part><part name="code"><code>null</code></part></bindingFault></bpelFault>
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [F0101.F0101]. Caused by Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince". Please see the logs for the full DBAdapter logging output prior to this exception. ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2 UDB for AS/400. Please validate your platformClassName setting. This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.Resolution: Oracle created a patch for J Developer to solve the problem. Essentially the patch mapped the graphic datatypes to string datatypes. This was the behavior in Oracle 10g. I'm not sure how things are going to work if/when we have a graphic column that actually contains binary data instead of string.
Patch that I applied: p13591655_111160_Generic.zip -
API to validate a value against a value set
I have a 'Table' Value Set based on the MTL_CATEGORIES_V view, and need to validate some loaded data against it to check the loaded values are are valid. Rather than use a cursor to perform a lookup of the value in MTL_CATEGORIES_V, is there an API that can be used instead?
I thought I'd found something when I discovered "FND_FLEX_VAL_UTIL.is_value_valid", but this seems to just check that a value meets the criteria of the valueset based on the datatype. size, hi-lo range etc, it doesn't check if the value is actually permitted within the set.
AndyHi,
you can use fm FM_DOMAINVALUE_CHECK. Pass parameter values for I_DOMNAME and I_DOMVALUE.
If the value is invalid, exception VALUE_NOT_ALLOWED will occur.
Regards,
Klaus -
DB Adapter - DB2/JD Edwards Graphic Datatype Error
Hello,
I am not sure which forum I should post this question to. If there is another forum, please let me know.
I am running into an issue with using the DB Adapter to insert into a DB2 database hosted on an AS/400. The column I am attempting to insert into is a graphic datatype which contains character data. The table is a JD Edwards table where character data is stored in graphic columns.
My development environment consists of the following:
J Developer 11.1.1.5
SOA Suite 11.1.1.5
DB2/400 Version 6, release 1
JDBC Driver - IBM JT400.jar
WebLogic 10.3.5
When I run the composite application in WebLogic, the process faults at the insert statement (error messages are posted below). When I look at my or-mappings.xml file I find the following mapping for the column causing the error:
<attribute-mapping xsi:type="direct-mapping">
<attribute-name>absic</attribute-name>
<field table="F0101" name="ABSIC" xsi:type="column"/>
<attribute-classification>[B</attribute-classification>
</attribute-mapping>
The attribute-classification seems incorrect. In J Developer 10, the attribute-classification was java.lang.String. When I manually change this attribute to java.lang.String, the application works correctly. This same error happens on all graphic datatype columns. At the top of the or-mappings.xml file, there is a reference to eclipselink. In J Developer 10, I think there was a reference to Toplink vs Eclipselink. So it appears that J Developer is now using EclipseLink by default to create the or-mappings.xml file.
I would rather not have to change the attribute-classification each time I want to create an insert statement. Is there a way to fix/configure how J Developer/EclipseLink creates this mapping? Is it safe to manually edit the or-mappings.xml file?
Thanks in advance.
The error messages I receive are:
<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [F0101.F0101]. Caused by Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince". Please see the logs for the full DBAdapter logging output prior to this exception. ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2 UDB for AS/400. Please validate your platformClassName setting. This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail> Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince"</detail></part><part name="code"><code>null</code></part></bindingFault></bpelFault>
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [F0101.F0101]. Caused by Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [xs:base64Binary SR Test Case - Vince], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 3 before EOF, the 10 most recent characters were: "se - Vince". Please see the logs for the full DBAdapter logging output prior to this exception. ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2 UDB for AS/400. Please validate your platformClassName setting. This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.Just as an FYI for anyone else running into this problem - we have had an SR open with Oracle Support for a while on this and they are working on the issue.
The problem is essentially this:
JDE Oneworld running on iSeries/DB2 utilized CCSID 65535 GRAPHIC data types behind the scenes to handle storage of unicode information in EBCDIC. The JDBC driver handles this conversion for you, returning unicode data as long as you include the "translate binary=true" clause in the JDBC connection string. The driver returns string/nchar data for these CCSID 65535 GRAPHIC fields - they are not returned to the client as binary/clobs.
SOA Suite 10.1.3.4.0 used "Oracle Toplink - 10g Release 3" for object persistence and mappings. In 11g, this was swapped out to use "Eclipse Persistence Services 2.x.x" for the object persistence and mappings. The original Toplink had a default behavior, that if it did not understand the type of the field, it would assume that the driver was handling it and would assume it was a string value, ie it would map it as xs:string and NCHAR. So one could argue (and Oracle support did...) that it was a bug that this ever worked in 10g/OAS. However it was a bug that worked out favorably. Eclipse Persistence Services did not have this bug, and whenever the developers see a GRAPHIC db data type, they assume that the information being returned to the client by the JDBC driver is in xs:base64Binary format.
Bottom line if you do a simple hello world java project to use the jdbc driver and return the value, and examine that in hex, it is returning straight string values, not xs:base64Binary format stuff that need blob conversion code run.
The good news is that Oracle has come up with a solution and is working on a patch for Oracle SOA 11.1.1.6.
As a side note - Vince came up with a temporary workaround to get this working, which involves changing the three generated mappings/schema files manually to update the types, and per a suggestion from a very helpful Oracle technical Sales resource (Mike Loos) was working on an ant script to automate that process.
If you need any more details, post and let us know. Vince or I will update this message when the patch is available.
Jim
Maybe you are looking for
-
Hello, This is my first project using Premiere. Great program, when you know what you're doing. Right now, I'm on a modest laptop, Vista 32-bit, 2 gigs of RAM, Dual CPU @ 2.00 ghz. My project consists of .wma files, some .mp3's, .wav's, and some .jpg
-
Cannot open my NEF files in Photoshop CS6 from my new Nikon D800 camera.
That's it, I Cannot open my NEF files in Photoshop CS6 Camera Raw from my new Nikon D800 camera. What am I doing wrong or what is wrong? I have the plug-in Camera Raw 7. and can open TIFF files but not the NEF files. Peace, Charles Fennen
-
I have done this and my email messages disappeared. I would like to get them back.
-
getting "We could not complete your update. Failed to verify the preflight file. It is not signed by Apple." message when trying to update Apps via the App Store. Get similar message for download of a free app. Console message is:10/23/13 2:00:
-
ISE and AD.. Users Cant login with domain credentials after changing password
Hello guys, I have ISE 1.2 running in a live environment. I have a problem that users cant login after password has expired and changed. i have enabled password change under AD settings and have also checked the allow password change in the allowed p