postgresql - dblink_build_sql_delete . I need to be able to delete the data with <= condition -


select xyz.* public.dblink ('dbname=livedb port=5432 host=127.0.0.1 user=postgres  password=root','select dblink_build_sql_delete(''"folderstatus"'', ''1'', 1,  ''{"1"}'')') xyz (id int);  error:  invalid input syntax integer: "delete folderstatuslu  id = '1'" 

i'm unable delete record here. need know how add "<=" condition , need pass parameter. code this, i'll selecting max(colum_value) variable , pass above query , should able delete below.

delete folderstatuslu id <= '1'  --> (in place of 1,  pass variable.) 

appreciate help.

why not dblink , format?..

t=# create table so43 (i int); create table t=# insert so43 select 1; insert 0 1 t=# select * dblink('dbname = t',format('delete so43 <= %s',1)) row(result text);   result ----------  delete 1 (1 row) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -