1 (edited by borisavljevic 2021-08-25 22:43:31)

Topic: [SOLVED] Auto fill db table only on first application run

Hi,
What I need is to auto fill db table 'categories', field name 'cat_name' with predefined categories names only when user FIRST TIME run application. It's because I want to use that predefined categories names in script so user can't change them. For example: drinks, food, raw materials.

Thanks in advance.
Vladimir

Re: [SOLVED] Auto fill db table only on first application run

Try this

If Vartostr(SQlExecute('select count(id) from tablename'))='0' then
Begin
SQLExecute('insert into tablename(columnname) values('myvalue')');
End;

Try this in
Begin
End.

3 (edited by borisavljevic 2021-08-19 19:59:08)

Re: [SOLVED] Auto fill db table only on first application run

Yea, this works great.

Than you for your time and help.