gcue 8 Posted January 3, 2013 i am inserting values from a text file into a sqlite database. first i create the array then cycle through each array record and insert it into a sql table. For $y = 0 To UBound($avOut) - 1 $aTemp[0] = "'" & $avOut[$y][0] & "'" $aTemp[1] = "'" & $avOut[$y][1] & "'" $aTemp[3] = "'" & $avOut[$y][3] & "'" $sTemp = $aTemp[0] & "," & $aTemp[1] & "," & $aTemp[3] _SQLite_Exec(-1, "INSERT INTO aAssetInfo (Tag,Status,Type) VALUES (" & $sTemp & ");") Next the problem i am running into is when a data field has a single quote, then that record is not inserted. how should i specify the quotes here "'" & $avOut[$y][0] & "'" to get around that? thanks in advance! Share this post Link to post Share on other sites
czardas 1,200 Posted January 3, 2013 I still haven't got around to trying these functions. Anyway a quick Google search brought me to this page. I don't know if it helps. http://stackoverflow.com/questions/775687/how-to-insert-text-with-single-quotation-sql-server-2005 operator64 ArrayWorkshop Share this post Link to post Share on other sites
gcue 8 Posted January 3, 2013 i tried double single quotes but that didnt work for me. "''" & $avOut[$y][0] & "''" Share this post Link to post Share on other sites
Jos 1,565 Posted January 3, 2013 Something like this for each line: $aTemp[0] = "'" & StringReplace($avOut[$y][0],"'","''") & "'" Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
gcue 8 Posted January 3, 2013 that worked great! thanks Jos!! =) Share this post Link to post Share on other sites