DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    jeff Guest

    Help with looping a dynamic sql string


    i am trying to run the following and was wandering what part of sytax i am
    missing in order for the loop to work properly

    SQL = " Insert Into tblCLTestQs "
    SQL = SQL & "( "
    for Loopenit = 1 to NumberOFQs step 1
    SQL = SQL & " Q" & Loopenit & ", "
    next
    SQL = SQL & " TestID) "
    SQL = SQL & " Values ( "
    for Addenit = 1 to 50 step 1
    SQL = SQL & " '" & memQ & Addenit & "', "
    next

  2. #2
    Koonwa Guest

    Re: Help with looping a dynamic sql string


    "jeff" <jsymsy1@comcast.net> wrote:
    >
    >i am trying to run the following and was wandering what part of sytax i

    am
    >missing in order for the loop to work properly
    >
    >SQL = " Insert Into tblCLTestQs "
    > SQL = SQL & "( "
    > for Loopenit = 1 to NumberOFQs step 1
    > SQL = SQL & " Q" & Loopenit & ", "
    > next
    > SQL = SQL & " TestID) "
    > SQL = SQL & " Values ( "
    > for Addenit = 1 to 50 step 1
    > SQL = SQL & " '" & memQ & Addenit & "', "
    > next



    The only syntax error I can see is a missing ) at the end of your statement.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links