Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL query using variables in a script

Status
Not open for further replies.

jbeetz1

Programmer
Nov 28, 2000
60
US
I have a table (car) that has a primary key composed of two fields (track_id,car_id). When I issue the following command from within Powerbuilder (4 GL client tool similar to VB)

declare
integer car_no,track_no

car_no = 123
track_no = 1

Select * from car
where car_id = :car_no and track_id = :track_no;

This returns no rows. If I drop the primry key on the table it will return the correct number of rows. Also if I issue the select as

Select * from car
where car_id = 123 and track_id = 1;
it will return the correct number of rows.

MYSQL is version 3.23.53a and the ODBC driver is 3.51

Does anyone know why the select using the variables will not work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top