visual studio中的SQL局部变量 [英] SQL local variables in visual studio

查看:83
本文介绍了visual studio中的SQL局部变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello There

i我是新手,但我正在做一个关于从桌子上获取数据的项目

项目将搜索一个表格的字符串以及搜索组合框

现在我正在尝试添加一个sql quiry

quiry bis以下



选择Number_Plate,Regstered_Keeper,品牌,型号,Year_Of_Make,颜色,Engine_Size,传输,Fuel_Type

FROM`tabledata.csv`

,其中Number_Plate = @板



i我的本地变量出现错误

它给我以下错误:



错误在WHERE关闭附近'''''

无法查询查询文本





any帮助是apreciated

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

推荐答案

除非你给@plate一个值,否则这个查询不会工作。你在做吗?另外,你不能在SQL中使用引号。你也不使用SQL来解析文件系统中的本地文件,我假设tabledata.csv是本地CSV而不是数据库中的表?你正在做的事情看起来像是无法修复的。您需要编写非SQL代码来解析CSV或SQL代码以查看数据库内部。
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.


这篇关于visual studio中的SQL局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆