I am working on informix-4gl.my programs is about to adds and update user information from one tables to many tables.In case, there were information from user that contains "'" symbol or single quote such as the purchaser name or user address.My problems is when I update the tables,the information that contains single quote symbols will not updated.And now I had found that there must be an double quotes to enter the values that was in different online server.Now, I am going to change single quotes to double quotes.I had tried changing code like this but its reads only single quotes.
LET rmks_lgth = LENGTH(p_crsell.crse_purc_nme)
FOR a = 1 TO rmks_lgth
IF p_crsell.crse_purc_nme[a] = "'" THEN
LET p_crsell.crse_purc_nme[a] = "''"
END IF
END FOR
I had tried to change the codes in order to produce double quotes.the quotes must be double up for every input that contains "'" quote symbol.
LET rmks_lgth = LENGTH(p_crsell.crse_purc_nme)
FOR a = 1 TO rmks_lgth
FOR b = 1 TO rmks_lgth
IF p_crsell.crse_purc_nme[a] = "'" THEN
LET p_crsell.crse_purc_nme[a] = "'"
LET p_crsell.crse_purc_nme[b] = "'"
END IF
END FOR
END FOR
codes above will only produce output
''
where there is no other values. someone names ceinmark had suggest that "I need create a 4GL function to found the quote , then strip the string in two at the point you found it and concat the "new" quote with this two parts of the string."