Hi,
I'm an absolute newbie in triggers and stored procedures. I want to try the sample from the documentation but the sample shows the error "Error: 09938 PRS IPS Procedure section (name) expected".
SQLBase 12.1
Any hints are welcome
Ewald
CREATE TABLE PRESIDENT
(PRES_NAME varchar(20) not null,
BIRTH_DATE date,
YRS_SERV integer,
DEATH_AGE integer,
PARTY varchar (20),
STATE_BORN varchar(20));
CREATE TABLE ELECTION
(ELECTION_YEAR smallint,
CANDIDATE varchar(20),
VOTES float,
WINNER_LOSER_INDIC char(1));
CREATE TRIGGER TRG_NEWPRES
after insert on SYSADM.PRESIDENT
(execute inline (1792,'Jefferson T',4,'L')
PROCEDURE: PROC_NEWPRES static
Parameters
Number: nElecYear
String: sCandidate
Number: nVotes
String: sWinLose
Local Variables
Sql Handle: hSqlCur
Actions
On Procedure Startup
Call SqlConnect(hSqlCur)
Call SqlPrepare(hSqlCur, 'Insert into \
sysadm.election values \
(:nElecYear, :sCandidate, :nVotes, :sWinLose)')
On Procedure Execute
Call SqlExecute(hSqlCur)
On Procedure Close
Call SqlDisconnect(hSqlCur)
)
for each statement;
Trigger Question
-
- Site Admin
- Posts: 442
- Joined: 05 Mar 2017, 20:57
- Location: Stroud, England <--> Tauranga, New Zealand
Re: Trigger Question
.
Its all about the indentation.
The Trigger and Proc compile fine once you get the indentation correct :
Its a lot easier to use SqlCommand Centre sbccntr.exe to format your Script, rather than SQLTalk.
SQLBase will come up with any weird and wonderful errors when 99% of the time - its the indentation which has to be spot-on.
The following complies, and the only change I made was the indents.:
Its all about the indentation.
The Trigger and Proc compile fine once you get the indentation correct :
Its a lot easier to use SqlCommand Centre sbccntr.exe to format your Script, rather than SQLTalk.
SQLBase will come up with any weird and wonderful errors when 99% of the time - its the indentation which has to be spot-on.
The following complies, and the only change I made was the indents.:
You do not have the required permissions to view the files attached to this post.
Greetings from New Zealand
Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk
Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk
Who is online
Users browsing this forum: [Ccbot] and 0 guests