473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem inserting data into field

hI GUYS...

seems that I cant insert data into table.

I got this error:

DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: REASON;ECT = ?, STATUS = ?;,


here's the codes.

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. //suzie added
  3. $(document).ready(function(){
  4.     $("#dialog").dialog({
  5.         "modal": true,
  6.         "autoOpen": false,
  7.         "buttons": {
  8.         "Hantar":function(){
  9.     var f = document.getElementById('xcForm');
  10.     f.action="xc18TolakAction.do";
  11.     f.submit();
  12.         },
  13.     "Cancel": function() {
  14.         $(this).dialog('close');
  15.                 }
  16.             }
  17.         });
  18. });
  19.  
  20. function performRemsTolak(ele)
  21. {
  22.     $("#dialog").dialog('open');
  23.  
  24. }
  25.  
  26. <html:button styleClass="button" property="sbmit1" onclick="javascript:performRemsTolak(this)"><bean:message key="grq_XC18_TOLAK"/></html:button>
  27. <div id="dialog" title="Reason "> : <input type="text"
  28. name="xcForm" id="reason"                class="text ui-widget-content ui-corner-all" size="7" />
  29.  
  30. //in DAO.java
  31.  
  32. String status = xcbo.getStatus();
  33. String reason = xcbo.getReason();
  34.  
  35.  
  36. if ( status.equals(DCMSConstants.USERTODO_STATUS_SEDIA)
  37.                 || status.equals(DCMSConstants.USERTODO_STATUS_PREPARE))
  38.         {
  39.     update_field = new StringBuffer()
  40.     .append(" OFFICER_PREPARE = ?, ")
  41.     .append(" DATE_PREPARE = ?, ")
  42.     .append(" STATUS = ? ")
  43.     .append(" REASON = ?")
  44.         .toString();
  45. else if( status.equals(DCMSConstants.USERTODO_STATUS_TOLAK))
  46.         {
  47.  
  48.     update_field = new StringBuffer()
  49.         .append(" OFFICER_REJECT = ?, ")
  50.         .append(" DATE_REJECT = ?, ")
  51.         .append(" STATUS = ? ")
  52.         .append(" REASON = ? ")
  53.         .toString();
  54.         }
  55.  
  56. PreparedStatement stmt = null;
  57.         StringBuffer sql = new StringBuffer();
  58.         sql.append(" UPDATE " + tableName + " SET ");
  59.         sql.append(update_field);
  60.         sql.append(" WHERE ");
  61.         sql.append(" TAXPAYER_KEY = ?");
  62.         sql.append(" AND FILE_NO = ?");
  63.         sql.append(" AND TAXTYPE_KEY = ?");
  64.  
  65.  
  66. stmt = conn.prepareStatement(sql.toString());
  67.         stmt.setString(1, session.getUserBo().getUser_id());
  68.         stmt.setTimestamp(2, now());
  69.         stmt.setString(3, status);
  70.         stmt.setInt(4,taxpayer_key);
  71.         stmt.setString(5, file_no);
  72.         stmt.setInt(6, taxtype_key);
  73.         stmt.setString(7, reason);
  74.         stmt.executeUpdate();
  75.  

Thank u very much.
Jun 10 '10 #1
4 1259
gits
5,390 Expert Mod 4TB
this doesn't seem to be a JavaScript issue ... the SQL-query fails so does the serverside script get the correct values during the submit?

kind regards
Jun 10 '10 #2
@gits
Thanks Gits....that means I should change the query, right?
Jun 10 '10 #3
gits
5,390 Expert Mod 4TB
have a look here ... it seems that there is a syntax error in your query?
Jun 12 '10 #4
thanks again Gits..will try to figure out when I get back to office...
Jun 13 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
25
by: bseakgano | last post by:
I have developed a intranet . Using HTML , SQL and ASP . I have created a table with SQL is just fine . And design a form is just looks fine to me . But when I try to insert Data into the SQL I just...
4
priyan
by: priyan | last post by:
hai everyone, I am having a doubt in inserting data in time field. I am having a table in which in column in timestamp without time zone datatype. I want to insert a row into the table but...
6
by: arial | last post by:
Hi all I am getting this error message while try to insert data using my .net webform. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '1'. Source Error: ...
4
vikas1111
by: vikas1111 | last post by:
Hi All.. While putting data into database from form if i refresh the php form a blank data will be added into database ... How can i remove that bug??? Here is my code.... <?php...
18
by: boss1 | last post by:
Hi all, i m having a problem with inserting data in oracle db. When i use form action =(call self page) then data is inserting properly.But problem with when using form...
0
by: Edwin.Madari | last post by:
-----Original Message----- statement prepared first and executed many times with exectemany - db API http://www.python.org/dev/peps/pep-0249/ inline statemets can be exeucuted only. hope that...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.