Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 在plpgsql函数中对值使用单引号_Postgresql_Plpgsql_Postgresql 9.3 - Fatal编程技术网

Postgresql 在plpgsql函数中对值使用单引号

Postgresql 在plpgsql函数中对值使用单引号,postgresql,plpgsql,postgresql-9.3,Postgresql,Plpgsql,Postgresql 9.3,我有一个postgresql函数,它接受4个参数 CREATE OR REPLACE FUNCTION public.manual_table_parsing_monthly_custom_edits( schema_name text, main_permit text, manual_table text, permit_num text) RETURNS void AS $BODY$ DECLARE e record; load_move_count double prec

我有一个postgresql函数,它接受4个参数

CREATE OR REPLACE FUNCTION public.manual_table_parsing_monthly_custom_edits(
schema_name text,
main_permit text,
manual_table text,
permit_num text)
RETURNS void AS
$BODY$
DECLARE
    e record;
    load_move_count double precision;
BEGIN
  EXECUTE format('Insert into %I.%I(permit_date,permit_number,year,month_number,
    report_permit_date,job_category,address,legal_description,neighbourhood,neighbourhood_number,
    job_description,work_type,floor_area,construction_value,zoning,units_added,
    latitude,longitude,location,count,building_type,building_type_number,filter,community,
    groups,plan,block,lot,unit_id,dwelling,condo_fh,developer,builder,unit_address,construction_type,geom)
            select permit_date,permit_number,year,month_number,
    report_permit_date,job_category,address,legal_description,neighbourhood,neighbourhood_number,
    job_description,work_type,floor_area,construction_value,zoning,units_added,
    latitude,longitude,location,count,building_type,building_type_number,filter,community,
    groups,plan,block,lot,unit_id,dwelling,condo_fh,developer,builder,unit_address,construction_type,geom
from %I.%I
where flag like ''move'' or flag like ''load'' and permit_number 
=%I',schema_name,main_permit,schema_name,manual_table,permit_number);
函数中的最后一个参数permit_number,在where语句中使用,该参数不引发任何列“yyyy”错误。这是因为%I采用双引号内的值。我应该如何编辑,以便根据
将值放在单引号内应将%i
用于标识符,将
%L
用于文字值

还应使用
$
引用,以便于阅读函数