craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > JDBC/Database Issues Post New Topic   Post A Reply
Updating Primary Key Fields printer friendly version
next newest post | next oldest post
Author Messages
Ron Troyer
Private First Class

Gender: Unspecified
Location:
Registered: Oct 2004
Status: Offline
Posts: 12

Click here to see the profile for Ron Troyer Send email to Ron Troyer Find more posts by Ron Troyer Edit or delete this message Reply w/Quote
Posted Friday, December 3, 2004 @ 11:58:40  

I am trying to use quicktable in a master/detail screen. I have the first column not visible, since it contains the master value (in this case ReportName). There are 2 other fields which make up the primary key (in this case TableName and ColumnName). It is my understanding from reading the documentation, that it is possible to change the values in the primary key fields. I have included the int array with the primary key fields in the addUpdateSQL statement. The symtom I am seeing is that I can change the values on the screen, but they never get written to the database. I have done many things to get this to work, and so far I have been unable to make it work. Is there some property I have to set, to allow the primary keys to be changed?

I have included my Select and Update statements here.

Code:


// setup the select statement for the fields table
private void setupFieldTableSelect( String rptName ) {
FieldTable.setSelectSql("SELECT ReportName, " +
"TableName, " +
"ColumnName, " +
"ColumnHeader, " +
"PrintOrder, " +
"PrintWidth, " +
"SortOrder, " +
"PrintWrap, " +
"SelectionItem, " +
"GroupItem, " +
"HavingItem, " +
"SuppressDetail, " +
"SummaryType, " +
"DateCreated, " +
"DateUpdated, " +
"CreatedBy, " +
"UpdatedBy " +
"FROM ReportColumns " +
"WHERE ReportName = '" + rptName + "'" );

}
--------------------

// Update the changes based on Report Name/TableName/ColumnName.
// Notice DateCreated and CreatedBy are not updated
FieldTable.addUpdateSql("UPDATE ReportColumns SET TableName=?, " +
"ColumnName=?, " +
"ColumnHeader=?, " +
"PrintOrder=?, " +
"PrintWidth=?, " +
"SortOrder=?, " +
"PrintWrap=?, " +
"SelectionItem=?, " +
"GroupItem=?, " +
"HavingItem=?, " +
"SuppressDetail=?, " +
"SummaryType=?, " +
"DateUpdated=?, " +
"UpdatedBy=? " +
"WHERE ReportName=? " +
"AND TableName=? " +
"AND ColumnName=?", // Update Statement
"2,3,4,5,6,7,8,8,10,11,12,13,15,17,1,2,3", // Column order in statement
new int[]{1,2,3} ); // Primary key column number.


Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Friday, December 3, 2004 @ 20:00:17  

Please enable the debug using dbTable.debug=true and check the debug out. It will print the update query & the arguments. Please send me this, it will help to identify the problem.
Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Sunday, December 5, 2004 @ 01:55:47  

We found a bug with updating primary columns. Its fixed in 2.0.5.16 version. Please use the latest version.
Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios