I have just one question regarding core side and using the SQL statements to update/insert datas into the database.
How could i implement the following query when a new character is created?
("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=login")
I want that the new character that's created on the same account to have the botprev_fail_account value taken from the ACCOUNTS table and inserted into botprev_fail_account from CHARACTERS table.
The account_name and login have the same value.
The following code that i tried doesn't work:
try(Connection con2 =DatabaseFactory.getConnection()){PreparedStatement statement2 = con2.prepareStatement("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=?");
statement2.setString(1, _accountName);
statement2.executeUpdate();
statement2.close();}
Lineage2 Acessen- INTERLUDE PVP-PVE LOW CLASSIC
RETAIL SERVER !!
💫 NPC BUFFER SENCILLO A PARTIR DE LVL 20
Exp x1.50 | Adena x1.50
Sistema de Casas por alquiler ( incluyen niveles para mejorar la casa + beneficios )
Sistema de tradeo mediante buffalo ( transporte de items de ciudad a ciudad, con ganancia de adena ).
Website: acessen.com.ar
Discord: https://discord.gg/jzyyQtEKmf PARA MAS INFORMACIÓN
🎯 Looking for a stable and fun server to grind with your friends?
Join L2Roosters over 1000+ players online daily, intense epic battles, fair economy, no corruption, and exciting daily events!
💎 Got friends? Bring them along and claim 1 WEEK of FREE Premium Access!
🔥 Start your journey with us today!
Question
stalker66
Hi guys.
I have just one question regarding core side and using the SQL statements to update/insert datas into the database.
How could i implement the following query when a new character is created?
I want that the new character that's created on the same account to have the botprev_fail_account value taken from the ACCOUNTS table and inserted into botprev_fail_account from CHARACTERS table.
The account_name and login have the same value.
The following code that i tried doesn't work:
3 answers to this question
Recommended Posts