|
Mark, below is a subprocedure which builds a host variable called SQLStmt (a 1024 varying character field), prepares the statement using that host variable, declares the cursor using the prepared statement, then opens the cursor. Is this what you're looking for? Phil P SQL_PrpStmt b /FREE SQLStmt = 'select * from prmorg + where companyNumber = ' + %editc(cpy:'X') + ' order by companyNumber, organizationName'; /END-FREE C/exec sql C+ PREPARE @SELECT FROM :SQLStmt C/end-exec C C/exec sql C+ DECLARE @CURSOR DYNAMIC SCROLL CURSOR FOR @SELECT C/end-exec C C/exec sql C+ open @cursor C/end-exec P SQL_PrpStmt e > > >>> mlazarus@ttec.com 03/18/02 06:21PM >>> > I would like to run a dynamic SQL statement with > an undetermined (at > compile time) number of placeholder variables. > > Building the PREPARE string w/ the placemarkers is > not a problem. > My > question is how do I specify the "OPEN cursor INTO" > dynamically? > > TIA. > > -mark __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/
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.