Page 1 of 1

Read from text file size limit? Can't loop if?

Posted: Thu Dec 09, 2010 10:36 am
by Chris_DMG
Hello all, I have a problem with InstallAware 9 for reading text files.
Based on a condition during install (If it is a new install or not) I need to run a series of scripts against SQL Server to create and populate a couple of databases. Since these scripts are prone to changing as new releases come out we wanted to make the processing dynamic so the install script doesn't need to be updated every time one of our SQL scripts changes.

I am using a File Bag to house the files and make them available at run time. This works very well and most of the scripts I can use Read from text file with the #READALL switch into a variable and then use the variable in the MS SQL Server action. I have a couple of larger script files, 400+kb some with upwards of 7 - 8 thousand lines and 450,000+ characters, that do not get read by the Read from text file. The variable it should have loaded into doesn't load the script and I can not display its contents. I don't have much control over the script files given to me so I need to work with what I have if at all possible.

I figure this is a limitation in that the files are just too large for the runtime variable size limit, which is odd because I can paste the full script into the MS SQL Server dialog at design time and compile and run it successfully, but this does not handle future changes. I tried just making a loop in my include script to read through each line until it finds a GO statement and then execute each section, but I found InstallAware does not support loops like Wise did, and when I tried the label route it gave an error that I can not nest labels inside loops/conditionals.

Am I missing something with processing text files or loops here? How can I dynamically parse this file at runtime?

Thank you for any help or suggestions you guys might have.

Re: Read from text file size limit? Can't loop if?

Posted: Thu Dec 09, 2010 7:34 pm
by mills
This post is related:
http://www.installaware.com/forum/viewt ... 78&start=0

Can you verify if there's a similar threshold you see (around the 1300KB mark)?

It is correct that you cannot put a label definition within an if statement, however you can put a GoTo command within an if statement.

InstallAware 10 offers looping functionality with commands:
While
Until
Break
Continue
Wend
Repeat

Re: Read from text file size limit? Can't loop if?

Posted: Fri Dec 10, 2010 9:15 am
by Chris_DMG
All of my files with the problem are less than 500k, and I don't notice any other variables getting messed up, just the one that is supposed to hold that one script file.

The goto wouldn't really help for me to jump back to the start of the entire database creation section as that would require a lot of extra logic built in to keep track of the loop and not run those items already done. It sounds like version 10 may definitely be worth upgrading.

Re: Read from text file size limit? Can't loop if?

Posted: Wed Dec 15, 2010 4:55 pm
by mills
Since there are varying sizes of files being reported on this, it may be a character that is the cause. Could you split one of your scripts up into smaller pieces to see if one of the pieces fail?