Hi All
I am working with excel as an database functionality of AA360, came accross a case where I have to insert data into excel using DB query, if only the value is not existing in the sheet to inserted.
Here are the queries I have tried
- Insert into STEP2$$] ((Vorhaben],,verteilt an],,E K Z],,Alle Stellungnahmen da?]) values (SELECT ('$RecSqlDatasett0]$', '$RecSqlDatasett3]$', '$RecSqlDatasett8]$', '$RecSqlDatasett17]$') where not exists (Select Vorhaben],,verteilt an],,E K Z],,Alle Stellungnahmen da?] from STEP2$$] where Vorhaben] = '$RecSqlDatasett0]$'))
- Insert into STEP2$$] ((Vorhaben],,verteilt an],,E K Z],,Alle Stellungnahmen da?]) values ('$RecSqlDatasett0]$', '$RecSqlDatasett3]$', '$RecSqlDatasett8]$', '$RecSqlDatasett17]$') where (Select Vorhaben] from STEP2$$]) not in '$RecSqlDatasett0]$
- Insert into STEP2$$] ((Vorhaben],,verteilt an],,E K Z],,Alle Stellungnahmen da?]) values ('$RecSqlDatasett0]$', '$RecSqlDatasett3]$', '$RecSqlDatasett8]$', '$RecSqlDatasett17]$') Where (Select Count((Vorhaben]) from STEP2$$] where Vorhaben]='xyz') = 0
I am able to run the 1st part of query successfully “Insert into tSTEP2$$] (]Vorhaben],nverteilt an],nE K Z],ZAlle Stellungnahmen da?]) values (SELECT ('$RecSqlDatasets0]$', '$RecSqlDatasets3]$', '$RecSqlDatasets8]$', '$RecSqlDatasets17]$')”
Here Vorhaben is the column in both the input and output file.