Subject Conversion error from string
Author Constantijn Wolfs
Hi,

A trigger executes a stored procedure. One of the input parameters is of
type varchar.

EXECUTE PROCEDURE CWS$GET_ID(NEW.ID, 'ENTITIES')
RETURNING VALUES NEW.ID

gives an error ISC 335544334: conversion error from string "ENTITIES"

Fb 1.5.1., default character set UNICODE_FSS

The trigger:

CREATE TRIGGER UPD_ENTITY FOR ENTITIES
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
begin
.
.
.
.
IF (INSERTING) THEN
/* Get a permanent ID. */
EXECUTE PROCEDURE CWS$GET_ID(NEW.ID, 'ENTITIES')
RETURNING_VALUES NEW.ID;
ELSE IF (UPDATING) THEN
/* Set update date. */
NEW.DTU = 'NOW';
end

The sp:

CREATE PROCEDURE CWS$GET_ID (
TESTID INTEGER,
TABLENAME VARCHAR(31))
RETURNS (
ID INTEGER)
AS
begin
IF ((TESTID IS NULL) OR (TESTID = 0)) THEN
ID = Gen_ID(GENCOID, -1);
.
.
.
.
.
ELSE
ID = TESTID;
end

TIA,
Constantijn