Hello everyone, In codeigniter 3.1.0, using the pg_query tool, I call the PostgreSQL 9.3 function
updateProduct( 0, 'Title text...', 'A', 'abr001', 1, 74.29, 53.81, 0, ' short description text...', ' description text...', 1 ) And I get the error:
Message: pg_query(): Query failed: ERROR: function updateproduct(integer, unknown, unknown, unknown, integer, numeric, numeric, integer, unknown, unknown, integer) does not exist LINE 1: select * from updateProduct( 0, 'Title text...', 'A', 'abr0... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. And it is not clear why a bunch of unknowns ... The function is defined as:
drop function if exists updateProduct(); create or replace function updateProduct( p_id integer, p_title varchar(100), p_status Type_ProductStatus, p_sku varchar(100), p_user_id smallint, p_regular_price Type_Money, p_sale_price Type_Money, p_in_stock boolean, p_short_description varchar(255), p_description TEXT, p_has_attributes boolean ) returns int as $function$ declare r product%rowtype; begin ... end $function$ language 'plpgsql'; Also identified are 2 types I specified in the function definition:
CREATE TYPE Type_ProductStatus AS ENUM ( 'A', 'I', 'D', '-' ); CREATE DOMAIN Type_Money AS numeric(10, 2) CHECK (VALUE >= 0.); I know that to bring tapov use
cast(? As varchar) What is the right way then ?
Thank!