LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SQL -> LIKE Statement

Hi I have a few Problem with an SQL Statement that I use in ni-SQL-toolkit:

SQL = "SELECT C_Profile FROM PROFILE_TAB WHERE C_Profile LIKE '*SCT*' ORDER BY C_Profile ASC"

When I try to use in Access it works fine, I get records back... If I use trough SQL-Toolkit I dont get any records.

the other part of the code:

DBHandle = DB_Connect(DB);
DBAllowFetchAnyDirection (DBHandle,1);
SQLHandle = DBActivateSQL (DBHandle, SQL_SELECT);
if(SQLHandle == 0) goto Error;

numCols = DBNumberOfColumns (SQLHandle);
numRecs = DBNumberOfRecords (SQLHandle);

numRecs is always 0.

Any Idea ? thanks
0 Kudos
Message 1 of 2
(2,905 Views)
Try:
SQL = "SELECT C_Profile FROM PROFILE_TAB WHERE C_Profile LIKE '%SCT%' ORDER BY C_Profile ASC"
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 2
(2,905 Views)