Click here to Skip to main content
13,091,537 members (62,704 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello There
i am new to this but i am doing a project about getting data off a table
the project will search a string of a table as well as search of a combo boxes
now for now am trying to add an sql quiry
the quiry bis the following

SELECT Number_Plate, Regstered_Keeper, Make, Model, Year_Of_Make, Colour, Engine_Size, Transmission, Fuel_Type
FROM `tabledata.csv`
WHERE Number_Plate =@plate

i am getting an error with the local variable
it is giving me the following error:

ERROR in WHERE Closure near '@'
unable to purse query text

any help is apreciated
Posted 3-Jan-13 14:13pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This query won't work unless you also give it a value for @plate. Are you doing that ? Also, you don't use quotes in SQL. Nor do you use SQL to parse a local file in the file system, I assume tabledata.csv is a local CSV and not a table in your DB ? What you're doing looks like it's broken beyond repair. You need to write non SQL code to parse a CSV, or SQL code to look inside the database.
m4j 4-Jan-13 5:54am
Do you mean diclare it in SQL or visual studio?
the tabl has to be there as a csv file.. i have a database with the detils but unfortunatly itwas done in MySQL which is not supported by the Visual Studio
although, ifi put a number plate that is specific in the SQL code, i am able to disply all th dtails of that but the variable is still an issue... Sorry for taking your time and your help is very apreciated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100