[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] sqlite3_get_table question
From:       Dan <danielk1977 () gmail ! com>
Date:       2008-12-29 4:20:58
Message-ID: 65FA0CC6-4248-4675-8100-F069423E0821 () gmail ! com
[Download RAW message or body]


On Dec 29, 2008, at 7:57 AM, schachtobi wrote:

> Hi,
>
> I retrieve data (1 row only) via the handy getTable function. Inside
> this row is one blob object with pixeldata.
>
> The size is:
> 256*256 Pixels with 3 bytes each
> -> 256*256*3 = 196608 Bytes
>
> select length(data) from ch;
>
> gives me exactly this number.
>
> No I try this:
>
> typedef struct
> {
> 	unsigned char red;
> 	unsigned char green;
> 	unsigned char blue;
> }Pixel;
>
> Pixel *dbData;
> Pixel *pSrcP;
>
> rc = sqlite3_get_table(db, cmd, &result,
> 	&nrow,
> 	&ncol,
> 	&zErrMsg
> 	);
>
> if(rc != SQLITE_OK || nrow!= 1 || zErrMsg!=NULL)
> {
> 	printf("Error in getting data from the db\n");
> 	return;
> }
> dbData = (Pixel *) result[ncol+2];

Why (ncol+2)?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic