I am fairly new to PowerBuilder Classic 12. I need to check whether a record is available and if not insert from a textbox. I would probably need a DataStore since someone suggested a preference to SQL statements. Thanks. this code is behaving funny, please where is the problem? at one time it works but running the program again it accepts a data that has already been inserted. the program is not giving any error but i can see the same data stored in the table.
string id, idno
idno=trim(sle_idno.text)
if idno="" then
messagebox("EMPTY","Enter a record")
return
end if
SELECT employee.idnumber
INTO :id
FROM employee ;
if idno=id then
messagebox("AVAILABLE","Record available")
return
end if
INSERT INTO employee
( idnumber )
VALUES ( :idno ) ;