
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I remember that in SQLite, field types are optional and you don't have to worry about specifying and casting types. It is "Lite" for a reason.
you can split a long query into 3-4-5 ones :-)
BEGIN TRANSACTION
INSERT INTO myTable VALUES (...); --- тут можно получить PrimaryKey
UPDATE myTable .... ; --- обновить по Primary
UPDATE myTable ... ; --- ещё...
COMMIT ; --- это если все запросы удачны.. иначе ROLLBACK
it's from the old memory, so you should check in the help
i would like to have a reproducible query code, it will take a long time to google, i've worked with a database occasionally - i have a problem, i googled it, i solved it - but i would like to see a failed database query
Your particular problem should be solved like this:
a small fix, with more brackets to fix :-)
the main idea is not to use UPDATE x VALUES (), but UPDATE x SET name1=value1,name2=value2. To make the query work correctly when the database structure is changed and not depend on the order of the fields listed
there is approximately the following code (I read text fields from database and want to convert into enum)
2020.09.01 18:59:02.593 tst (EURUSD,M5) Aq in A = Aq
2020.09.01 18:59:02.593 tst (EURUSD,M5) Bw in B = Bw
2020.09.01 18:59:02.593 tst (EURUSD,M5) Error, No not in C
Everything works, but the question is again about the optimal code:
if any way to write instead of txtToEnumA() , txtToEnumB(), txtToEnumC()
template method ( template )
the problem is different number of elements in the enum
What if there is an enum:
?
What if there is an enum:
?
numbering the enum elements is not a problem, it's not clear what this would do
I have only 4 enumerations, not numbered
the problem is that I may want to add new elements to enumeration - in my code, I will add new elements to NOT the outermost ones - the code will work - I do not like the cumbersomeness of this code
but we are not talking about some universal code for all occasions, we need the current tasks in a template
SZY: i can't do without enumeration - it's convenient, i can equally read data both in source and in database, and in database maybe i want to correct some fields manually.... in general, everything suits me
numbering the elements of the enumeration is not a problem, it is not clear what this will do
I have only 4 enumerations, not numbered
the problem is that I may want to add new items to lists - in my code, I will add new items to NOT the outermost ones - the code will work - I do not like the unwieldiness of the code
but we are not talking about some universal code for all occasions, we need the current tasks in a template
SZY: i can't do without enumeration - it's convenient, i can equally read data both in source and in database, and in database maybe i want to correct some fields manually.... everything suits me fine
make a global array and fill it with pairs { EnumToString(x) , x }
struct StringID {
string str;
int id;
};
StringID IDS[];
make a global array and fill it with pairs { EnumToString(x) , x }
struct StringID {
string str;
int id;
};
StringID IDS[];
Your way of doing it is not much different from mine - it's cumbersome too, and if there will be any changes in the code, you'll have to edit the arrays too.
solved my wish this way:
2020.09.01 22:08:47.417 tst (EURUSD,M5) Aq in A = Aq
2020.09.01 22:08:47.417 tst (EURUSD,M5) Bw in B = Bw
2020.09.01 22:08:47.417 tst (EURUSD,M5) Error, No not in C
I need more defines not to enter LastElement, but on the whole this code is more compact