Page 1 of 1

Simple INSERT not working.

Posted: Tue Jul 15, 2014 8:34 am
by wfpturner
I'm trying to do a READCSV to a rowset and then insert the rowset into an i-Series file. I've simplified this down to one field in both the rowset and i-Series file. The first error in the joblog is "Last known record near boundaries...", which after reading other forum entries tells me there may be something wrong with my data, but I don't see anything wrong. The next error is "Descriptor index not valid".

Attached is the CSV file and the joblog. Below is the XML listing. Can anyone tell what I'm doing wrong here?
Code: Select all
<project name="Get File From Concur - SQL test" mainModule="Main" version="2.0" logLevel="verbose">

	<module name="Main">
		<createWorkspace version="1.0" />
		<readCSV inputFile="/QOpenSys/Concur/TempFIles/tfile1.txt" outputRowSetVariable="locrowset" fieldDelimiter="pipe" skipInvalidRecords="true" skipFirstRow="false" recordDelimiter="CRLF" version="1.0">
			<data trim="none" nullIndicator="*">
				<column index="3" name="Batch Date" size="10" type="CHAR" trim="both" nullIndicator="*" />
			</data>
		</readCSV>

		<sql label="Connect to AS400" resourceId="AS400a" version="1.0" disabled="false">
			<query label="Import into PF" inputRowSetVariable="${locrowset}" outputVariable="tmpresult" nullSubstitute="*" whenNoDataFound="continue">
				<statement>INSERT INTO PTLIB.CONCURTST(BATCHDT) VALUES(?)</statement>
			</query>
		</sql>
		<deleteWorkspace version="1.0" disabled="false" />
	</module>
</project>

Re: Simple INSERT not working.

Posted: Tue Jul 15, 2014 12:07 pm
by wfpturner
I was able to perform this task using the For-Each loop that Rick described in another topic. As for the original way I was trying to do this, I was thinking that by using the DATA feature on the READCSV task, this would only put those data elements into the rowset. I am thinking now that all fields on the CSV file will still be in the rowset, and this is what was causing my original plan to not work.

Re: Simple INSERT not working.

Posted: Tue Jul 15, 2014 2:57 pm
by Support_Jon
It sounds like you solved this one already. I just want to point out that if you are on GoAnywhere Director version 4.6 or later there is a new task called Modify Rowset that would allow you to use a rowset (in your example a CSV file) and then create a modified rowset that could contain a subset of the columns from the input rowset.

If this sounds inline with what you need, start with the help documentation within the product as it covers it in depth, then refer to Rick's Tip on Modify Rowset

Thanks - Jon