0

In SQLiteStudio 3.3.3 I created a function. How can I print parameter args1's value in the area "Function implementation code"?

enter image description here

Error:

No such column: arg1

user4157124
  • 2,809
  • 13
  • 27
  • 42
megaultron
  • 399
  • 2
  • 15
  • SQLite doesn't support user-functions: https://stackoverflow.com/questions/2108870/how-to-create-custom-functions-in-sqlite - SqliteStudio fakes it by using its own Sqlite Extension, which means you can't necessarily use the functions you define in application/library code unless you also load the same extension there, which may be impossible in some cases (e.g. when targeting iOS, I assume). – Dai Nov 12 '22 at 22:17
  • @Dai Okay, so why do we have the Input arguments field? – megaultron Nov 12 '22 at 22:19
  • Because you **can** define and use functions within SqliteStudio - just not necessarily in your user-facing applications (which would use SQLite without SqliteStudio's functions-support extension). I don't know if that's what you want though. – Dai Nov 12 '22 at 22:19
  • yes this is what i want – megaultron Nov 12 '22 at 22:21
  • Haven'tt you read SqliteStudio's [documentation - it's right there](https://github.com/pawelsalawa/sqlitestudio/wiki/User_Manual#custom-sql-functions)? (note the boldtext warning at the bottom: _"Custom SQL functions created in SQLiteStudio exist only in context of SQLiteStudio. Functions are not persisted in database, it's just not how SQLite databases work. If you want to use some function in your own application, you have to register that function in SQLite from your application."_) – Dai Nov 12 '22 at 22:21
  • yes, but I didn't see an example of how to create a function with a parameter, just the use of the function. Correct me if I'm wrong https://github.com/pawelsalawa/sqlitestudio/wiki/User_Manual#custom-sql-functions – megaultron Nov 12 '22 at 22:23
  • Version 3.3.x of SQLiteStudio did not handle names of declared function arguments, only in upcoming 3.4.0 version it is handled as expected. In 3.3 you should `SELECT ?` to use 1st argument and use subsequent `?` marks for subsequent parameters from function. – Googie Nov 13 '22 at 10:16
  • Also please note, that SQLiteStudio is actively supported on its "GitHub Discussions" page. – Googie Nov 13 '22 at 10:19

0 Answers0