由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Dynamic SQL的弱问题
相关主题
SQL Server 2005 Exec( )get value returned by SQLstored procedure from python (转载)
SQL Server 问题 -- 怎样 UPDADATE 才快run SQL stored procedure from python
SSIS package存放问题PB SQL语句的简单问题
[转载] 真的没有人懂 ORACLE pro*c阿? :((((how to do this Database operation as time
我这个数据库怎么办啊?M$ SQL Random number
问一个db2的弱问题请教一个求职面试题:如何写一个SQL query求表中对角线的和
error file或者exception file问Jackrun, Beijing等大侠performance问题
SQL debug step into a store procedure from another one (转载)how to compare two schemas to look for missing indices
相关话题的讨论汇总
话题: sql话题: exec话题: dynamic话题: error话题: execute
进入Database版参与讨论
1 (共1页)
a***d
发帖数: 3
1
Code
strcpy(s, "SELECT * FROM ");
strcat(s, exp_name);
EXEC SQL PREPARE q FROM :s;
EXEC SQL EXECUTE q ;
Error
sql error Too few arguments in line 62.
不明白呀,有什么好办法把table的名字很好的放进query里吗?
用using的话带引号,很烦人
thanks in advance :)
w******n
发帖数: 692
2
This statement seems fine. maybe you should post all codes, if not very long.

【在 a***d 的大作中提到】
: Code
: strcpy(s, "SELECT * FROM ");
: strcat(s, exp_name);
: EXEC SQL PREPARE q FROM :s;
: EXEC SQL EXECUTE q ;
: Error
: sql error Too few arguments in line 62.
: 不明白呀,有什么好办法把table的名字很好的放进query里吗?
: 用using的话带引号,很烦人
: thanks in advance :)

a***d
发帖数: 3
3
When I comment out this part of code. There is nothing wrong. :(

long.

【在 w******n 的大作中提到】
: This statement seems fine. maybe you should post all codes, if not very long.
c**t
发帖数: 2744
4
Using sp.
exec desiredsql tbname
declare sql varchar(255)
..
set @sql='select * from ' + @tbname
execute (@sql)
..

【在 a***d 的大作中提到】
: Code
: strcpy(s, "SELECT * FROM ");
: strcat(s, exp_name);
: EXEC SQL PREPARE q FROM :s;
: EXEC SQL EXECUTE q ;
: Error
: sql error Too few arguments in line 62.
: 不明白呀,有什么好办法把table的名字很好的放进query里吗?
: 用using的话带引号,很烦人
: thanks in advance :)

p*******g
发帖数: 34
5
Thanks
What's sp ya? @@

【在 c**t 的大作中提到】
: Using sp.
: exec desiredsql tbname
: declare sql varchar(255)
: ..
: set @sql='select * from ' + @tbname
: execute (@sql)
: ..

c**t
发帖数: 2744
6
Stored Procedure

【在 p*******g 的大作中提到】
: Thanks
: What's sp ya? @@

1 (共1页)
进入Database版参与讨论
相关主题
how to compare two schemas to look for missing indices我这个数据库怎么办啊?
T-SQL 问题问一个db2的弱问题
create linked server problem, please helperror file或者exception file
a Store Procedure question...SQL debug step into a store procedure from another one (转载)
SQL Server 2005 Exec( )get value returned by SQLstored procedure from python (转载)
SQL Server 问题 -- 怎样 UPDADATE 才快run SQL stored procedure from python
SSIS package存放问题PB SQL语句的简单问题
[转载] 真的没有人懂 ORACLE pro*c阿? :((((how to do this Database operation as time
相关话题的讨论汇总
话题: sql话题: exec话题: dynamic话题: error话题: execute