我新来张贴gres 并跟随动态查询运行
EXECUTE Select * from products ;
我得到以下回应。
ERROR: syntax error at or near " Select * from products "
LINE 1: EXECUTE Select * from products ;
我知道这是我缺少的基本东西
我新来张贴gres 并跟随动态查询运行
EXECUTE Select * from products ;
我得到以下回应。
ERROR: syntax error at or near " Select * from products "
LINE 1: EXECUTE Select * from products ;
我知道这是我缺少的基本东西
有 < deco> EXECUTE 语句 < strong> plpgsql strong>, 这将做你想做的事 - 执行 SQL 查询字符串 。 您标记了 < a href="/ questions/ ttract/ directive" 类 = “ post-tag” 标题 = “ 显示标有动态“ rel=“ tag” > 动力 , 所以这可能是您正在寻找的问题 。
只工作在 plpgsql 函数或 < a href=' http://www. postgresql.org/docs/put/interactive/sql-do.html" rel= "nofollow"\ code > DO (匿名代码区块) 。 < a href=> http://www.postgresql.org/docs/putive/interactive/plpgsql-statements.html#PLPLPGSQL-STATINGS-EXECUTING-DYN" rel="nofol" > 。
Note: The PL/pgSQL
EXECUTE
statement is not related to theEXECUTE
SQL statement supported by the PostgreSQL server. The server sEXECUTE
statement cannot be used directly within PL/pgSQL functions (and is not needed).
如果您想要按您的例子从动态 SELECT
查询返回值, 您需要创建函数 。 DO
语句总是返回 evue
. 。 http://www. pagegresql. org/docs/ pext/interactive/ plpgsql- control- structs. html# PLPGSQL- StatAments- RETNING” rel=“ nofollow” > 有关从非常精细的手册中的函数返回值的 More 。 a>
http://www.postagresql.org/docs/current/interactive/sql-execute.html" rel=“no follow” >fine 手册:
<强度 > 简要说明 强>
EXECUTE name [ ( parameter [, ...] ) ]
<强 > 描述 强>
EXECUTE
用于执行先前准备的声明。
所以 EXECUTE
不执行 SQL 的字符串, 它执行一份以名称标明的预写声明, 您需要使用 < a href=" http:// www. plasgresql. org/docs/ p流/ interactive/ sql- prepare. html", rel=“ nofollow” 单独编写声明 。
=> prepare stmt as select * from products;
=> execute stmt;
-- "select * from products" output goes here...
我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。
On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...
I ll take the simplest of the SQL functions as an example: CREATE OR REPLACE FUNCTION skater_name_match(INTEGER,VARCHAR) RETURNS BOOL AS $$ SELECT $1 IN (SELECT skaters_skater.competitor_ptr_id ...
I m 在当地网络上运行几台机器,在Salgresql8.3处撰写一份申请。
I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.
Hey, I have 2 tables in PostgreSql: 1 - documents: id, title 2 - updates: id, document_id, date and some data: documents: | 1 | Test Title | updates: | 1 | 1 | 2006-01-01 | | 2 | 1 | 2007-01-01 |...
I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...
I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...