English 中文(简体)
exists server 服务器
原标题:sql server invalid precision on exists check query

2008年使用ql服务器 我在以下文字中发现和无效的精确值错误:

use DBI;
$idx =  12345 ;
$query =  if exists (select * from tbl where idx = ?) select top 10 * from tbl ;
my $h = $dbh->prepare($query) or die "Couldn t prepare query: " . $dbh->errstr;
$h->execute($idx) or die "Couldn t execute statement: " . $h->errstr;

但请注意,如果我试图这样做,

use DBI;
$query =  if exists (select * from tbl where idx =  12345 ) select top 10 * from tbl ;
my $h = $dbh->prepare($query) or die "Couldn t prepare query: " . $dbh->errstr;
$h->execute() or die "Couldn t execute statement: " . $h->errstr;

之后,它运作。 我真的混淆了如何? 在询问中,可能会造成错误准确错误。

任何人都能提供帮助。

最佳回答
问题回答

与某种特定类型挂钩,优先于行文部:ODBC决定。 DBD:ODBC将根据从KallDeppParam返回的参数对参数进行约束。 有时是: 残废,特别是当你使用职能或子电时。 服务器的ODBC驾驶员用你的LQ和后方包,试图用像“从 t子中选取”这样的东西来结束,然后看一栏来回答LucDeregParam的电话。 I m betting the Frank ODBC的驾驶员未能重新安排你在此案中的座右铭,而DekerParam要么失败要么退回错误的信息。 如果你能够在非行追踪:我们可能看到这种情况发生。





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签