Home > OS >  ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation: ERROR [ExceptionsHandler] Invali
ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation: ERROR [ExceptionsHandler] Invali

Time:03-15

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

CodePudding user response:

I tried to use the query raw, its function

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

  • Related