vCursor.import_text

Frank Schima macsforever2000 at axint.net
Wed Jan 5 23:13:40 CST 2005


Hi Olivier,


On Jan 5, 2005, at 10:20 PM, Olivier wrote:

> Hi Ruslan and list,
>
> "Cursor.import_text" work?

Here is what I use to import with V 2:

   theImportCursor.Import_Text(theImportFile, chr(9), chr(13))

> I have a crash in its use.
>
> Cur.import_Text (f, "\t ", " \r") 		 // =crash
> Cur.import_Text ( f ) 		 		// =not accepted
> Cur.import_Text (f, "\t ", " \r", false) 	// =not accepted
>
> I saw in the mantis that Franck had indicated (ID 185 of December 
> 12th, assigned to Igor, not resolved) a crash on import_text when 
> there were several fields. (but it's not in cursor ?)
> But I tried with a single field and five recordings and I have the 
> same crash.

My bug report is about how picky V 2 importing is compared to V 1. In V 
2, the number of fields in the text file must match *exactly* with the 
number of fields in the SELECT of the cursor. If they do not match in 
*any* single line of text, it will crash.

V 1 was much more forgiving about filling in Null or blank values if 
there were less text fields than SELECT fields in the cursor - or 
ignoring the extra text fields if there were too many.

So check your import file to make sure the number of fields of every 
line matches with the SQL statement. BBedit with "Show Invisibles" set 
ON is very helpful here.


Best regards,
Frank Schima



More information about the Valentina-beta mailing list