Variable substitution in Unit Testing validation - Date format?
Using SQL Developer unit testing, I am having difficulty comparing Date datatype in a validation.
I use a Dynamic Value Query to set the parameters of an insertion procedure under test.
select * from (select doc_nbr as p_mstr_doc_nbr, doc_nbr as p_assoc_doc_nbr, sysdate as p_date_added from documents sample(0.01) order by dbms_random.random) where rownum <= 1;So P_DATE_ADDED is a DATE datatype.
I wish to validate that the insertion was correct. So I run a Process Validation returning one or more rows.
SELECT * FROM X100_ASSOC
WHERE MSTR_DOC_NBR = '{P_MSTR_DOC_NBR}'
AND ASSOC_DOC_NBR = '{P_ASSOC_DOC_NBR}'
AND to_char(DATE_ADDED,'dd-MON-yy HH24:MI:SS') = {P_DATE_ADDED};I understand that the {P_DATE_ADDED} is substituting in a string. From Help page :
"What is actually substituted is the string representation of the parameter value. For example:
If P1 is a parameter of type NUMBER and has the value 2.1, the string {P1} will be replaced by the string 2.1.
If P1 is a parameter of type VARCHAR2 and has the value ABC, the string '{P1}' will be replaced by the string 'ABC'. (Note the single-quotation marks around {P1} in this example.)"
I need to know the format that the date is cast into as a string. Then I can do the comparision on the where clause.
Any answers? or details of where is more in depth documentation?
Thank you,
Bill
I agree as a general rule. However in this case, it appears that the variable substitution routine is returning the default format. So to compare my expected data to the returned data I choose to use the default format. If the variable substitution routine specified an explicit format, I would use that. In my original question, I asked if anyone knew the format.
Regards,
Bill
Similar Messages
-
Used variable substitution to substiture the field 'date' in file name
Hi gurus
I have used variable substitution to substiture the field 'date' (dd/MM/yyyy/hh/mm/ss) in the file name so when empty payload (a valid xml ) is generated by Message mapping then the communication channel is failing by showing the following error
File processing failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during
variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload
: date
As of now the business is not getting effected as the business scenarion needs only customer master data at the reciever side But when ever there is no custmer master data in the sourse side the message mapping is generating an empty payload and the communication channel is failing ( so it is an internal issue and is there any way which could solve the both (ie the business must not get effected and as well the communication channel must not fail)
any coments on this will be higly apreciated
thanks and regards
sandeepHi Sandeep -
Yes If you use the Variable substitution from the payload , that perticular field has to be generated in the target structure.
To handle this You can do the following:
Sourcefield --->exists -> IfThenElse-->TargetField
Where SourceField>exists(node function)-> If
SourceField -
>Then
CurrentDate(Date Function)----->Else
Hope this will help !!
Regards.
Jeet. -
How test the date formats M/d/yyyy and MM/dd/yyyy .
how test the date formats M/d/yyyy and MM/dd/yyyy .format should accept 3/3/1982 and 03/03/1982 dates.
please help megeorgemc wrote:
kajbj wrote:
Spoiler: Reply #3 is actually the answer to your question.Also, Bruce Willis is a ghost, the Titanic sinks and Verbal is Keyzer Soze.Only one of those endings really surprised me.
You should've heard me in that theatre when the Titanic struck that iceberg... -
F:convertDateTime - how to define two valid date formats?
I have an input field that accepts a date. There are two valid date formats allowed: yyyyMMdd & yyyyMMM
I am currently doing this ...
<h:inputText ...>
<f:convertDateTime pattern="yyyyMMdd" />
<f:convertDateTime pattern="yyyyMMM" />
</h:inputText>
... but only the second date format is being accepted as valid.
How can I specify two valid date formats for the input?
Thanks,
rh
Edited by: user13328234 on Oct 27, 2010 12:47 PMuser13328234 wrote:
Thanks for the suggestion. I was actually using it for validation, so I implemented a custom validator so I'm good now.
But, for some reason I expected it to work with two converters specified, and I'm a little disappointed it didn't work.
Thanks again,
rhExpecting = assuming. Its getting old and annoying now, but it remains a very bad idea.
The fact of the matter is that you have a very specific need. There is only one way to tailor to specific needs in a generic API: allow to override default behavior. The other option is to create a bloated API that tries to incorporate so many bells and whistles that it becomes unusable. So in my opinion, JSF is designed exactly the way it is supposed to be in this respect. -
Unit Test Validation for Output Ref Cursor Not Working
Here is the problem:
I have a stored procedure as follows:
CREATE OR REPLACE
PROCEDURE usp_GetEmployee(
p_employeeId IN NUMBER,
cv_employee OUT Sys_RefCursor )
AS
BEGIN
OPEN cv_employee FOR SELECT * FROM employees WHERE employee_id=p_employeeid;
END usp_GetEmployee;
For this, I am implementing a unit test.
* In the "Select Parameters" step, I am unchecking the "Test Result" check box for the cursor OUT variable.
* In the "Specify Validations" step, I am choosing "Boolean Function" and putting the following PL/SQL code:
DECLARE
emp_rec {cv_employee$}%rowtype;
BEGIN
FETCH {cv_employee$} INTO emp_rec;
IF {cv_employee$}%FOUND THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
RETURN TRUE;
END;
But, when I try to execute this Test, I get the following error:
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
If I run in the debug mode, I get the following content in a dialog box:
The following procedure was run.
Execution Call
BEGIN
"ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
CV_EMPLOYEE=>:2);
END;
Bind variables used
:1 NUMBER IN 1001
:2 REF CURSOR OUT (null)
Execution Results
ERROR
CV_EMPLOYEE : Expected: [Any value because apply check was cleared], Received: [EMPLOYEE_ID COMMISSION_PCT SALARY
1001 0.2 8400
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@31dba0> to REF CURSOR.
Please suggest how to handle this issue.
Thanks,
Rahul979635 wrote:
But, when I try to execute this Test, I get the following error:
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
If I run in the debug mode, I get the following content in a dialog box:
The following procedure was run.
Execution Call
BEGIN
"ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
CV_EMPLOYEE=>:2);
END;
Bind variables used
:1 NUMBER IN 1001
:2 REF CURSOR OUT (null)
Try explicity declaring the ref cursor instead of using a bind variable, something like (untested)
begin
foo sys_refcurosr;
begin
test_procedure(foo);
end;Alternately, in SQL*PLUS use the DEFINE command to ste a named bind variable to type REFCURSOR and use the named bind variable in your test
Edited by: riedelme on Jan 23, 2013 7:10 AM -
SQL Developer Unit Testing - Validation with PL/SQL
Hi,
I am trying to create Unit tests using SQL Developer UT framework.
But when i am creating validation using User PL/SQL code option.
Then how can i check value returned by l_count in code snippet below:
-- Please raise an exception if the validation fails.
-- For example:
DECLARE
l_count NUMBER;
wrong_count EXCEPTION;
BEGIN
SELECT count(*) into l_count
FROM test_recon
WHERE
match_num = 99836936
AND Stg_status_flag <> 'E';
IF l_count = 0
THEN
RAISE wrong_count;
END IF;
END;
Also, can someone please refer me to few more demo examples (apart from oracle docs) to implement good test cases with SQL developer.
I appreciate your help.
Regards
DipaliProbably not the answer you're looking for, but back when I was playing around with the Unit Test stuff, I didn't have sys privs, and the DBAs were a little busy at the time to set a up a repository for me. Rather than wait, I installed Oracle XE on my machine and created a small dev schema and deployed unit test to that. It's so much easier to perform quick proof of concepts when you have full control.
-
Using default application date format substitution string
I'd like to reference something like ":app_default_date_format" to set date formats in sql statements.
Does a substitution string exist that returns the default application date format?
Thanks,
-KenHello Ken,
>> I'd like to reference something like ":app_default_date_format" to set date formats in sql statements.
Isn’t the whole point of defining an application date format to avoid the need to specifically reference date formats?
>> Does a substitution string exist that returns the default application date format?
I’m not familiar with an official substitution string for the application date format but you can use wwv_flow.g_date_format .
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More -
GATP - Issue with substitution rules with validity dates
Hi,
We are using GATP with RBA. Our condition table has plant as a field.
We are planning to have a substitution procedure (rules) defined at plant level.
Our rule control for product substitution list is "Start from top of list"
The issue we are facing is explained below.
The first item in the substitution procedure (rule) cannot have validity dates.
So it will always be balnk. And validity dates can be maintained for other items in the procedure (rule).
What happens in our scenario is when there is a requirement on an item in the substitution procedure (rule) which has a validity date, the first item in the procedure (which can never have validity dates) is never considerd for substituions.
If I remove the validity dates, then the first item in the procedure (rule) is considered for substitutions.
We find this strange and against our business requirement. We want the first item in the procedure (rule) to be considered for substitution ireespective of the validity date for the requested product.
It would be great if you could suggest a method to achieve this.
Thanks & regards,
Arvind.SHi Mohan,
Thanks for the response.
We are using back order processing (BOP) for allocation.
We observed that the first item was not getting considered for substitution in the BOP results and also in product view after the BOP run. No stock of that item was allocated for the order taken up in the BOP run.
However, we tried rule evaluation also. It shows the first item also, but in actual allocation the issue exists.
We are not using "start immediately" in check instructions.
Thanks & regards,
Ashok -
Pls Help with date format picture ends ......error
Hi Everyone,
I am getting the following error when I run my crystal report.
Failed to retrieve data from the database.
Details: HY000:[DataDirect][ODBC Oracle driver][Oracle]ORA-01830: date format picture ends before converting entire input string
[Database Vendor Code: 1830]
I am using SQL Command for my report and in the command my date fields are of "Date" datatype.
I am using Crystal Reports XI R2,driver - CR Oracle ODBC Driver 5.1
Any help is greatly appreciated.
Thanks in advance
My SQL Command is as follows:
<
with MAXNEWSTAT as
(select
/--Added by HAN--/
HRHISTORY.COMPANY,
HRHISTORY.EMPLOYEE,
MAX(HRHISTORY.ACT_OBJ_ID) ACT_OBJ_ID
FROM
LAWSON.HRHISTORY
WHERE
HRHISTORY.FLD_NBR=20
and TO_DATE(HRHISTORY.DATE_STAMP)
>= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD')
AND TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
/--Added by HAN--/
GROUP BY COMPANY,
EMPLOYEE),
NEWSTAT AS
(SELECT
/--Added by HAN--/
HRHISTORY.COMPANY,
HRHISTORY.EMPLOYEE,
HRHISTORY.A_VALUE,
HRHISTORY.DATE_STAMP,
HRHISTORY.BEG_DATE,
HRHISTORY.ACT_OBJ_ID NS_OBJ_ID,
HRHISTORY.SEQ_NBR
FROM
LAWSON.HRHISTORY
INNER JOIN LAWSON.MAXNEWSTAT
ON
/--Added by HAN--/
HRHISTORY.COMPANY = MAXNEWSTAT.COMPANY
/--Added by KAM--/
AND HRHISTORY.EMPLOYEE = MAXNEWSTAT.EMPLOYEE
AND HRHISTORY.ACT_OBJ_ID = MAXNEWSTAT.ACT_OBJ_ID
WHERE
HRHISTORY.FLD_NBR=20
and TO_DATE(HRHISTORY.DATE_STAMP)
>= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD')
AND TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
PREVSTATID AS
(SELECT
/--Added by HAN--/
HRHISTORY.COMPANY,
HRHISTORY.EMPLOYEE,
MAX(HRHISTORY.ACT_OBJ_ID)OBJ_ID
FROM
LAWSON.HRHISTORY
INNER JOIN LAWSON.NEWSTAT
/--Added by HAN--/
ON HRHISTORY.COMPANY = NEWSTAT.COMPANY
AND HRHISTORY.EMPLOYEE = NEWSTAT.EMPLOYEE
WHERE
HRHISTORY.FLD_NBR=20
AND TO_DATE(HRHISTORY.BEG_DATE)
< to_date(NEWSTAT.BEG_DATE)
GROUP BY
/--Added by HAN--/
HRHISTORY.COMPANY,
HRHISTORY.EMPLOYEE
PREVSTAT AS
(SELECT
/--Added by HAN--/
HRHISTORY.COMPANY,
HRHISTORY.EMPLOYEE,
HRHISTORY.A_VALUE A_VALUE,
HRHISTORY.DATE_STAMP DATE_STAMP,
HRHISTORY.BEG_DATE BEG_DATE,
HRHISTORY.ACT_OBJ_ID OBJ_ID,
HRHISTORY.SEQ_NBR SEQ_NBR
FROM
LAWSON.HRHISTORY
INNER JOIN LAWSON.PREVSTATID
/--Added by HAN--/
ON HRHISTORY.COMPANY = PREVSTATID.COMPANY
AND HRHISTORY.EMPLOYEE = PREVSTATID.EMPLOYEE
WHERE
HRHISTORY.FLD_NBR=20 AND
HRHISTORY.ACT_OBJ_ID = PREVSTATID.OBJ_ID
MAXPERSACTHST AS
(SELECT
PERSACTHST.EMPLOYEE,
/--Added by KAM--/
PERSACTHST.COMPANY,
MAX(PERSACTHST.DATE_STAMP)DATE_STAMP
FROM
LAWSON.PERSACTHST
WHERE
(PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
AND TO_DATE(PERSACTHST.DATE_STAMP)
>= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD')
AND TO_DATE(PERSACTHST.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
GROUP BY PERSACTHST.EMPLOYEE,
/--Added by KAM--/
PERSACTHST.COMPANY
CHANGELIST AS
(SELECT
PERSACTHST.EMPLOYEE,
/--Added by KAM--/
PERSACTHST.COMPANY,
PERSACTHST.ACTION_CODE,
PERSACTHST.REASON_01,
PERSACTHST.DATE_STAMP,
PERSACTHST.EFFECT_DATE,
PERSACTHST.REASON_02,
PREVSTAT.A_VALUE PS_A_VALUE,
PREVSTAT.DATE_STAMP PS_HR_DATE_STAMP,
PREVSTAT.BEG_DATE PS_HR_BEG_DATE,
PREVSTAT.OBJ_ID PS_HR_OBJ_ID,
PREVSTAT.SEQ_NBR PS_HR_SEQ_ID,
NEWSTAT.A_VALUE NS_A_VALUE,
NEWSTAT.DATE_STAMP NS_DATE_STAMP,
NEWSTAT.BEG_DATE NS_BEG_DATE,
NEWSTAT.NS_OBJ_ID,
NEWSTAT.SEQ_NBR NS_SEQ_NBR
FROM
LAWSON.PERSACTHST PERSACTHST
INNER JOIN LAWSON.PREVSTAT
ON PERSACTHST.EMPLOYEE=PREVSTAT.EMPLOYEE
/--Added by KAM--/
AND PERSACTHST.COMPANY = PREVSTAT.COMPANY
INNER JOIN LAWSON.NEWSTAT
ON PERSACTHST.EMPLOYEE = NEWSTAT.EMPLOYEE
/--Added by KAM--/
AND PERSACTHST.COMPANY = NEWSTAT.COMPANY
INNER JOIN LAWSON.MAXPERSACTHST
ON PERSACTHST.EMPLOYEE = MAXPERSACTHST.EMPLOYEE
/--Added by KAM--/
AND PERSACTHST.COMPANY = MAXPERSACTHST.COMPANY
WHERE
(PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
AND NEWSTAT.A_VALUE <> PREVSTAT.A_VALUE
AND MAXPERSACTHST.DATE_STAMP = PERSACTHST.DATE_STAMP
PAEMPPOSENDDATE AS
(SELECT
PAEMPPOS.EMPLOYEE,
PAEMPPOS.COMPANY,
CASE
WHEN PAEMPPOS.END_DATE = TO_DATE('1700,01,01','YYYY,MM,DD')
THEN to_date(SYSDATE + 1,'YYYY,MM,DD')
ELSE PAEMPPOS.END_DATE
END END_DATE,
PAEMPPOS.EFFECT_DATE
FROM LAWSON.PAEMPPOS),
CURRFTE AS
(SELECT
PAEMPPOS.EMPLOYEE,
/--Added by KAM--/
PAEMPPOS.COMPANY,
PAEMPPOS.FTE CURR_FTE,
PAEMPPOS.EFFECT_DATE,
PAEMPPOSENDDATE.END_DATE
FROM
LAWSON.PAEMPPOS
INNER JOIN LAWSON.NEWSTAT
ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
/--Added by KAM--/
AND (PAEMPPOS.COMPANY = NEWSTAT.COMPANY)
INNER JOIN LAWSON.PAEMPPOSENDDATE
ON PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE
/--Added by KAM--/
AND PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY
AND PAEMPPOS.EFFECT_DATE=PAEMPPOSENDDATE.EFFECT_DATE
WHERE
(PAEMPPOSENDDATE.EFFECT_DATE <= NEWSTAT.BEG_DATE AND PAEMPPOSENDDATE.END_DATE >= NEWSTAT.BEG_DATE)
PREVFTE AS
(SELECT
PAEMPPOS.EMPLOYEE,
/--Added by KAM--/
PAEMPPOS.COMPANY,
PAEMPPOS.FTE PREV_FTE,
PAEMPPOSENDDATE.END_DATE
FROM
LAWSON.PAEMPPOS
INNER JOIN LAWSON.NEWSTAT
ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
/--Added by KAM--/
AND (PAEMPPOS.COMPANY = NEWSTAT.EMPLOYEE)
INNER JOIN LAWSON.PAEMPPOSENDDATE
ON (PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE)
/--Added by KAM--/
AND (PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY)
AND (PAEMPPOS.EFFECT_DATE = PAEMPPOSENDDATE.EFFECT_DATE)
WHERE
PAEMPPOS.EFFECT_DATE <= (NEWSTAT.BEG_DATE-1)AND PAEMPPOSENDDATE.END_DATE >= (NEWSTAT.BEG_DATE -1)
SELECT DISTINCT
EMPLOYEE.EMPLOYEE,
EMPLOYEE.DEPARTMENT,
EMPLOYEE.PROCESS_LEVEL,
EMPLOYEE.EMP_STATUS,
EMPLOYEE.FIRST_NAME,
EMPLOYEE.LAST_NAME,
EMPLOYEE.MIDDLE_INIT,
EMPLOYEE.POSITION,
PAPOSITION.DESCRIPTION,
CHANGELIST.PS_A_VALUE,
/--Added by KAM--/
CHANGELIST.COMPANY,
CHANGELIST.PS_HR_DATE_STAMP,
CHANGELIST.PS_HR_BEG_DATE,
CHANGELIST.PS_HR_OBJ_ID,
CHANGELIST.NS_A_VALUE,
CHANGELIST.NS_DATE_STAMP,
CHANGELIST.NS_OBJ_ID,
CHANGELIST.ACTION_CODE,
CHANGELIST.REASON_01,
CHANGELIST.REASON_02,
CHANGELIST.DATE_STAMP PERSACTSDATESTAMP,
CHANGELIST.EFFECT_DATE PERSACTEFFDATE,
DEPTCODE.R_NAME DEPTNAME,
PRSYSTEM.R_NAME PLNAME,
PREVFTE.PREV_FTE,
CURRFTE.CURR_FTE,
CHANGELIST.NS_BEG_DATE,
PGSELECT.GROUP_NAME,
PAEMPLOYEE.SENIOR_DATE
FROM
LAWSON.CHANGELIST
INNER JOIN LAWSON.EMPLOYEE
ON (EMPLOYEE.EMPLOYEE = CHANGELIST.EMPLOYEE)
/--Added by KAM--/
AND (EMPLOYEE.COMPANY = CHANGELIST.COMPANY)
INNER JOIN LAWSON.DEPTCODE
ON ((EMPLOYEE.COMPANY=DEPTCODE.COMPANY)
AND (EMPLOYEE.PROCESS_LEVEL=DEPTCODE.PROCESS_LEVEL)
AND (EMPLOYEE.DEPARTMENT=DEPTCODE.DEPARTMENT))
INNER JOIN LAWSON.PRSYSTEM
ON ((EMPLOYEE.COMPANY=PRSYSTEM.COMPANY)
AND(EMPLOYEE.PROCESS_LEVEL=PRSYSTEM.PROCESS_LEVEL))
LEFT OUTER JOIN LAWSON.PREVFTE
ON (CHANGELIST.EMPLOYEE=PREVFTE.EMPLOYEE)
/--Added by KAM--/
AND (CHANGELIST.COMPANY=PREVFTE.COMPANY)
LEFT OUTER JOIN LAWSON.CURRFTE
ON (CHANGELIST.EMPLOYEE=CURRFTE.EMPLOYEE)
/--Added by KAM--/
AND (CHANGELIST.COMPANY=CURRFTE.COMPANY)
INNER JOIN LAWSON.PGSELECT PGSELECT
ON ((EMPLOYEE.COMPANY=PGSELECT.COMPANY)
AND (EMPLOYEE.EMP_STATUS=PGSELECT.BEGIN_VALUE))
LEFT OUTER JOIN LAWSON.PAPOSITION
ON (EMPLOYEE.POSITION=PAPOSITION.POSITION)
AND (EMPLOYEE.COMPANY=PAPOSITION.COMPANY)
INNER JOIN LAWSON.PAEMPLOYEE
ON (CHANGELIST.EMPLOYEE=PAEMPLOYEE.EMPLOYEE)
/--Added by KAM--/
AND (CHANGELIST.COMPANY=PAEMPLOYEE.COMPANY)
WHERE
(PGSELECT.GROUP_NAME='G:ACTIVE' OR PGSELECT.GROUP_NAME='G:INACTIVE')
>Hi Arsh,
The error message you receive i.e.
ORA-01830: date format picture ends before converting entire input string
is an Oracle error.
The following document would be helpful:
ORA-01830: date format picture ends before converting entire input string
Cause: A valid date format picture included extra data. The first part of the format picture was converted into a valid date, but the remaining data was not required.
Action: Check the specifications for date format pictures and correct the statement.
Regards,
Alpana -
Converting given data to date format
Hi
I have one date field in forms and i want to convert the string into a valid date format whenever i pressed the tab.When i enter 1jan07 it should convert into 01-JAN-2007 when i press the tab.I tried the following code but its not working.I changed the format mask but no use
select to_char(to_date(:DATA.BDATE,'DDMMYY'),'DD-MON-YYYY') into :DATA.BDATE from dual
rgds
shreyHi Shrey,
I have checked in one of my form with the format mask DD-MON-RRRR and its working fine.
confirm whether the field is a Date field or a char???
Regards -
Not a valid date - error in Web dynpro hosting the form
Dear Experts,
I have an interactive form embedded in an ABAP WebDynpro screen. It has a date field which is filled by the user.
This field has been working perfectly fine except for one user. Whenever he tries to enter a date and validate (round trip to backend) he gets a 'DD.MM.YYYY is not a valid date format' error (i.e. '15.02.2011 is not a valid date format').
Since this is a user specific error, I am unable to debug. When I tried debugging with his login, this error could be intercepted as this is an error thrown by the framework itself because of incompatible types(I think).
I am using all 3 patterns (validation, edit and display)as DD.MM.YYYY. it is working fine for everyone else, including me!!!!!!
It is not a system/version issue as we both tried on a neutral system and it worked for me but not for him.
Does anybody have an idea as to how this is possible? Any solution for this issue?
I am baffled, to say the least.
Regards, Amith
Edited by: Amith Menezes on Feb 15, 2011 3:47 PMHello there,
I just found a solution to this problem.
The crux of this issue was that the 'Binding Pattern' of the date field in the form did not match the Date format of the user's 'Own Data'. For now, I requested the user to change to the frmat maintained in the form and it all worked well..
But this leads me to a new question.
How can we make sure that the binding pattern always matches any user's own data!
Is there a way this can be achieved??
Regards,
Amith
Edited by: Amith Menezes on Feb 16, 2011 1:35 PM -
Date Format - Calculate Overdue Days
Hi Friends,
We have downloaded the Customer Statement in excel and want to verify the overdue days by comparing the 'Document Date' and the 'Net Due Date' as per the payment terms. However, after we download the Customer Statement and put the formula for deducting the Document Date from the Net Due Date, the formula gives an error "#Value!", We are trying to change the date format which is in dots, but are unable to do so.
Can anyone help as to how can we do this?
Thanks for the help.
RegardsHello,
I do not know why are you doing this exercise in EXCEL, when SAP has provided ready-made solution for this?
Execute FBL5N - Open items
Change Layout (Ctrl+F8)
Select "Arrears after net due date".
Just for your information: Overdue date are the difference between the "Current Date" and "Net Due Date", but NOT "Document Date" and "Net Due Date".
Out of SAP Scope:
If you want to find out the number of days between two dates then
A1 = 31/10/2008
A2 = 29/12/2008
A3 = Formulae = DAYS360(A1,A2)
Please make sure that the values in cells A1 and A2 are in DD/MM/YYYY (valid date format)
Hope this will help you.
Thanks,
Ravi -
Need regular expression for oracle date format 'DD-MON-YYYY'
Hi,
Can anybody tell me the regular expression to validate date in 'DD-MON-YYYY'.
My concept is i have a table with just two columns item_name and item_date
Both fields are varchar2 and i want to fetch those records from this table which have valid date format('DD-MON-YYYY').If it must be a regexp, this is a starter for you, note it carries the caveats mentioned by both posters above and in the linked thread
mkr02@ORA11GMK> with data as (select '10-jan-2012' dt from dual
2 union all select '10-111-2012' from dual
3 union all select 'mm-jan-2012' from dual
4 union all select '10-jan-12' from dual)
5 select
6 dt,
7 case when regexp_like(dt,'[[:digit:]]{2}-[[:alpha:]]{3}-[[:digit:]]{4}','i') then 1 else 0 end chk
8 from data
9 /
DT CHK
10-jan-2012 1
10-111-2012 0
mm-jan-2012 0
10-jan-12 0It will not validate content, only string format.
And to emphasis the points made in the linked thread - dates in text columns is poor design. Always. -
Pleace have mercy! String to valid Date?
Anyone please have mercy and help me with this topic:
How can i check wether a string is of a valid date format:
YYYYMMDD? I have been trying for hours but am unable to find the right function.... :-(
THank thee a thousand times and may the source be with you!sorry will not do it again! i was just so desperate that i posted twice....
and thank thee for thy help! -
Unit Test Variable Substitution in PL/SQL User Vailidation code not running
Hi
I am using new Unit Test Feature in SQL Developer 2.1.0.62.
I have created a test implemented to test a function. The function has a VARCHAR2 parameter as input and returns a BINARY_INTEGER.
I would like to perform 'Process Validation instead of specifying an explicit 'Result'. The check box 'Test Result' is unchecked.
I have seen in the doc. that I can use substitution variables in my user defined PL/SQL code. I try
IF {RETURNS$} < 0
THEN ...
but I always get the error
ERROR
<RETURN> : Expected: [Any value because apply check was cleared], Received: [-103]
Validation User PL/Sql Code failed: Non supported SQL92 token at position: 181: RETURNS$
Obviously, the program doesn't recognize {RETURN$}.
Am I missing something?
br
ReinerHi all,
I have installed the latest version of SQL Developer (2.1.1) that fixed the problem - must have been a bug.
The only problem was that I got an ORA-904 TEST_USER_NAME... error. I export my tests, dropped the repository, created a new one and reimported everything. Now it works as it should.
br
Reiner
Maybe you are looking for
-
How can I get my iMovie 4 working with a USB Camcorder
Hello everybody, I bought a Sony DCR SX33E which does not have a FireWire connection. IMovie does not recognize the camcorder and it is not possible to transfer the recorded material to iMovie 4. What can I do to get the camcorder working with my iMo
-
Problems with collation when searching
Hi, We have set up our database with the collation Danish_Norwegian_CI_AS, but we are having trouble when searching for data containing 'AA'. In order to get the rows out, we need to change the collation to eg. SQL_Latin1_General_CP1_CI_AS I have set
-
If your battery is dead will the computer not power on?
I have a MacBook Pro and I know my battery has been slowly dieing for a few months now. I recently had a new hard drive installed and the tech said it's done. This is the second one I've replaced. But my question is, why won't the laptop work without
-
Airport Network Suddenly Not Appearing
I have 3 Macs and the airport network has suddenly stopped appearing for the eMac. I've turned airport on and off and I've restarted. My radio strenght is showing grayed out. It is not a distance issue either because nothing has moved and the eMac wo
-
Fatal Error when I opened Captivate
Every time when I opened Captivate I received a Fatal Error and the application is closed, can you help to resolv the problem?