admin管理员组

文章数量:1353400

I have a function called udf_unixtimestaptodatetime. based off of the unixtimestamp it will provide the associated date and time. the script works when placing in the unixdatetime (along with other variables required.

Query:

SELECT * 
FROM archive.udf_unixtimestamptodatetime(1742985568, 391);

Working Example

however when i attempt to replace the variables within the function (similar to MSSQL), I receive an error. It will not perform correctly:

Query:

SELECT archive.udf_unixtimestamptodatetime(createddate, lotteryfk)
FROM stage.ticketentry

Will not work when selected like this

In Postgresql, What would be the equivalent of:

Query:

SELECT archive.udf_unixtimestamptodatetime(createddate, lotteryfk)
FROM stage.ticketentry

In other words how do i assign the parameters for the function utilizing the columns from an existing table?

I need to be able to utilize the function to return the date for each column in table.

本文标签: postgresql passing results of function into another functionStack Overflow