Re: [sqlite] INSERT INTO and Hexadecimal Literals
Igor Tandetnik wrote: > No, there's no syntax for integral hexadecimal literals. There is a blob > literal x'B4', but it doesn't behave like a number (e.g. you can't > do arithmetic on blobs). Bottom line, the only option is to use plain > vanilla decimal numbers. > Thanks for the response, Igor. That tells me what I need. Regards, Ben > Ben Atkinson wrote: > > Sorry for the newbie SQL question. I'm trying to use the INSERT INTO > > statement with a hexadecimal literal. I want to accomplish something > > like this: > > > > INSERT INTO TruckDefaultsTable VALUES ( 'AirPressureTime', 0, > > 0xB4); > > > > Does SQL have a hex literal sequence that serves the same role as > > "0x" in C? > > No, there's no syntax for integral hexadecimal literals. There is a blob > literal x'B4', but it doesn't behave like a number (e.g. you can't > do arithmetic on blobs). Bottom line, the only option is to use plain > vanilla decimal numbers. > > > I could express the value in decimal as 11796480, but that's pretty > > awkward since the actual value I'm putting into the table is a Linux > > timeval structure. It just makes more sense as hex. > > How come you need to type these timestamps in by hand? When you work > with SQLite programmatically, you just use int variables and such - > there's almost never a need to represent the number as string, whether > decimal or hex. > > Igor Tandetnik > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] INSERT INTO and Hexadecimal Literals
Sorry for the newbie SQL question. I'm trying to use the INSERT INTO statement with a hexadecimal literal. I want to accomplish something like this: INSERT INTO TruckDefaultsTable VALUES ( 'AirPressureTime', 0, 0xB4); sqlite chokes on the 0xB4 expression with: unrecognized token: "0xB4" I could express the value in decimal as 11796480, but that's pretty awkward since the actual value I'm putting into the table is a Linux timeval structure. It just makes more sense as hex. Does SQL have a hex literal sequence that serves the same role as "0x" in C? Thanks for any help. Ben ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Cross-Compile and Installation of Sqlite
On Thu, June 25, 2009 at 4:46 PM, Matthew L. Creech wrote: > cd /path/to/sqlite-3.6.15 > ./configure --prefix=/my/target/rootfs --host=arm-unknown-linux-gnueabi > make install > Thanks for the help. Matthew. That was exactly what I needed. With the configure --prefix option , the subsequent "make install" put the installation bin, include, and lib directories in a directory on my Ubuntu host where I could zip them up, and transfer them to /usr/local on my embedded target. Regards, Ben > On Thu, Jun 25, 2009 at 4:23 PM, Ben Atkinsonwrote: > > > > I have an embedded Linux ARM target and wish to run sqlite on it. I > successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and now I'm > ready to install sqlite3, its libraries, and headers on my target system. > > > > I originally tried compiling sqlite on my embedded target system. Because > > it > has only a flash file system, and there is no swap area, gcc fails because it > runs out of memory. > > > > I tried zipping up the cross-compiled sqlite-3.6.15 directory from my x86 > > host > into a tar.gz file, downloading it to my target, unzipping it, then running > "make install". Because the config files and the Makefile have all of the > arm-unknown-linux-gnueabi cross-compiler references to gcc, this doesn't > match > the actual configuration on my embedded target, and the make fails. > > > > Before I start hacking into the sqlite config and Makefiles on my embedded > target, has someone already been through this and perhaps has a "howto"? Is > there already a recipe in the Makefile for this? > > > > SQLite isn't much different than any other autotools-based package in > this regard. If you're wanting to do a firmware build, and include > the SQLite pieces in their correct location in your target root > filesystem, you can just do something like: > > cd /path/to/sqlite-3.6.15 > ./configure --prefix=/my/target/rootfs --host=arm-unknown-linux-gnueabi > make install > > If all you want is to run the sqlite3 executable, though, you can just > take the cross-compiled binary + shared-lib and throw them onto the > target. Note that you'll need to set LD_LIBRARY_PATH when running > "sqlite3" to prevent it from complaining about missing libraries, > unless /lib is writable on your target. > > -- > Matthew L. Creech > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Cross-Compile and Installation of Sqlite
> On Jun 25, 2009, at 4:23 PM, Ben Atkinson wrote: >> >> I have an embedded Linux ARM target and wish to run sqlite on it. I >> successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and >> now I'm ready to install sqlite3, its libraries, and headers on my >> target system. >> >> I originally tried compiling sqlite on my embedded target system. >> Because it has only a flash file system, and there is no swap area, >> gcc fails because it runs out of memory. >> >> I tried zipping up the cross-compiled sqlite-3.6.15 directory from >> my x86 host into a tar.gz file, downloading it to my target, >> unzipping it, then running "make install". Because the config files >> and the Makefile have all of the arm-unknown-linux-gnueabi cross- >> compiler references to gcc, this doesn't match the actual >> configuration on my embedded target, and the make fails. >> >> Before I start hacking into the sqlite config and Makefiles on my >> embedded target, has someone already been through this and perhaps >> has a "howto"? Is there already a recipe in the Makefile for this? >> On Jun 25, 2009, at 4:27 PM, D. Richard Hipp wrote: > What are you trying to install? The command-line shell? A shared > library? If the latter, why do you need or want a shared library on > your embedded system. Are aware that the command-line shell is a > single stand-alone binary with no dependencies other than libc? I will be writing a C/C++ program that will use sqlite for data storage, so I will need the headers and shared library to link sqlite into my program. I also want to use the sqlite executable to examine the database from the command line. > Are you using the amalgamation tarball? Or the separate source files > tarball? I'm using the amalgamation tarball. Regards, Ben ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Cross-Compile and Installation of Sqlite
I have an embedded Linux ARM target and wish to run sqlite on it. I successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and now I'm ready to install sqlite3, its libraries, and headers on my target system. I originally tried compiling sqlite on my embedded target system. Because it has only a flash file system, and there is no swap area, gcc fails because it runs out of memory. I tried zipping up the cross-compiled sqlite-3.6.15 directory from my x86 host into a tar.gz file, downloading it to my target, unzipping it, then running "make install". Because the config files and the Makefile have all of the arm-unknown-linux-gnueabi cross-compiler references to gcc, this doesn't match the actual configuration on my embedded target, and the make fails. Before I start hacking into the sqlite config and Makefiles on my embedded target, has someone already been through this and perhaps has a "howto"? Is there already a recipe in the Makefile for this? Regards, Ben ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users