Can base access user defined basic functions

Good Afternoon,

i have made a sample function in Basic

public Function CONSTANTTEXT(inp$) as String
	CONSTANTTEXT= "that is all"
end function

I have tried to run SQL like this:

select CONSTANTTEXT('FRIEND') FROM RDB$DATABASE

This resulted in an error. Is there a way to accomplish this task?

FYI I tried this in MsAccess and it worked.

Database knows nothing about Basic code. Might be it works in Access, but never when using a GUI, which connects to different datasources. Base has been created to connect to a database and the database only know of anything, which is saved inside the database: Tables, views, triggers …

1 Like

Several database engines (e.g. HSQL2) allow to define functions and procedures in SQL. And many years ago, I saw a Java extension which added functions to the embedded HSQL. I can’t find it right now, but I’m pretty sure, it was an OpenOffice extension by a Base developer.

1 Like

SELECT *, 'FRIEND' AS "Status" FROM "Database_Table"

1 Like