If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > calling pervasive sql stored proedures from clarion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-05, 08:49
Nii Nii is offline
Registered User
 
Join Date: Feb 2005
Posts: 25
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
Reply With Quote
  #2 (permalink)  
Old 02-22-05, 10:40
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #3 (permalink)  
Old 02-22-05, 12:47
Nii Nii is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 02-22-05, 16:15
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On