Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Posts
    25

    Unanswered: calling pervasive sql stored proedures from clarion

    hi guys
    i am trying to convert my clarion files (tps) to pervasive sql v8
    can any clarion and pervasive sql user help me on how
    1) pass parameters to my pervasive sql server
    2) use the parameters passed to call my stored procedures

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    1. WHat parameters do you want to pass to the Pervasive server?
    2. Stored Procedures are only available through a relational interface. You would need to use ODBC, OLEDB, PvQUery (in PDAC through Delphi or C++ Builder), or the ADO.NET Managed Provider. You cannot call a stored procedure from a Btrieve (transactional) application.

    The syntax to execute a Stored Procedure is: call spName(<parameters>)
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Feb 2005
    Posts
    25
    Quote Originally Posted by Nii
    hi guys
    i am trying to convert my clarion files (tps) to pervasive sql v8
    can any clarion and pervasive sql user help me on how
    1) pass parameters to my pervasive sql server
    2) use the parameters passed to call my stored procedures
    the ff is an example of my procedure

    create procedure Balance(In :Codeno integer);
    begin
    insert into multistatment ( dated, code, debit, credit, narration)
    select (dated, code, 0, deposit, narration )
    from receeipt as REC
    where REC.code = :Codeno
    end
    my question is how do i pass a memory variable from clarion to the above stored procedure?

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    That would be a Clarion syntax question. As far as how you would do it in say VB it would be something like:
    Code:
    Dim Conn As New ADODB.Connection
    Dim RS As ADODB.Recordset
    Conn.Open "DSN=DEMODATA", user, Password
    Set RS = New ADODB.Recordset
    Dim CodeNo As Integer
    CodeNo = 123
    sSQL = "call Balance(" & CodeNo & ")"
    Set RS = Conn.Execute(sSQL)
    I didn't test this code, it's pulled from an exisiting code base I have with modifications for your case.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •