Re: insert in stored procedure
Posted in 1999
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Platform-Specific Issues
Hagen
I got the same error when I tried to run your SP like so:
select sqtest() from systables where tabid = 99;
but it ran fine when I tried
execute procedure sqtest();What -675 is trying to tell you is that you cant call a SP that does DML
(insert/update/delete) using a SELECT call.
HTH
Sujit
dhagen1065@my-deja.com on 07/02/99 10:39:40 AM
Please respond to dhagen1065@my-deja.com
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: insert in stored procedure
I try to make a stored procedure with an insert-statement:
CREATE PROCEDURE sqtest ()
RETURNING INTEGER; DEFINE int_t INTEGER;
SET DEBUG FILE TO "/tmp/debug.log";
TRACE ON;
Insert INTO seq1(dummy) VALUES ('1'); LET int_t = DBINFO('sqlca.sqlerrd1');
RETURN int_t;
END PROCEDURE
The table seq1 contains only 2 rows:
'key' as serial
'dummy' as CHAR(1)
If I call the procedure, I get
675: Illegal SQL statement in stored procedure.
the debugfile says:
insert into seq1(dummy)
values ("1");exception : looking for handler
SQL error = -675 ISAM error = 0 error string = = ""exception : no appropriate handler
I don' know, what's wrong :-(
I use Informix Dynamic Server, Linux Edition 7.30.UC7
Hagen
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Hi,
If you try to execute this procedure in SELECT statemant, you must
know
that this is not allowed in Informix, because this stored procedures
has
update, delete or insert SQL in body.
execute procedure sqtest (); -- thisis OK
select sqtest () from table_name; - this is not OK it's just allowed
for SP with only SELECT SQL
Matej
In article
<7lj8d5$192$1@news.xmission.com>,
Sujit.Pal@BankAmerica.com wrote:
>
>
>
Hagen
>
> I got the same error when I tried to run your SP like so:
>
select sqtest() from systables where tabid = 99;
> but it ran fine when I
tried
> execute procedure sqtest();> What -675 is trying to tell you is
that you cant call a SP that does DML
> (insert/update/delete) using a SELECT
call.
>
> HTH
> Sujit
>
> dhagen1065@my-deja.com on 07/02/99 10:39:40 AM
>
> Please respond to dhagen1065@my-deja.com
>
> To: informix-list@iiug.org
>
cc: (bcc: Sujit Pal)
> Subject: insert in stored procedure
>
> I try to
make a stored procedure with an insert-statement:
>
> CREATE PROCEDURE
sqtest ()
> RETURNING INTEGER;
> DEFINE int_t INTEGER;
> SET DEBUG FILE TO
"/tmp/debug.log";
> TRACE ON;
> Insert INTO seq1(dummy) VALUES ('1');>
LET int_t = DBINFO('sqlca.sqlerrd1');
> RETURN int_t;
> END PROCEDURE
>
>
The table seq1 contains only 2 rows:
> 'key' as serial
> 'dummy' as CHAR(1)
>
> If I call the procedure, I get
> 675: Illegal SQL statement in stored
procedure.>
> the debugfile says:
> insert into seq1(dummy)
> values
("1");> exception : looking for handler
> SQL error = -675 ISAM error = 0
error string = = ""> exception : no appropriate handler
>
> I don' know,
what's wrong :-(
>
> I use Informix Dynamic Server, Linux Edition 7.30.UC7
>
> Hagen
>
> Sent via Deja.com http://www.deja.com/
> Share what you know.
Learn what you don't.
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.