Home > database >  Inside the trigger function implementation into modified string, but can only insert or modify the v
Inside the trigger function implementation into modified string, but can only insert or modify the v

Time:10-11

Inside the trigger function implementation into modified string, but can only insert or modify the value, cannot be inserted into the string,

Ttt1='insert into table_test (select * from' | | TG_TABLE_NAME | | 'WHERE tag_1=(select Max (tag_1)
The FROM '| | TG_TABLE_NAME | |')) ON another (tag_1) DO the UPDATE SET tag_20=98989; ';

The EXECUTE ttt1; (normal execution modified insert 98989)

Ttt2='insert into table_test (select * from' | | TG_TABLE_NAME | | 'WHERE tag_1=(select Max (tag_1)
The FROM '| | TG_TABLE_NAME | |')) ON another (tag_1) DO the UPDATE SET tag_20='| | test | |. ';

The EXECUTE ttt2; (suggest there is no field test, can't execute)

Which ace warrior guidance, the database version is PG11 version, two scripts in addition to a string and the number of different other, want to achieve without the inserts have to modify a string,

CodePudding user response:

What is the test variables? If it is a constant, put in single quotes, please

CodePudding user response:

The
reference 1/f, trainee response:
what is the test variables? If it is a constant, please add quotes


Tag_20='| |' test '| |'. ';

Add the quotes the same tip

(Reason: 'error: field "test" does not exist; Error while executing the query ').

CodePudding user response:

Are you want to test the input string constants?

| | ')) ON another (tag_1) DO the UPDATE SET tag_20=$$$$' test

CodePudding user response:

Didn't understand demand, if you want to restrain a varchar column allows only insert Numbers, set up a check
  • Related