Help with looping a dynamic sql string


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help with looping a dynamic sql string

Hybrid View

  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.



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center