insert data into database problem
Supote Songthammawat
supote.songthammawat at netgalileo.com
Mon Oct 10 23:28:47 EDT 2005
Dear Sir,
I have some problem about insert data by sql into database. Why
I can't not to insert into database? When I press button save it will
occur :
1 (Create PersonSysID) : u just add [Sybase][ODBC Driver][Adaptive
Server Enterprise] The name "khunnawut" is illegal in this context. Only
constant, constant expressions, or variables allowed here. Column names
are illegal. record into DB
My script below of save button below:
put revDataFromQuery (,return, tID, "SELECT MAX(personSysID) FROM
PERSON_TABLE") into tNewEnPersonSysIds
answer tNewEnPersonSysIds
if tNewEnPersonSysIds is empty then
put 1 into tNewEnPersonSysIds
else
put tNewEnPersonSysIds + 1 into tNewEnPersonSysIds
end if
answer tNewEnPersonSysIds
put tNewEnPersonSysIds into tNewPersonSysIds
put fld "FirstName" into tFirstName
put fld "LastName" into tLastName
put fld "MiddleName" into tMiddleName
put text of fld "DateofBirth" into tDateofBirth
put 1 into tPersonTitleCode
put the hilitedButtonName of group "Identification" into tGenderCode
put 1 into tDeceasedIndicator
put 1 into tOrganDonorIndicator
put 1 into tMultipleBirthIndicator
put tNewPersonSysIds, tFirstName, tLastName, tMiddleName,
tDateofBirth, tPersonTitleCode, \
tGenderCode, tDeceasedIndicator, tOrganDonorIndicator,
tMultipleBirthIndicator into tPersonEntTbl
put "INSERT INTO PERSON_TABLE(personSysID, firstName, lastName, " \
&& "middleName, dateOfBirth, personTitleCode, genderCode,
deceasedIndicator, " \
&& "organDonorIndicator, multipleBirthIndicator) VALUES
("&tPersonEntTbl&")" into tSql
revExecuteSQL tID, tSql
answer "1 (Create PersonSysID) : u just add "&the result&" record into DB"
I think I must convert to unidecode before insert , correct?
Please suggest me to solve this problem. Thank you very much.
Urgently!!!!!!!!!!!!!
Best Regards,
Supote
More information about the use-livecode
mailing list