Topic: Having trouble with script
Here is what I have: But I keep getting this error " Undeclared identifier: 'sid_mastersets' at 64:35 Any ideas on what I did wrong.
// id_mastersets
if arrStr[6] <> '' then
begin
sid_mastersets := SQLExecute ('SELECT id FROM mastersets WHERE dbmastersets LIKE ''' + ReplaceStr(arrStr[6], '''', '''''') +'''');
if sid_mastersets = '' then
begin
SQLExecute ('INSERT INTO sets (dbmastersets) VALUES ('''+ ReplaceStr(arrStr[6], '''', '''''') +''');');
sid_mastersets := IntToStr(Last_Insert_id('mastersets'));
if sid_mastersets = '-1' then sid_mastersets := 'NULL';
end;
end else sid_mastersets := 'NULL';
SQLExecute ('INSERT INTO base (year, id_sets, [Player Name], number, [psa grade], [psa number], id_mastersets) VALUES ('+ arrStr[0]+','+ sid_sets+','+ arrStr[2]+','+ arrStr[3]+','+ arrStr[4]+','+ arrStr[5]+','+ arrStr[6]+','+ sid_mastersets+');');