经过一番研究,我编辑了我的答案。
关于EXECUTE (string-expression)
声明,是的,您必须为字符串表达式使用单引号而不是双引号。 This页提到:
It lets you execute dynamically prepared statements, such as statements that are constructed using the parameters passed in to a procedure. Literal strings in the statement must be enclosed in single quotes, and the statement must be on a single line.
这将消除列没有发现错误,但过程将返回此其他错误:试图执行仅此语句时
Result set not permitted in '<batch statement>'
同样的错误返回:
execute ('select * from sysusers')
With probable cause:
You attempted to execute a SELECT statement in a context where a result set is not permitted.
看到我最近的解决方案的答案。
和关于架构,这里是如何引用对象:
It is always good practice to refer to database objects by a schema name and the object name, separated by a period (.). For a complete example, to SELECT records from the Employee table in the HumanResources schema of the current database would look like:
SELECT * FROM HumanResources.Employee
To reference an object located in a remote database, the fully qualified object name includes the server name and the database name. For example, to SELECT records from the Employee table in the HumanResources schema in the AdventureWorks database on MyServer would look like:
SELECT * FROM MyServer.AdventureWorks.HumanResources.Employee
我测试了在SQL Anywhere中12和它的工作原理是相同的。虽然我不熟悉的模式,就是我建议你下面是实际使用的模式,会的dbowner是架构名称:
1)select * from dbname.dbowner.tablename
2)select * from dbowner.tablename
3)select * from dbname..tablename
(假设表中dbo
模式存在)
底线....在SELECT语句cds.ppl
必须是一个名为在cds
模式中创建ppl
表。
或者,如果cds
是你的数据库名称和dbo
模式中创建ppl
你的表名,你缺少一个点:
select * from cds..ppl
无论你写在from必须是数据库中的对象之后,表或视图以及表/视图名称之间不能有一个点。什么是cds.ppl? – 2012-04-19 18:14:18