|
Hello all, I have a stored Procedure that when the SQL statement that is executed in the SP, I get a 26501 but when I copy the same stored procedure to interactive SQL, It runs fine. Here is the statement that is being executed: SELECT a.trndt,a.invnr,c.cusnm, c.cusa1,c.cusa2,c.cusa3,d.trmdes,a.invnr, c.stacd FROM Openar a JOIN Oehhst c ON a.invnr = c.invno JOIN Terms d ON c.trmcde = d.trmcde JOIN Custmast e ON a.cusno = e.cusno WHERE a.trtyp = 1 AND c.ordtyp NOT IN('CCA','CCR') AND a.cusno IN (206800,99999999) AND a.trndt BETWEEN 1020929 AND 1021026 ORDER BY cusnm,invnr For testing, I just print it to a spooled file. The dates and customer number clause are passed in as parameters.What I then did was copy the text from the spooled file to STRSQL and it ran fine. I'm preparing the statement and declaring a cursor on the prepared statement. Then checking the SQLSTT after the OPEN. Thanks, Mark Mark Walter Sr. Programmer/Analyst Hanover Wire Cloth a div of CCX, Inc. mwalter@hanoverwire.com http://www.hanoverwire.com 717.637.3795 Ext.3040 /"\ \ / X / \
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.