|
Sorry to keep coming around with this issue, but I ran into a few snags.
The following, which was suggested by responses from this list(thanks!),
works in an SQLRPGLE program: Data is written to a PF on the iSeries --
c _eval sqlstmt = %trim(sqlstmt) +
c %trim(insert) + ' ' +
c ' ' + %trim(filnam) +
c ' ' + %trim(fields ) +
c ' VALUES(' +
c Q + Value1 + Q + ',' +
c %EDITC(Value2: 'P') + ',' +
c Q + Value3 + Q + ',' +
c Q + Value4 + Q + ',' +
c %EDITC(Value5:'P') + ')'
It's writing the records correctly, with Value2 and Value5 as numerics. The
problem I'm running into is two fold:
One - this string is being passed into a procedure, running in a software
package. I don't have any access to the code that's executing this( RJS
Software's RPG2SQL).
The package reports a syntax error: (The below has many more fields that the
above 5)
Received SQL Execute: insert into
TRANSACT.DBF(DISTRICT,ORDERNO,WOLINENO,MATERIAL,THICKNESS,QTY,ORDERSHAPE,SHPPARAM1,SHPPARAM2,SHPPARAM3,SHPPARAM4,SHPPARAM5,SHPPARAM6,SHPPARAM7,SHPPARAM8,SPECPROP,SPECPROP1,SPECPROP2,SPECPROP3,SHTLENGTH,SHTWIDTH,SHTCOST,SHEETTYPE,INTEGER1,INTEGER2,REAL1,REAL2,REAL3,REAL4,RESULT,ODPOSTOL,ODNEGTOL,IDPOSTOL,IDNEGTOL)
VALUES( 99,'123 ','01 ','ABC ',
3.0, 2,'Rec ', .0, .0, .0, .0, .0, .0, .0, .0,'0', .0, .0,
.0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0,'0', .0, .0, .0, .0,
.0) from 172.16.222.200(168)
Sending: 100 SQL
999 ERR-2147217900 [Microsoft][ODBC dBase Driver] Syntax error in INSERT INTO
statement.
Two - if you look at the above, the numeric fields are initialized as "0.0",
but they're inserted as " .0". I can probably fix that by changing the edit
code, from 'P' to something else.
What I'm wondering is this:
I think that by using the %EDITC, the fields are being interpreted as
Character Data, rather than numeric. It works in DB2, which is somewhat
forgiving, but, when going to the Microsoft world of a .DBF, maybe it's choking
and reporting a syntax error???? When I look at the statement, it looks valid.
I'm going to do further testing tomorrow at work with the 'server' guy.
I still think there was another way around this...I'm going to continue
hunting around.
Again, thanks for any suggestions...
Matt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.