Reputation: 2935
Hi i need to replace value into null value in plpython, but how can i do that?Can somebody help?
for example inside plpython sql i wrote.
aa = 'World 123'
bb = aa.replace('World ', '')
rv = plpy.execute("SELECT id FROM ABC WHERE name ilike '" + bb + "';" )
But it doesnot work;
if i use replace (aa,'')
, it shows error like, no global replace is defined..
Upvotes: 0
Views: 329
Reputation: 546
replace
is in the string namespace, so it can only be called on strings. Calling replace in the global namespace would not make much sense as you are not providing it with the original text upon which to perform the replacement.
Upvotes: 1