Solutions to problems when VC programs access the stored procedures of Oracle databases

Source: Internet
Author: User

AccessOracle DatabaseOfStored ProcedureThe following error occurs: When the stored procedure is called in the script, if exec mysp is used, "invalid character" is reported "; if {call mysp} is used, a "cursor error" is reported. It is strange that a platform program of an old version can be used to complete the call with {call mysp.

Troubleshooting:

When accessing the database interface, the se program only distinguishes the statements starting with select from those starting with select. All statements starting with 'select' are processed using the odbc CDatabase: ExecuteSQL function. For statements starting with 'select', use CRecordSet: Open for processing. Therefore, the {call mysp} statement is handled using CDatabase: ExecuteSQL, and there is no problem.

The new version of se uses CRecordSet: Open to process the return of call mysp. This is no problem in Microsoft SqlServer, but it won't work in Oracle.

Solution:

When connecting to the oracle database, statements such as call mysp cannot be processed using crecordset: open, but can only be processed using cdatabase: executesql.

Note:Exec mysp can only be used in the database server's own client, such as the Enterprise Manager of sqlserver or the SQL plus of oracle, and cannot be used in the c Voice interface. Call mysp can be used in any scenario.

The reason for accessing the Oracle database stored procedure in a program developed by VC and the solution are described here. If you want to know

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.