Jump to content
  • 0

sql syntax for removing lines


Achmed

Question

im wanting to remove lines from the db that are not needed for chernarus to make it more simple for me to manage.

 

currently working on a list of unused tid's

 

would this sql syntax work to remove all lines that match the tid 000? (i know 000 is not a valid tid its just an example)

DELETE FROM TRADERS_DATA WHERE tid = 000;
Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

 

also would i need to have it for each tid to remove or can i just create a list like this?

DELETE FROM TRADERS_DATA WHERE tid = 000, 001, 002;

 

I believe this should work:

DELETE FROM TRADERS_DATA WHERE tid IN(000,001,002)

By the way, you're trying to clean up vendors tied to other map instances, right?

Link to comment
Share on other sites

  • 0

yeah, im just trying to clear it all out as in this DB im only ever gona use cherno.

 

i ended up doing this as could not work it out lol

DELETE FROM TRADERS_DATA WHERE tid = '000';
DELETE FROM TRADERS_DATA WHERE tid = '001';
DELETE FROM TRADERS_DATA WHERE tid = '002';

prob not the best way to wright it but it worked to clear it all out. Now i only the tid's in the server_traders.sqf in the db.

Link to comment
Share on other sites

  • 0

yeah, im just trying to clear it all out as in this DB im only ever gona use cherno.

 

i ended up doing this as could not work it out lol

DELETE FROM TRADERS_DATA WHERE tid = '000';
DELETE FROM TRADERS_DATA WHERE tid = '001';
DELETE FROM TRADERS_DATA WHERE tid = '002';

prob not the best way to wright it but it worked to clear it all out. Now i only the tid's in the server_traders.sqf in the db.

 

Hmm ok...I know that what I posted above works for simple read queries, haven't tried it for deletes though.

 

I'm interested in trying this too. Will probably give it a go in a couple weeks.

Link to comment
Share on other sites

  • 0

Hmm ok...I know that what I posted above works for simple read queries, haven't tried it for deletes though.

 

I'm interested in trying this too. Will probably give it a go in a couple weeks.

 

 

How did you end up with all trader data anyway? Your host automaticly adds them all?

 

the DB can be used for every epoch map but as im not planning on moving to another map i have removed all the excess data to make it easyier to mannage

your way may work, i tried this before you posted and well when its gone its gone lol so i cant try your way

Link to comment
Share on other sites

  • 0

All maps now use the same tids.

 

i know your the man in the know and all that but unless im mistaken i disagree :p

 

in the sql file that shipped with 1.0.2.1 is this line

INSERT INTO `trader_items` VALUES(769, 'bulk_ItemTankTrap', 1, 'Wholesale Crates', 'trade_items');

if you search the server_traders.sqf from chernarus 11 for 769 it does not find it.

 

Am i miss understanding how the server_traders.sqf files works or is tid 769 not needed in chernarus 11?

Link to comment
Share on other sites

  • 0

Those ids are not meant to match up with anything. trader_items table is not used by the game in any way and is used for our tool to edit and add items to the traders.

 

The only table that matters to the game as far as traders goes is the traders_data table you can remove these tables:

trader_items

server_traders
trader_tids

 

However since they are small and not used by the game your net gain will be negligible.

Link to comment
Share on other sites

  • 0

Sorry that was my mistake, i didnt look at what table it was from, just found a random one and searched the server_traiders.sqf file.

 

This is a selection of what i removed that was not in the server_traiders.sqf file

DELETE FROM TRADERS_DATA WHERE tid = '504';
DELETE FROM TRADERS_DATA WHERE tid = '505';
DELETE FROM TRADERS_DATA WHERE tid = '506';
DELETE FROM TRADERS_DATA WHERE tid = '507';
DELETE FROM TRADERS_DATA WHERE tid = '511';
DELETE FROM TRADERS_DATA WHERE tid = '513';
DELETE FROM TRADERS_DATA WHERE tid = '514';
DELETE FROM TRADERS_DATA WHERE tid = '515';
DELETE FROM TRADERS_DATA WHERE tid = '516';
DELETE FROM TRADERS_DATA WHERE tid = '518';
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...