I should have been clearer.

(#pos)#00

is the right way for 9.01 and later.

(#pos)#<:1

works for all versions.

Henry Rich

On 12/19/2019 2:58 PM, John Baker wrote:
Thanks Henry,

I will keep looking after I try your datatype suggestions.



On Thu, Dec 19, 2019 at 12:55 PM Henry Rich <henryhr...@gmail.com> wrote:

As of 9.01

seq=. (#pos)#<:1.0

produces a float result, because of the 1.0.  In earlier versions 1.0
produced boolean and the <: created int.

Now you can get int by changing the 1.0 to 1 (that will be boolean, then
converted to int), or more simply with

seq=. (#pos)#00

because 00 is always int.


I don't see how the assignment could fail.  Is it perhaps failing
instead in the first line of the try., where it is passing the wrong
type to the DLL?

Henry Rich



On 12/19/2019 2:47 PM, John Baker wrote:
I have a J application that scans directories of TAB delimited CSV files
created
by a Python program that downloads image metadata from
https://conceptcontrol.smugmug.com/
The J app consolidates all the CSV data into one compact sqlite database.

This application is complicated so I expected issues with moving to 9.01.
The app didn't
run in 9.01 failing on sqlite insert statements.  I tried again today
aiming to find out why things
work in 8.07 but fail in 9.01.

The app fails in the following loop and it appears to have nothing to do
with sqlite or the sqlite addon.
Something strange is happening in the 9.01 for loop. The problem
manifests
in the line:

seq=. (#pos)#<:1.0 NB. insure integer datatype (does not work in 9.01 -
produces floating instead of integer)


NB. insert galleries one at a time - allows better debugging

idg=. ThumbName i. AlbumName

tab=. 'ThumbnailGallery'

cln=. 0 {"1 sqldict__dt tab


for_gal. ~.AlbumName do.


pos=. I. gal=AlbumName

idGal=. pos { idg

idThb=. pos { LocalThumbID


seq=. (#pos)#<:1.0 NB. insure integer datatype


NB. insert gallery data

try. rc=. sqlinsert__dt tab;cln;<idGal;idThb;seq catcht. rc=. _1 end.


if. 0 ~: rc do. smoutput 'failure inserting -> ',(4 s: gal),' trying next
gallery ...' end.


end.

   The assignment

seq=. (#pos)#<:1.0 NB. insure integer datatype


seems to break out of the loop - after running this line in 9.01 seq is
not
set and shows

as a value error in 9.01 - it works fine in 8.07


There may be some side effect of running sqlite addon verbs in a for
loop.

I will keep investigating and see if I can code a work around but there
are
issues for sqlite addon apps in J 9.01


John Baker







----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to