Here is what the code does.  I set up the UDF after I open a file,
like this:
      � sqlite3_create_function( pDb, "format_time", -1,
SQLITE_UTF16, 0, format_time, 0, 0 );
The format_time function formats the time according to a template and
calls sqlite3_result_text16, like this:
      sqlite3_result_text16( context, pMem, nLen,
UdfCleanupCallback );
The memory is allocated to pMem and the text data copied into it. 
Then the function returns.  That's all.
One thing I noticed is that the nLen must be the number of bytes
allocated in pMem - not the number of wide chars in pMem.  This is
unexpected, since we're calling the wide char (*16) version of
sqlite3_result_text.

  Thanks for the help.

   Quoting John Stanton :

The problem appears to be in your function.  Post the code for it.

[EMAIL PROTECTED] wrote:

   I'm trying to get the concat operator to work with my
user-defined
function.  This works fine:

   SELECT UPPER(FirstName) || ' ' || UPPER(LastName) FROM 
Employees

   But this doesn't work:

   SELECT FORMAT_DATE(login_time) || ' ' ||
FORMAT_TIME(login_time)
FROM  Sessions

   I get only the formatted date - missing the formatted time.
FORMAT_DATE is my own user-defined function that returns text data
type.

   Can someone *please* check into this.  I must get this
working.

   Thank you
-brett



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to