PB + ms SQL + trigger must note that pbsql
Note the following before using PB + ms SQL + triggers:
If the trigger has more than two returned values, for example, two update statements, it is misjudged that the data has changed and the disk is not saved successfully.
Tip:
Row changed between retrieve and update.
No changes made to database.
Therefore, ms SQL triggers must be processed as follows:
Trigger start adding:
If @ ROWCOUNT = 0 Return -- improves performance
Setnocount on -- no statistics are returned, which can reduce frequent network response and improve performance efficiency; Avoid misjudgment as data changes (sybase does not have such problems)
...
...
Termination plus:
Setnocount off
Whether triggers and stored procedures are used in databases developed by pb and SQL.
PB has never been used. It seems like a database development tool. It is a development tool. Instead of a tool, you can write programs based on SQL databases. Therefore, triggers and stored procedures are created in SQL.
PB cannot dynamically create SQL triggers with variables?
Messagebox ("", ls_mysql)
// After the prompt box is displayed, press ctrl + c to copy the prompt box content, and then press ctrl + v to query the analyzer to see if there is any problem.
Sqlto. autocommit = true
Execute Immediate: ls_ SQL;
If sqlto. sqlcode = 0 Then
Messagebox ("", "successful! ")
Else
Messagebox ("", "failed! "+ Sqlto. sqlerrtext)
End If
Sqlto. autocommit = false
If the prompt fails, check if the SQL script in PB is correct.
Sqlto. sqlerrtext what is the error prompt, and then the right remedy
If not, check whether the database has the permission to modify the trigger.
----------------------
+ "Select @ autoid = cast (rdrecords. autoid as varchar) from rdrecords, inserted where rdrecords. cdefine33 = cast (inserted. rdsid as varchar )"&
+ "Update purbillvouchs set purbillvouchs. rdsid = cast (@ autoid as int (4) from inserted
========================
In this case, there is no space in front of the update, and the spelling statement is definitely a problem !!!