Hi there I was wondering if their is anyone who can convert this statement from 'INSERT' to 'UPDATE' as I cannot seem to do is.
Code can be seen below:
public static void COUNT2( ) {
try {
ResultSet res = stmt.executeQuery("INSERT INTO TABLE2 (VIDEOID,VIDEONAME,DIRECTOR,RATING,PLAYCOUNT) SELECT VIDEOID,VIDEONAME,DIRECTOR,RATING,PLAYCOUNT FROM TABLE1" );
while (res.next()) { // there is a result
}
} catch (Exception e) {
System.out.println(e);
}
}
I have tried the following which produced the error Syntax error in UPDATE statement:
public static void COUNT2( ) {
try {
ResultSet res = stmt.executeQuery("UPDATE TABLE2 SET VIDEOID,VIDEONAME,DIRECTOR,RATING,PLAYCOUNT = VIDEOID,VIDEONAME,DIRECTOR,RATING,PLAYCOUNT FROM TABLE1 " );
while (res.next()) { // there is a result
// output += formatListEntry(res);
}
} catch (Exception e) {
System.out.println(e);
}
}