Welcome to Radarspotting. Please login or sign up.

May 02, 2024, 06:48:52 PM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

SQLite

Started by Oblivian, January 08, 2020, 09:41:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Oblivian

Quote from: SteveHibberd on January 02, 2020, 12:24:02 AM
OK downloaded that SQlite program, all good, but no actual view of the sbs flag, do I need to tick a box somewhere to show it?

I should probably spawn a specific sqlite and basestation.sqb use thread..

SQLite is quite powerful, and if you get your head around navigating the tables, and SQL queries can do a lot of the work without lots of clicks and copy/paste.

The main tabs on the right side you want to look at is SQL, and Data - the latter the list of all the data (if you select the 'aircraft tree on the left)

The field you want is likely 'OperatorFlagCode' - or if you have customised it the EZYA320 string may be found under one of the userstring columns (also visible when clicking 'data' tab at the top of sqlite. )

I believe normally OperatorFlagCode is the 3 letter code and flag is found using an appropriate .bmp or in your case, perhaps it is longer than 3 char - the field allows for up to 20 and locates your custom defined one.

Now for the cool stuff, under the 'SQL' tab, you can do lots. Like enter strings. Such as...
select * from Aircraft where OperatorFlagCode like "EZYA320"
(%s can also be used for wildcard) and click execute

That is, select all fields, from the aircraft table where the field operatorflagcode matches 'ezya320'

This is non-destructive read function that should list a new set of the table in a window below

Now say you want to do what you said, and can change the entire bunch in a swoop by a similar means.

(Off the top of my head)
UPDATE aircraft
SET OperatorFlagCode = 'EZYA320OLD'
WHERE OperatorFlagCode = 'EZYA320'


This is a find/replace - updating the table 'aircraft' And column operatorflagcode if it matches something you ask to look for

The downside is, if you accidentally don't include a valid 'where', you can run the risk of messing the entire database up :) So always good to both back it up, and execute a 'select' of similar nature to see what the expected outcome may be