I am trying to use the modulus of a number to insert a value into a postgres database table but cant seem to get the code just right.
At the moment ive got:
lnResult = SQLEXEC(lnConn, "INSERT INTO table1 (tb1_field1, tb1_field2, tb1_field3, tb1_field4, tb1_field5, tb1_field6, tb1_field7) VALUES('abc', ?z_loop, ?(mod(z_loop,2)), CURRENT_DATE, CURRENT_TIME, 'abc', 'abc')")
Ive got ?z_loop insert a numerical value in tb1_field2 but i cant get the modulus to work in order to insert either 1 or 0 as boolean true or false for tb1_field3.
Any help would be appreciated.
At the moment ive got:
lnResult = SQLEXEC(lnConn, "INSERT INTO table1 (tb1_field1, tb1_field2, tb1_field3, tb1_field4, tb1_field5, tb1_field6, tb1_field7) VALUES('abc', ?z_loop, ?(mod(z_loop,2)), CURRENT_DATE, CURRENT_TIME, 'abc', 'abc')")
Ive got ?z_loop insert a numerical value in tb1_field2 but i cant get the modulus to work in order to insert either 1 or 0 as boolean true or false for tb1_field3.
Any help would be appreciated.