Skip to content
Advertisement

ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation: ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation:

my Stored procedure

CREATE OR REPLACE PROCEDURE public.transfer_transactions( initiated_by integer, OUT transaction integer) LANGUAGE ‘plpgsql’ AS $BODY$

    SELECT transaction_id INTO transaction
    FROM public."Transaction" 
    where initiated_by = initiated_by;

    SELECT transaction INTO transaction;

end; 

$BODY$;

Calling the sp from nestjs prisma client

async create(createTransactionDto: CreateTransactionDto) {

const [callGetSequenceBlock, queryString] = await this.prisma.$transaction([ this.prisma.$executeRawCALL transfer_transactions(${login_id},@transaction);, this.prisma.$queryRawSELECT @transaction FROM DUAL;, ]);

  return queryString;

}

error displayed while executing API

Invalid prisma.executeRaw() invocation:

Raw query failed. Code: 42703. Message: column "transaction_idout" does not exist

Advertisement

Answer

I tried to use the query raw, its function

const result: procedureResult = await this.prisma .$queryRawCALL transfer_transactions( ${ct.initiated_by} );

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement