We help IT Professionals succeed at work.
Get Started

Dynamic SQL Query gives one record

81 Views
Last Modified: 2016-02-06
Hello all;
I hope that I titled this question properly.

OK.
This is the way I have it set up.
Textarea has the name of songs.
One song per Row

Now, this is the Variable, with the generated code from the Textarea.

getAll = "Songs.SongTitle='Strutter ' or Songs.SongTitle='Black_Diamond ' or Songs.SongTitle='Parasite ' or Songs.SongTitle='Strange_Ways ' or Songs.SongTitle='Rock_Bottom ' or Songs.SongTitle='God_of_Thunder' or Songs.SongTitle='Love_Gun' or Songs.SongTitle='She ' or Songs.SongTitle='I_Stole_Your_Love'" 

Open in new window


OK, this is my SQL Query.

getList.commandtext="SELECT Albums.AlbumName, Songs.SongTitle, Songs.Writers, Songs.Vocals, Songs.SID FROM Albums RIGHT OUTER JOIN Songs ON Albums.AID = Songs.AID WHERE "&getAll&""

set rsList = getList.execute
while not rsList.eof%>
<%=rsList("Writers")%>
<%rsList.movenext
wend
%>

Open in new window


The results is:
One single records, instead of the 9 that are listed.

Just now, I removed the WHILE NOT.
To see what it would give, and it gives the same exact results as it does when it is in place.

The script works, with the way I am doing it, just giving on 1 result, instead of the nine that is intended.

Any idea's on this?
(I have been answering my own questions hear lately, just right after posting, so, maybe it will happen again)
Carrzkiss
Comment
Watch Question
EE Topic Advisor
CERTIFIED EXPERT
Awarded 2013
Top Expert 2016
Commented:
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE