Stored procedures how to ?

comp.databases.gupta (1995-2015)
augustose

Stored procedures how to ?

Post by augustose » 25 Apr 2006, 17:00

 Posted by:  augustose <Augu...@gmail.com> 

Hi, I'm newbie with Gupta and SAL, and I need to create some stored
procedures.
Perhaps some one can help me with this issue.
The objectives of my procedures are:
- return a set of multi-fields records
- create data inside the procedure, not exactly from the tables.

I need some tips to use SQL Console and SQL Talk ( I already
downloaded WinSQL

I' trying with this procedure

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
PREPARE
PROCEDURE: PART_INPROC
Parameters
String: sName
Receive Number: nStock
Local Variables
Sql Handle: hSqlCur1
String: sSelect
Number: nInd
Actions
On Procedure Startup
Call SqlConnect(hSqlCur1)
Set sSelect = 'Select QTY_ON_HAND from PART
where DESCRIPTION = :sName into :nStock'
Call SqlPrepare(hSqlCur1, sSelect)
On Procedure Execute
Call SqlExecute(hSqlCur1)
On Procedure Fetch
If NOT SqlFetchNext(hSqlCur1, nInd)
Return 1
Else
Return 0
On Procedure Close
Call SqlDisconnect(hSqlCur1)
;

if I call the
perform PART_INPROC;
the SQLTalk gives me the form to enter the parameters. and after put
the parameter, It gives me no result

if I use
perform PART_INPROC

'STAINLESS STEEL',0,
/;
or
perform PART_INPROC

STAINLESS STEEL,,
/;
or
perform PART_INPROC

STAINLESS STEEL,0,
/;


it Gives me the same message
Data not specified for all columns in the last row.


thanks in advance for any help

Augusto

Return to “comp.databases.gupta”

Who is online

Users browsing this forum: [Ccbot] and 0 guests