Jump to content
Sign in to follow this  

SQLite Issue

Recommended Posts


Hello Iczer

I have a working program dealing with distances.
I added:

#include "sqlite_funcs.au3"

; *snip*

; Square distance between P(x,y) anq Q(x,y)
Func _dist2($pCtx, $iArgs, $pArgs)
    Local $Result = 0
    Local $aArgs = _SQLite_FuncArgs($iArgs, $pArgs), $Arg
    If UBound($aArgs) <> 4 Then Return
    Local $px = _SQLite_GetValue($aArgs[0])
    Local $py = _SQLite_GetValue($aArgs[1])
    Local $qx = _SQLite_GetValue($aArgs[2])
    Local $qy = _SQLite_GetValue($aArgs[3])
    $result = ($px-$qx)*($px-$qx) + ($py-$qy)*($py-$qy)
    ConsoleWrite("> Result: " & $result & @CRLF)

    _SQLite_ResultText($pCtx, $Result)
 Global $dllCb = _SQLite_FuncCallbackRegister("_dist2")
_SQLite_CreateFunction(-1, "dist2", -1, 0, 0, DllCallbackGetPtr($dllCb), 0, 0)

Then I reworked my SQL to use the new function:


SELECT dist2(R1.sx, R2.ex, R1.sy, R2.sy) AS sqd_distance ... ...

and finally got


!   SQLite.au3 Error
--> Function: _SQLite_Query
--> Query:    SELECT ...
--> Error:    no such function: dist2

The ConsoleWrite debug line doesn't show anything.

Is this UDF working anymore ?

Thanks for any help ^^

Share this post

Link to post
Share on other sites

@Apzo you hit the trifecta: resurrecting an old thread, which had nothing to do with your question, and in the wrong forum. I have moved this post to the appropriate forum; please think through where you're posting in the future.

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this