Please provide some hint.I have added some more details about function
definition & query.

/* Create function definition */
static void Test(sqlite3_context *context, int argc, sqlite3_value **argv)
{
    printf ("Trigger Function Called\n");
    if (argc == 1) {
        char *text = sqlite3_value_text(argv[0]);
        if (text && text[0]) {
          char result[2];
          result[0] = text[0]; result[1] = '\0';
          sqlite3_result_text(context, result, -1, SQLITE_TRANSIENT);
          return;
        }
    }
    sqlite3_result_null(context);
}
/*Create Function */
sqlite3_create_function(Handler, "Test",1, SQLITE_UTF8, NULL, &Test, NULL,
NULL);

/*Create Trigger Query */
create trigger TestTrigger after insert on dbTestTbl for each row begin
SELECT Test (new.RowId) from dbTestTbl; end;


On Fri, Oct 11, 2013 at 5:55 PM, techi eth <techi...@gmail.com> wrote:

> Please find below :
>
> #0  0x00007fffffffe0b8 in ?? ()
>
> #1  0x00007ffff76988f6 in ?? () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #2  0x00007ffff769e451 in sqlite3_step () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #3  0x00007ffff76a1e4c in sqlite3_exec () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #4  0x00007ffff78e1127 in SqliteTestInsert (SQLitePrivate=0x602300,
> TableName_p=0x4019a0 "dbTestTbl", DataInfoList=0x4)
>
> #5  0x0000000000400d58 in TEST_SqliteTestInsert (RowID=<optimized out>) at
> sqlite3_test.c:340
>
> #6  main (argc=<optimized out>, args=<optimized out>) at sqlite3_test.c:922
>
> Thanks
>
>
> On Fri, Oct 11, 2013 at 5:35 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>> On Fri, Oct 11, 2013 at 7:57 AM, techi eth <techi...@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I am getting segmentation fault while executing query in sqlite3. [Linux
>> > OS].
>> >
>>
>> Can you send us a stack trace?
>>
>>
>> >
>> > Find below sequence.
>> >
>> > // Getting SQLiteHandler
>> >
>> > OpenConnection ();
>> >
>> > //Creating user defined function “Test”
>> >
>> > sqlite3_create_function(SQLiteHandler, "Test",1, SQLITE_UTF8, NULL,
>> &Test,
>> > NULL, NULL)
>> >
>> > //Creating table,Below is DDL
>> >
>> > CREATE TABLE dbTestTbl (
>> >
>> >     RowID           INTEGER PRIMARY KEY AUTOINCREMENT,
>> >
>> >     ParamaterID     INTEGER,
>> >
>> >     ParamaterValue  TEXT
>> >
>> > );
>> >
>> > //Createatd Trigger,Below is DDL
>> >
>> > CREATE TRIGGER TestTrigger
>> >
>> >        AFTER INSERT ON dbTestTbl
>> >
>> >        FOR EACH ROW
>> >
>> > BEGIN
>> >
>> >     SELECT Test( RowID )
>> >
>> >       FROM dbTestTbl;
>> >
>> > END;
>> >
>> > // INSERT INTO dbTestTbl
>> >
>> > Please suggest what is wrong defined here.
>> >
>> > Thanks
>> > _______________________________________________
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>>
>>
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> _______________________________________________
>> 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

Reply via email to