PB + ms SQL + trigger must note that pbsql

Source: Internet
Author: User

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 !!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.