Patch level : 12.0 884
Files correlati : f0.exe Commento : [fp0300] Corretta query eliminazione. Problema presentato alla CRPA: non esportava le fatture.
This commit is contained in:
		
							parent
							
								
									14b834c54d
								
							
						
					
					
						commit
						da783822cc
					
				| @ -417,12 +417,25 @@ TString& TPaf_record::remove_string(const bool id_riga) | |||||||
| 	query << " AND " << prefix << "KEYPRGINVIO != ''"; | 	query << " AND " << prefix << "KEYPRGINVIO != ''"; | ||||||
| 	CHECKS(++nkf >= 2, "Can't remove partial key on table ", static_cast<const char*>(_table)); | 	CHECKS(++nkf >= 2, "Can't remove partial key on table ", static_cast<const char*>(_table)); | ||||||
| 	query << ';'; | 	query << ';'; | ||||||
|  | 
 | ||||||
|  |   if (nkf == 0) | ||||||
|  |     query.cut(0);       // Crea una query sbagliata "WHERE  AND": "DELETE FROM [table] WHERE  AND [prefix]_KEYPRGINVIO != '';"
 | ||||||
| 	return query; | 	return query; | ||||||
| } | } | ||||||
| // Elimina il record in base ai campi chiave
 | // Elimina il record in base ai campi chiave
 | ||||||
| bool TPaf_record::remove() | bool TPaf_record::remove() | ||||||
| { | { | ||||||
| 		return fp_db().sq_set_exec(remove_string()); |   TString& str = remove_string(); | ||||||
|  |   if (str.empty())      // Se la query e' vuota (sbagliata) salto, non c'e' nulla da eliminare
 | ||||||
|  |     return true; | ||||||
|  |   const bool ok = fp_db().sq_set_exec(str); | ||||||
|  |   if (!ok) | ||||||
|  |   { | ||||||
|  |     ofstream fout; | ||||||
|  |     fout.open("fperror_remove.txt"); | ||||||
|  |     fout << str << "\n" << fp_db().sq_get_text_error(false) << "\n" << fp_db().sq_get_string_error(false); | ||||||
|  |   } | ||||||
|  |   return ok; | ||||||
| } | } | ||||||
| // Carica un record in base ai campi chiave
 | // Carica un record in base ai campi chiave
 | ||||||
| bool TPaf_record::search() | bool TPaf_record::search() | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user