In the provided code, an attempt is made to call the function FnUpdateSalegtab09. However, an error is encountered, indicating that the function does not exist or its argument types do not match the expected ones.
The error message suggests that the function name or the argument types might be incorrect. Let's investigate the possible causes.
The function signature for FnUpdateSalegtab09 specifies that several of its parameters are of type smallint. However, in the function call, these parameters are being passed as numeric literals, which are initially presumed to be of type integer.
This mismatch between the expected and actual types of the arguments can result in the error.
To resolve this issue, you need to explicitly cast the numeric literals to the correct type, smallint, before passing them to the function. You can achieve this by adding a type cast operator (::) to each literal, as shown below:
select FnUpdateSalegtab09( 4, 1, 0, 12, 1, '9'::varchar, '2014-07-15'::timestamp, 4048, '9'::varchar, 4048, 'MYCUSTOMER'::varchar, 12::money, 0, 0::money, 0.32, 185, 0, '2014-07-15 11:24:12 AM'::timestamp, 0, 0::money, 0, 0::money, 0::money, 0, 0::money, 0, 0::money, 0, 0::money, ''::varchar, 0::money, False, ''::varchar, '2014-07-15'::timestamp, ''::varchar, ''::varchar, False, ''::varchar, ''::varchar, 1, ''::varchar, 1, 0, 1, 0, 42 );
By adding the explicit type casts, you ensure that the argument types match the expectations of the function definition, and the function call should now execute without the "function ... does not exist" error.
The above is the detailed content of Why Does My SQL Function Call Fail with 'function ... does not exist' and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!