View Single Post
  #1 (permalink)  
Old 03-09-2010, 06:35 AM
catchem35 catchem35 is offline
Junior Member
 
Join Date: Nov 2009
Posts: 9
Default MySQL & Loop Requires Maximum Number of Records

When Querying a MySQL Database and using the Loop option to select "Each row in SQL Query dataset" the column values are not assigned to the $Dataset Column(1)$ system variable.

Example (does not work):
Connect to 'Provider=MSDASQL.1;Persist Security Info=False;Data Source=ConnectionName'
Comment: Query below only works when "Maximum number of records to fetch" is specified.
Execute SQL Statement: SELECT email FROM public_records.email_dist_list
...
Start Loop " Each row in a SQL query dataset"
Message Box: "$Dataset Column(1)$"
End Loop
Disconnect from Database

However, I can get this to work if I specify a value for the "Maximum number of records to fetch" with the SQL Command options which should be an optional value.

Example:
Execute SQL Statement: 'SELECT email FROM public_records.email_dist_list
'... with 10 records to fetch

I welcome any suggestions on how I might correct or work around this. Thank you.
Reply With Quote