Hi, I am getting following error message while retrieving records from mysql. *Error in if (count > 0L) { : missing value where TRUE/FALSE needed Calls: <Anonymous> -> do.call -> <Anonymous> -> <Anonymous> Execution halted* con2 <- dbConnect(MySQL(), user="XXX", password="",dbname="yyyy", host="XXX.X.X.X") #if(nchar(disname) == 2) { disQuery= "select Desc from Tablename where Tableanem.field = " cat(paste("*********",disname,"*************","\n",sep="")) disQuery<-paste(disQuery, "'", disname ,"'", sep = "") cat(disQuery,"\n") cat(paste("\\textbf{",Col3[i],"?}\n",sep="")) cat("\\leavevmode","\n") cat("\\newline","\n") #cat(disQuery,"\n") #print(dbListTables(con2)) disres <- dbSendQuery(con2, disQuery) dout <- fetch(disres, n = 10000) dataout <- ifelse(is.na(dout), "-" ,dout) cat(paste(dataout),"\n") * // getting error message here* } dbDisconnect(con2) May i know why I am getting above error message. Regards -- View this message in context: http://r.789695.n4.nabble.com/Error-while-conecting-to-database-tp4631169.html Sent from the R help mailing list archive at Nabble.com.