Need help, please see below table structure:
Table: MainData (see fields below)
ID TypeId TypeName
0 0 MAIN
1 4 Test1
2 4 Test2
3 4 Test3
4 4 Test4
7 7 File1
8 7 File2
9 7 File3
10 7 File4
14 8 Database1
15 8 Datebase2
16 8 Database3
17 8 Database4
See query below now with which i’m strugling
Insert into temptable (Field1, Field2, Field3) Values (Test1, File4, Database3)
Test1, File4, Database3 – I have got these as string values passed to function, now to have to get their ID’s which need to be insert into temptable
So then below query should become
Insert into temptable (Field1, Field2, Field3) Values (1, 10, 16)
1 - Test1
10 - File4
16 - Database3
Regards
Note: this works only if there is exactly zero or one entries in the Maintable for any given value. You might want to use the typeid, but it is not clear from your question.