YesQL/pgsql could not determine data type of parameter $1
So I just found the answer. The solution is to manually cast the parameter's type:
-- name: ip-addresses
SELECT ipo.ip_address_id::varchar as address, ipo.user_id
FROM ip_ownerships AS ipo
WHERE :uids::int IS NULL OR ipo.user_id IN (:uids)
Getting error could not determine data type of parameter $2 while putting $2 in CONCAT()
Turns out I can set the data type by doing the ::text after the paramterized value($1 in this case). Here's the solution code:
db.query(
`
UPDATE stories
SET story = CONCAT(story, $1::text)
WHERE id = $2;
`,
["testinggg", req.params.id]
)
Thanks for the help anyways!
PostgreSQL ERROR: could not determine data type of parameter Ruby exec_params
Simply:
WHERE labels ILIKE $1::text
I assume labels
is a plain character type like text
, too.
Spring Data query could not determine data type of UUID parameter
You can correct your query in the following way:
@Query("from Rental r where (cast(:userId as org.hibernate.type.UUIDCharType) IS NULL OR r.userId = :userId) AND (:status IS NULL OR r.status = :status)")
Page<Rental> findAllUsingFilterUserIdAndStatus(@Param("userId") UUID userId,
@Param("status") RentalStatus status,
Pageable pageable);
Related Topics
How to Retrieve Same Column Twice with Different Conditions in Same Table
SQL Query with Union in Doctrine Symfony
How to Store SQL Server Sort Order in a Variable
Query Records and Group by a Block of Time
Find the Maximum Consecutive Years for Each Id's in a Table(Oracle SQL)
SQL Function to Get Count of How Many Times String Appears in Column
SQL Scheduling - Select All Rooms Available for Given Date Range
Xml Query() Works, Value() Requires Singleton Found Xdt:Untypedatomic
How to Group by and Return Sum Row in Postgres
T-SQL Select Get All Months Within a Range of Years
Does the Order of Tables in a Join Matter, When Left (Outer) Joins Are Used
Range Wildcard Pattern Matching Behaviour with Case-Sensitive Collations
Odd SQL Server 2012 Identity Issue