SQLite - Sidebar

Started by stanl, May 21, 2020, 09:00:26 AM

Previous topic - Next topic

td

You have a two-dimensional array because you created one not because any dotNet method returned one.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: td on May 26, 2020, 08:33:19 AM
You have a two-dimensional array because you created one not because any dotNet method returned one.


Exactly, that was the point. A few posts ago, I concluded that parsing text files into .NET then moving into the extender was not a wise choice. Still, I taken the extra time to create a WB array, the INSERT still didn't work with the Extender - ArrayFileGetCsv() did. Just asked why?

td

That your created 2-dimensional array didn't work in the extender is obviously what I missed.  Pure speculation on my part but the reason it didn't work could be because your rank 2 array elements are variants and might require a little additional processing before they can be passed to SQLite.  The additional processing is something that could be done in the extender but it would require a bit of coding to accomplish.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: td on May 27, 2020, 08:15:58 AM
That your created 2-dimensional array didn't work in the extender is obviously what I missed.  Pure speculation on my part but the reason it didn't work could be because your rank 2 array elements are variants and might require a little additional processing before they can be passed to SQLite.  The additional processing is something that could be done in the extender but it would require a bit of coding to accomplish.


Interesting. Reportview has no issue with the array. Might be worth testing if I assigned the elements as ObjectType("BSTR"),just to see if it achieves the same as dbInsertBatch(db,SQLText,ArrayFileGetCsv("WakeCounty.csv", 0, @TAB),@FALSE).

JTaylor

Guess I missed something too as I thought you were passing the oTables Array.  I will go back and take a look as well.

Jim

Quote from: stanl on May 27, 2020, 04:34:35 PM
Quote from: td on May 27, 2020, 08:15:58 AM
That your created 2-dimensional array didn't work in the extender is obviously what I missed.  Pure speculation on my part but the reason it didn't work could be because your rank 2 array elements are variants and might require a little additional processing before they can be passed to SQLite.  The additional processing is something that could be done in the extender but it would require a bit of coding to accomplish.


Interesting. Reportview has no issue with the array. Might be worth testing if I assigned the elements as ObjectType("BSTR"),just to see if it achieves the same as dbInsertBatch(db,SQLText,ArrayFileGetCsv("WakeCounty.csv", 0, @TAB),@FALSE).

JTaylor

I figured out how to convert BSTR at least and assume I would have to check types and convert all of them.  I think I would have to know you were sending Variants ahead of time but maybe there is a way around that???   Or create a different function.

Of course, this works too and is easier, on me anyway  ;)

ArrayFilePutCSV("array.txt",arrData,@TAB)
arrData = ArrayFileGetCSV("array.txt",0,@TAB)

stanl

Quote from: JTaylor on May 27, 2020, 07:17:13 PM
I figured out how to convert BSTR at least and assume I would have to check types and convert all of them.  I think I would have to know you were sending Variants ahead of time but maybe there is a way around that???   Or create a different function.

Of course, this works too and is easier, on me anyway  ;)

ArrayFilePutCSV("array.txt",arrData,@TAB)
arrData = ArrayFileGetCSV("array.txt",0,@TAB)


Test wakecounty.csv had 66 rows, but when you get beyond 100,000 rows writing an array to file and back to an array is a bit much. I think we can settle that there are issues with .net DataTables.  I was drawn to them having to deal with SEQUENCE objects in both Hana and SQL Server. They are BigInt and generally default to a number like -9223372036854775808.

JTaylor

I know...I am just lazy  :)

If it is something you would use, I will put it on my list and see if I can make it happen.   It would be a good exercise for learning about all the variant sub-types.

Jim

td

Quote from: stanl on May 27, 2020, 04:34:35 PM
Interesting. Reportview has no issue with the array.

That is because the WIL interpreter does all kinds of magic that makes it possible for variants to be just another variable (or array element) from the perspective of the user. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade