DD/MM/YYYY format
Hi i'm getting the following error for my procedure. Here both EFFECTIVE_DATE_DT and PERIOD_TO are in the
format of DD/MM/YYYY. Please help me.
ORA-00904: "JUL": invalid identifier
ORA-06512: at "RTMAST.SPR_CONT_TEST", line 33
ORA-06512: at line 11
CREATE OR REPLACE PROCEDURE SPR_CONT_TEST(P_PAY_PERIOD IN VARCHAR2,P_COMP_CODE IN VARCHAR2, P_UNIT_CODE IN VARCHAR2) IS
TYPE REF_CUR IS REF CURSOR;
R_CONTDET REF_CUR;
STMT_STR VARCHAR2(100);
P_SCHEMANAME VARCHAR2(20);
STMT_PFTYPE VARCHAR2(100);
STMT_EMP VARCHAR2(1000);
PERIOD_TO VARCHAR2(15);
EMPID_CONT VARCHAR2(100);
BEGIN
SELECT SCHEMA_NAME_C INTO P_SCHEMANAME FROM ILPS.GLTB_COM_MASTER,MAST_COMPANY_M
WHERE MAST_COMP_CODE=P_COMP_CODE
AND MAST_COMPANY_M.MAST_COMP_COMPANY_CODE=GLTB_COM_MASTER.COMPANY_CODE_N;
STMT_STR:= 'SELECT DISTINCT PERIOD_TO_DT FROM '||P_SCHEMANAME||'.PRTB_PAY_PERIODS WHERE PAY_PERIOD_CODE_C='||P_PAY_PERIOD;
EXECUTE IMMEDIATE STMT_STR INTO PERIOD_TO;
STMT_EMP := ' SELECT DISTINCT EMP_ID_C FROM '||P_SCHEMANAME||'.HRTB_EMP_JOBDETAILS A WHERE CURRENT_PERIOD_C ='||
P_PAY_PERIOD || ' AND EFFECTIVE_DATE_DT <= '|| PERIOD_TO ||
' AND LATEST_FLAG_N IN (SELECT MAX(LATEST_FLAG_N) FROM '||
P_SCHEMANAME||'.HRTB_EMP_JOBDETAILS B WHERE A.EMP_ID_C=B.EMP_ID_C)';
OPEN R_CONTDET FOR STMT_EMP;
LOOP
FETCH R_CONTDET INTO EMPID_CONT;
EXIT WHEN R_CONTDET%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(EMPID_CONT);
END LOOP;
END;
//////////////////////////////////////*************************************//////////////////////////////////
Hi,
DECLARE
v_str VARCHAR2(200);
v_date DATE;
BEGIN
v_str :='SELECT sysdate FROM dual WHERE TRUNC(sysdate) = ';
v_str := v_str || 'TO_DATE('||'''' ||'30-AUG-06'||''''||','||''''||'DD-MON-YY'||''''||')';
EXECUTE IMMEDIATE v_str INTO v_date;
dbms_output.put_line(v_date);
EXCEPTION
WHEN others THEN
dbms_output.put_line(SQLERRM);
END;
SQL>@abc.sql
30-AUG-06
PL/SQL procedure successfully completed.
SQL>
So replace EFFECTIVE_DATE_DT with
'TO_DATE( EFFECTIVE_DATE_DT ,' ||''''||'DD/MM/YYYY'||''''||')'Regards
Similar Messages
-
How to use MM/YYYY Format in the selection Screen?
There is this program RMCB0300 where the date format in the selection screen has MM/YYYY Format.
I am working on a report which requires it "Period" Field in the selection screen to be in the same format.
However, i am trying to give the select option as " SL_SPMON FOR S031-SPMON MODIF ID PER." and declaring S031 table in the declaration part.
But still, its not been able to provide me F4 help in the inpur screen.
Can someone please provide me some guidance in this regard?Hi,
the following works for me..
*& Report ZPMONAT *
report zpmonat .
tables: s031.
selection-screen begin of block abc.
select-options: sl_spmon for s031-spmon.
selection-screen end of block abc.
at selection-screen on value-request for sl_spmon-low.
perform monat_f4.
at selection-screen on value-request for sl_spmon-high.
perform monat_f4.
start-of-selection.
end-of-selection.
*& Form monat_f4
* text
* --> p1 text
* <-- p2 text
form monat_f4 .
data: begin of mf_dynpfields occurs 1.
include structure dynpread.
data: end of mf_dynpfields.
data: mf_returncode like sy-subrc,
mf_monat like isellist-month,
mf_hlp_repid like sy-repid.
field-symbols: <mf_feld>.
* Wert von Dynpro lesen
get cursor field mf_dynpfields-fieldname.
append mf_dynpfields.
mf_hlp_repid = sy-repid.
do 2 times.
call function 'DYNP_VALUES_READ'
exporting
dyname = mf_hlp_repid
dynumb = sy-dynnr
tables
dynpfields = mf_dynpfields
exceptions
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
if sy-subrc = 3.
* Aktuelles Dynpro ist Wertemengenbild
mf_hlp_repid = 'SAPLALDB'.
else.
read table mf_dynpfields index 1.
* Unterstriche durch Blanks ersetzen
translate mf_dynpfields-fieldvalue using '_ '.
exit.
endif.
enddo.
if sy-subrc = 0.
* Konvertierung ins interne Format
call function 'CONVERSION_EXIT_PERI_INPUT'
exporting
input = mf_dynpfields-fieldvalue
importing
output = mf_monat
exceptions
error_message = 1.
if mf_monat is initial.
* Monat ist initial => Vorschlagswert aus akt. Datum ableiten
mf_monat = sy-datlo(6).
endif.
call function 'POPUP_TO_SELECT_MONTH'
exporting
actual_month = mf_monat
importing
selected_month = mf_monat
return_code = mf_returncode
exceptions
factory_calendar_not_found = 01
holiday_calendar_not_found = 02
month_not_found = 03.
if sy-subrc = 0 and mf_returncode = 0.
* ASSIGN (MF_DYNPFIELDS-FIELDNAME) TO <MF_FELD>. " ==>> note 148804
* <MF_FELD> = MF_MONAT.
call function 'CONVERSION_EXIT_PERI_OUTPUT'
exporting
input = mf_monat
importing
output = mf_dynpfields-fieldvalue.
collect mf_dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = mf_hlp_repid
dynumb = sy-dynnr
tables
dynpfields = mf_dynpfields
exceptions
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07. "<<== note 148804
endif.
endif.
endform. " monat_f4
Regards,
Suresh Datti -
Date validation in "DD-MON-YYYY" Format,
Hi ,
I have created a textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.Vaibss wrote:
Hi ,
I have created a textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.The call to 'to_date' is raising an exception when it tries to convert your date, standard PL/SQL exception handling takes over and the rest of your code is ignored.
You could try:
declare
pragma exception_init(invalid_date,-01830);
l_dummy date;
Begin
If :P4_END_DATE IS NOT NULL THEN
l_dummy := to_date(:P4_END_DATE ,'DD-MON-YYYY') then
END IF;
exception
when invalid_date then
return 'END DATE should be in "DD-MON-YYYY" Format';
End;
but even that will not check that the user actually used your desired format - the to_date can be quite flexible e.g. accepting separators other than the '-' that you have declared. In fact, the above would only catch the user entering a 'date' that is shorter than the format string - changing the 'invalid_date' for 'others' would capture more (all!) exceptions.
You probably want to look at using regular expressions to perform the format validation.
Edited by: Andy Hardy on Nov 25, 2008 12:29 PM -
How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
Hi
How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
This is my Input data.
11/25/2007.
By using below query, it is inserted into database.
sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
But using stored procedure, the same query is not running.
It shows error like
ORA-01843: not a valid month ORA-06512: at line 1
Procedure:
create or replace procedure Date_Test(datejoin in DATE) is
begin
insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
end Date_Test;
I had used 'nls_date_language = american' also.
Prcodeure is created but not worked in jsp. The same error is thrown.
Pls provide a solutionThis might help you....
SQL> Create Table DateTest(col1 Date);
Table created.
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in DATE) is
2 begin
3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test('11/25/2007');
BEGIN Date_Test('11/25/2007'); END;
ERROR at line 1:
ORA-01843: not a valid month
ORA-06512: at line 1
Elapsed: 00:00:00.00
SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
ERROR at line 1:
ORA-01843: not a valid month
ORA-06512: at "CTBATCH.DATE_TEST", line 3
ORA-06512: at line 1
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in DATE) is
2 begin
3 insert into datetest values(datejoin);
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> Select * from DateTest;
COL1
25-NOV-07
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
2 begin
3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test('11/25/2007');
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> select * from DateTest;
COL1
25-NOV-07
25-NOV-07
Elapsed: 00:00:00.00
SQL> -
How to get mm-dd-yyyy format in ssis
My destination is Oracle and i want the date to be in the below format while migrating data.
mm-dd-yyyy
SFHConsistent "MM/DD/YYYY"
format
(DT_DBTIMESTAMP)(SUBSTRING([date string], 7, 4) + "-" SUBSTRING([date string], 1, 2) + "-"
+ SUBSTRING([date string], 4, 2))
Refer the below link for more help on string conversions.
http://toddmcdermid.blogspot.ca/2008/11/converting-strings-to-dates-in-derived.html
Mudassar -
How to convert date into dd mon yyyy format
hi all,
i have a problem in date format i am using date like below .
<%java.util.Date date = new java.util.Date();%>
i am inserting date into a table and its storing like this
insert into tablename (d_date) values (date)
and its inserting date like below
Sun Oct 19 09:05:45 GMT+03:00 2003
i want to fetch date in dd mon yyyy format.
with this format i want to make a select query.i struck with the format conversion.
how to do this.
any comments please.
any helphi all,
i understand now where i am wrong.
the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
i executed the same code in a different server where date and time jones are english its working fine.
All the problem is in regional setting and not the jsp code.
<%
String whtEverDateFormatYouWAnt = "dd MMM yy";
String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
out.print(str);
%>
Thanks a lot for the excellent solution.
Thanks again. -
How to convert date from "yyyymmdd" to "MM/DD/YYYY" format
1. I have one BLDAT field in my internal table.
its getting updated from input file.
2. The value in the input file is like yyyymmdd.
So the internal table field is filled like this
"YYYYMMDD".
3. After this,I have to compare this internal table
field with BSAD table.
4. The BLDAT field in BSAD table is in the format of
"MM/DD/YYYY".
5. the BLDAT field is having diff format in internal table and BSAD table.So I am unable to check this value.
How to convert it as like the BSAD table format."MM/DD/YYYY" format.
Thanks in advance!!Using the WRITE statement
data: gd_date(10). "field to store output date
* Converts date from 20020901 to 09.01.2002
write sy-datum to gd_date mm/dd/yyyy.
OR u can
CONCATENATE gd_date+4(2) gd_date+6(2) gd_date+0(4)
into gd_date seperated by '/' .
Hope this helps.
Kindly reward points and close the thread for the
answer which helped u OR get back with queries. -
How to get date in dd/mm/yyyy format ?
Hello,
for this query :
>select to_date(to_char(sysdate),'dd/mm/yyyy') from dual;
i wanted to get date in dd/mm/yyyy format , but this query is not returning in correct date format .
How to get that ?select id,
to_date(to_char(dt1,'mm/dd/yyyy'),'dd/mm/yyyy') dt1,
to_date(to_char(dt2,'mm/dd/yyyy'),'dd/mm/yyyy') dt2
from t_table1 where no=23;This is my actual query.
But this query is giving error.
ORA-01843: not a valid monthWhen i issued this query :
select id,dt1,dt2 from t_table1 where no=23 ;
this is the output :
ID DT1 DT2
001 10/7/2011 10/19/2011Edited by: bootstrap on Oct 8, 2011 2:13 PM
Edited by: bootstrap on Oct 8, 2011 2:13 PM -
Valiadtion of date in dd.mm.yyyy format
i have a selection screen in which i want user to enter date in dd.mm.yyyy format only.how can i validate that.any FM.
i also want that date to be changed in yyyymmdd format coz i have to update that in a field which has yyyymmdd format.
so is there any fm for this also ( to change dd.mm.yyyy to yyyymmdd).
any pointers will help.Hi Govind,
Based on the user defaults in the transaction SU01 the date will be verified based on the date format selected in the user details.
Declare the selection screen variable as of type Sy-DATUM.
what ever format you had entered the date in the selection screen the variable will hold the value in the format yyyymmdd.
no need to do any format for the date.
hope this might help you.
regards,
Phani. -
Displaying date in dd/MM/yyyy format
Hi all,
I am having one date field .To display the date in correct format, I created a dictionary simple type of type date and entered dd/MM/yyyy in representation tab.
I was using 2004 and it was working properly. Now I am using 2004s for the same application. The problem is when I am selecting a date , it is showing the date in MM/dd/yyyy format in first time. If I selects the date again, then it will be in dd/MM/yyyy format. How can I make the selection in dd/MM/yyyy in first time itself
Thanks
Fahad HamsaHi,
Try this:
1. Create a simple type in the local dictionary. Call it say, CustomDateType.
2. Set the built-in type as date.
3. Go to the representation tab and under "External Representation" set the format to "dd/MM/yyyy".
4. Create a context value attribute day, CustomDate and set its type to CustomDateType.
5. Create an inputfield with id say, "DateField" and bind its value property to CustomDate.
6. Now in your wdDoModifyView() write the following code:
if(firstTime){
IWDViewElement e = view.getElement("DateField");
e.requestFocus();
Regards,
Satyajit. -
Prompt in dd/mm/yyyy format
Hi,
I need to accept data from user in dd/mm/yyyy format, but as of now the default format what the prompt is taking is mm/dd/yyyy.
Considering the prompt as 'Date from'. Kindly help me out with the code for dd/mm/yyyy.
As of now the query is MRK.Data.From_Date=@Prompt('Date from','D',,,).
Thanks.
JimHi,
The date format of the prompt is controlled by a prm file on your Busienss Objects server
Open your universe, parameters and test connection
Open details - locate PRM file being used
Go to Business Objects Server
Open PRM file using notepad
Locate line below and edit date to required format
<Parameter Name="USER_INPUT_DATE_FORMAT">{\d 'yyyy-mm-dd HH:mm:ss'}</Parameter>
Re-start connection server
Test your date prompt....
These links may be help you:
Webi 3.1 Multi value prompts & UserResponces.
http://forumtopics.com/busobj/viewtopic.php?p=628947&sid=a6dffd86c651cd070aac2649459b25a4
Edited by: Swarna K on Mar 22, 2011 7:46 AM -
Date display in dd-mmm-yyyy format on opening a .jsp file as .xls
Hi,
I am pretty new to Java and JSP, I have a problem,
There's an application in which the contents of a .jsp are to be displayed in excel format.
All the data are displayed in correct format except the dates.
The dates that are in the dd-MMM-yyyy format in the .jsp's are displayed as dd-mmm-yy in the .xls file.
How to solve this?
Thanks in Advance!Maybe you need to configure that "application"? Or if you actually have access to the source code, then just take a look in it.
Without any more details about the "application" we can't help you any much further.
Generally, when you want to convert a Date or Calendar object to a human readable String, the SimpleDateFormat [1] is been used.
[1] http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html -
Insertion of date in dd-mmm-yyyy format
I have a jsp page, from that i can enter values in oracle database.
my jsp page is working, but the problem is that it can only accept the date
dd-mmm-yyyy format. i.e 20-jun-2004, but when i enter date in dd/mm/yyyy format i.e 20/06/2004, it does not accept.
i want to enter to do enter date in dd/mm/yyyy format in the form, and it can save the date field in database in dd-mmm-yyyy format.
my code is as bellow:
<html>
<body>
<table>
<tr>
<td>
<%@ page import =" java.sql.Date.*" %>
<%@ page import =" java.text.SimpleDateFormat.*" %>
<%@ page import =" java.util.Date.*" %>
<%@ page import =" java.text.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page language="java" import="java.sql.*" %>
<%
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
System.out.println("got connection");
%>
<%
char pay_post,pay_type;
String action = request.getParameter("action");
if (action != null && action.equals("save")) {
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement(
("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
pstmt.setString(1,request.getParameter("vou_no"));
pstmt.setString(2,request.getParameter("pay_date"));
pstmt.setString(3,request.getParameter("pay_post"));
pstmt.setString(4,request.getParameter("pay_narr"));
pstmt.setString(5, request.getParameter("chq_no"));
pstmt.setString(6,request.getParameter("chq_date"));
pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
pstmt.setString(8,request.getParameter("pay_type"));
pstmt.executeUpdate();
conn.commit();
conn.setAutoCommit(true);
%>
<%
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery
("SELECT * FROM pay_header ");
%>
<tr>
<form action="payment_save1.jsp" method="get">
<input type="hidden" value="save" name="action">
<th><input value="" name="vou_no" size="10"></th>
<th><input value="" name="pay_date" size="10"></th>
<th><input value="" name="pay_post" size="15"></th>
<th><input value="" name="pay_narr" size="15"></th>
<th><input value="" name="chq_no" size="15"></th>
<th><input value="" name="chq_date" size="15"></th>
<th><input value="" name="chq_amt" size="15"></th>]
<th><input value="" name="pay_type" size="15"></th>
<th><input type="submit" value="save"></th>
</form>
</tr>
<%
while ( rs.next() ) {
%>
<tr>
<form action="payment_save1.jsp" method="get">
<input type="hidden" value="save" name="action">
<td><input value="<%= rs.getString("vou_no") %>" name="vou_no"></td>
<td><input value="<%= rs.getDate("pay_date") %>" name="gl_descr"></td>
<td><input value="<%= rs.getString("pay_post") %>" name="pay_post"></td>
<td><input value="<%= rs.getString("pay_narr") %>" name="pay_narr"></td>
<td><input value="<%= rs.getString("chq_no") %>" name="chq_no"></td>
<td><input value="<%= rs.getDate("chq_date") %>" name="chq_date"></td>
<td><input value="<%= rs.getFloat("chq_amt") %>" name="chq_amt"></td>
<td><input value="<%= rs.getString("pay_type") %>" name="pay_type"></td>
<td><input type="submit" value="save"></td>
</form>
</tr>
<%
%>
</table>
<%
// Close the ResultSet
rs.close();
// Close the Statement
statement.close();
// Close the Connection
conn.close();
} catch (SQLException sqle) {
out.println(sqle.getMessage());
} catch (Exception e) {
out.println(e.getMessage());
%>
</td>
</tr>
</body>
</html>thanx for u r help..
now i have used simple date format method and also apllied setDate() method.
bit its coming error NULL
code:
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
java.util.Date pay_date_temp = null;
java.util.Date pay_post_temp = null;
PreparedStatement pstmt = conn.prepareStatement(
("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
java.sql.Date pay_date = new java.sql.Date(pay_date_temp.getTime());
java.sql.Date chq_date = new java.sql.Date(pay_post_temp.getTime());
pstmt.setString(1,request.getParameter("vou_no"));
pstmt.setDate(2,pay_date);
pstmt.setString(3,request.getParameter("pay_post"));
pstmt.setString(4,request.getParameter("pay_narr"));
pstmt.setString(5, request.getParameter("chq_no"));
pstmt.setDate(6,chq_date);
pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
pstmt.setString(8,request.getParameter("pay_type"));
help me -
Insert date in dd-mmm-yyyy format
I have a jsp page, from that i can enter values in oracle database.
my jsp page is working, but the problem is that it can only accept the date
dd-mmm-yyyy format. i.e 20-jun-2004, but when i enter date in dd/mm/yyyy format i.e 20/06/2004, it does not accept.
i want to enter to do enter date in dd/mm/yyyy format in the form, and it can save the date field in database in dd-mmm-yyyy format.
my code is as bellow:
<html>
<body>
<table>
<tr>
<td>
<%@ page import =" java.sql.Date.*" %>
<%@ page import =" java.text.SimpleDateFormat.*" %>
<%@ page import =" java.util.Date.*" %>
<%@ page import =" java.text.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page language="java" import="java.sql.*" %>
<%
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
System.out.println("got connection");
%>
<%
char pay_post,pay_type;
String action = request.getParameter("action");
if (action != null && action.equals("save")) {
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement(
("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
pstmt.setString(1,request.getParameter("vou_no"));
pstmt.setString(2,request.getParameter("pay_date"));
pstmt.setString(3,request.getParameter("pay_post"));
pstmt.setString(4,request.getParameter("pay_narr"));
pstmt.setString(5, request.getParameter("chq_no"));
pstmt.setString(6,request.getParameter("chq_date"));
pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
pstmt.setString(8,request.getParameter("pay_type"));
pstmt.executeUpdate();
conn.commit();
conn.setAutoCommit(true);
%>
<%
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery
("SELECT * FROM pay_header ");
%>
<tr>
<form action="payment_save1.jsp" method="get">
<input type="hidden" value="save" name="action">
<th><input value="" name="vou_no" size="10"></th>
<th><input value="" name="pay_date" size="10"></th>
<th><input value="" name="pay_post" size="15"></th>
<th><input value="" name="pay_narr" size="15"></th>
<th><input value="" name="chq_no" size="15"></th>
<th><input value="" name="chq_date" size="15"></th>
<th><input value="" name="chq_amt" size="15"></th>]
<th><input value="" name="pay_type" size="15"></th>
<th><input type="submit" value="save"></th>
</form>
</tr>
<%
while ( rs.next() ) {
%>
<tr>
<form action="payment_save1.jsp" method="get">
<input type="hidden" value="save" name="action">
<td><input value="<%= rs.getString("vou_no") %>" name="vou_no"></td>
<td><input value="<%= rs.getDate("pay_date") %>" name="gl_descr"></td>
<td><input value="<%= rs.getString("pay_post") %>" name="pay_post"></td>
<td><input value="<%= rs.getString("pay_narr") %>" name="pay_narr"></td>
<td><input value="<%= rs.getString("chq_no") %>" name="chq_no"></td>
<td><input value="<%= rs.getDate("chq_date") %>" name="chq_date"></td>
<td><input value="<%= rs.getFloat("chq_amt") %>" name="chq_amt"></td>
<td><input value="<%= rs.getString("pay_type") %>" name="pay_type"></td>
<td><input type="submit" value="save"></td>
</form>
</tr>
<%
%>
</table>
<%
// Close the ResultSet
rs.close();
// Close the Statement
statement.close();
// Close the Connection
conn.close();
} catch (SQLException sqle) {
out.println(sqle.getMessage());
} catch (Exception e) {
out.println(e.getMessage());
%>
</td>
</tr>
</body>
</html>thanx for u r help..
now i have used simple date format method and also apllied setDate() method.
bit its coming error NULL
code:
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
java.util.Date pay_date_temp = null;
java.util.Date pay_post_temp = null;
PreparedStatement pstmt = conn.prepareStatement(
("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
java.sql.Date pay_date = new java.sql.Date(pay_date_temp.getTime());
java.sql.Date chq_date = new java.sql.Date(pay_post_temp.getTime());
pstmt.setString(1,request.getParameter("vou_no"));
pstmt.setDate(2,pay_date);
pstmt.setString(3,request.getParameter("pay_post"));
pstmt.setString(4,request.getParameter("pay_narr"));
pstmt.setString(5, request.getParameter("chq_no"));
pstmt.setDate(6,chq_date);
pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
pstmt.setString(8,request.getParameter("pay_type"));
help me -
Show date in dd/mm/yyyy format using ODataModel in a table.
Hi,
I am populating a table using ODataMoel in which one of the columns is 'DatePicker' control and I want to map a date being passed in one of the fields of data from server to this DatePicker control. It's getting mapped but I want to show the date in DatePicker in 'dd/mm/yyyy' format.
I happened to go through links but they were talking about JSonModel.
How would that be implemented using ODataModel. Please find my sample code below.
var oTable = new sap.ui.table.Table("dprTable",{
visibleRowCount: 4,
//firstVisibleRow: 3,
visible: true,
navigationMode: sap.ui.table.NavigationMode.Paginator
//selectionMode: sap.ui.table.SelectionMode.Single
var oColumn = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "DBR/DPR"}),
template: new sap.m.Link({
"target": "_blank",
press:[controller.onClickDemoNo,controller]
}).bindProperty("text","DemoId")
width: "auto"
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Required Date"}),
template: new sap.ui.commons.DatePicker("",{
value:{
path:"/ReqDate",
type: new sap.ui.model.type.Date({pattern: "yy-MM-dd"})
change: function(){
console.log('the date is changed and it\'s value is'+value);
width: "auto"
oTable.addColumn(oColumn);
var oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZSECENTRAL_SRV",true);
oTable.setModel(oModel);
oTable.bindRows("/DEOPENDBRSet");
This(red colored code) is not showing the date in the DatePciker in the form of 'dd/mm/yyyy', in fact it's not populating the date too. Any help would be appricitated.
Thanks,
Supriya KaleHi Supriya,
Just give the source pattern of the date and remove the / in the path mentioned.
Please make sure that the source pattern is correct.
template = new sap.ui.commons.DatePicker({
value:{
path:"ReqDate",
type: new sap.ui.model.type.Date({source: {pattern: "yyyyMMdd"},pattern: "yy-MM-dd"})
Hope it works.
Regards,
Jeffin George -
To convert dec date 732,677 in to dd.mm.yyyy format
Hi,
i have to convert dec date 732,677 in to dd.mm.yyyy format .
plz help me out
its urgent
regards,
Nishu Guptause this Fm
CONVERSION_EXIT_INVDT_INPUT
<b>CONVERSION_EXIT_INVDT_output.</b>
i hope u r referring to Tcurr-gdatu.
refer this code for the working ..
data : date like sy-datum,
date1(10) type c,
val like sy-datum,
datum(8) type n .
date = sy-datum.
write:/ date.
concatenate date4(2) date6(2) date+0(4) into val.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = val
IMPORTING
OUTPUT = datum.
write:/'tcurrformat' datum.
*clear val.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
EXPORTING
input = datum "----
>pass this
IMPORTING
OUTPUT = date1.
write:/'normal format', date1.
Please close your previous threads.
regards,
vijay
Maybe you are looking for
-
Receiving an event with no To: email address
I'm trying to access an email that is sent to a blinded mailing list... in particular the email contains an .ics event file. When I click on the hyperlink to open the event in iCal, iCal eventually gives me an error. The error states that since the T
-
How can I permanently delete subfolders in email Trash?
I have been getting duplicate email messages in one of my email folders for several weeks. I think it started when I upgraded to OS X 10.6.6. I have RoadRunner as a mail server and have not had this problem before on either my iMac or a previous PC
-
HP LaserJet CM1415fnw stop printing
My CM 1415fnw stopped printing today from every computer in the house. I have had this printer for about a year without any other problems. The wirless network test report states "pass" but the HP Toolbox FX states printer not connected to the networ
-
Displaying JobTicket colorant data in Output Preview dialog.
Hi, my task is to create plug-in which extends functionality of Output Preview dialog. It should display actual state of all Separations and Inks specified in PDF JobTicket. I supposed to use AVPageViewSetVisibleInks/AVPageViewGetVisibleInk but they
-
PKI migration from 2003 to greenfield 2008 R2 plan-of-approach
Hi, I've done a lot of reading here already but I'm on a dead end. Here's my scenario: I have 1 Stand-alone root CA plus 2 Enterprise issuing CA's, all running Windows Server 2003. I'm trying to move all servers to a new OS platform: Server 2008 R2.