[sqlite] Editing SQL commands in sqlite3

2011-07-28 Thread km4hr
Is it possible to edit commands entered on the sqlite3 command line?
 

 


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


[sqlite] Editing sqlite3 commands

2011-07-28 Thread km4hr

Is there a way to edit SQL commands typed in on the command line? 
-- 
View this message in context: 
http://old.nabble.com/Editing-sqlite3-commands-tp32158636p32158636.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] My HPUX Notes

2007-05-10 Thread km4hr


Essien Essien wrote:
> 
> that was really funny you know :)

Always a pleasure to provide entertainment for my friends.

> 
> On POSIX systems you're supposed to do three things to get your
> software installed (usually a standard set of three commands).
> 
> 1. ./configure (some packages leave this out, since they don't use GNU
> autotools)
> 2. make (there's almost always this, or an alternative, CMAKE, Scons, ant,
> etc)
> 3. make install (if there's a Makefile, you'll be able to do a make
> install, if the software is supposed to be used anyways... and all
> replacements have equivalents - ant deploy for instance).
>

I did try your method. These are the same steps given in the sqlite README
file. I've used them before in other installations. But they didn't work for
me in this case. Here's the directions from the sqlite README file. 

tar xzf sqlite.tar.gz;#  Unpack the source tree into "sqlite"
mkdir bld;#  Build will occur in a sibling directory
cd bld   ;#  Change to the build directory
../sqlite/configure  ;#  Run the configure script
make ;#  Run the makefile.
make install ;#  (Optional) Install the build products

I performed the above steps as stated. But they failed on my HPUX 11.0 box.
First, the "make" step fails immediately as I explained earlier. The README
file doesn't explain that HP's "make" won't work and that you have to use
the GNU "make" instead. Many people won't realize this.  I have done them a
service by telling them so.

The "make install" step doesn't work either. It gives error messages saying
the "-d" option is invalid for the "cp" command.  You also get the following
crytic message.  I asked HP about this. They don't recommend it.

>> If you ever happen to want to link against installed libraries
>> in a given directory, LIBDIR, you must either use libtool, and
>> specify the full pathname of the library, or use the `-LLIBDIR'
>> flag during linking and do at least one of the following:
>>- add LIBDIR to the `SHLIB_PATH' environment variable
>> during execution
>>   - use the `-Wl,+b -Wl,LIBDIR' linker flag

>> See any operating system documentation about shared libraries for
>> more information, such as the ld(1) and ld.so(8) manual pages.

I posted my experience on this site hoping it might benefit anyone who wants
to use sqlite but has found that the standard install process isn't working.
Even though my method looks strange, I prefer funny success over sad
failure.

I just happened to notice that I may not be executing the sqlite
installation process (configure/make/make install) in a full "bash"
environment. My usual environment is "ksh". Typing in the command
"/bin/OpenSource/bin/bash" I get a bash prompt. But apparently that doesn't
put me in a full bash environment. I just noticed that unless I specify the
full path to the GNU make command (/opt/OpenSource/bin/make) then the ksh
version (/usr/bin/make) is executed. I wonder what I have to do to get into
a true bash environment? Must be some environment viable that has to be
changed. Oh well, one mystery begets another!

-- 
View this message in context: 
http://www.nabble.com/I%27m-Starving-for-New-User-Information-tf3701471.html#a10412825
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] My HPUX Notes

2007-05-07 Thread km4hr

Notes on how I got sqlite running on hpux 11.0

To install sqlite on hpux:
* download sqlite-3.3.17.tar.gz from web site.
  (I unzipped the file on linux using gunzip I think. Then copied
   the tar file to /opt on the unix box. I guess gunzip works on hpux also.)
* cd to /opt and untar the file. (tar xf sqlite-3.3.17.tar)
* cd to sqlite... dir created by tar.
* create a "bld" directory as recommended in sqlite README.
* cd to bld.
* Use GNU bash version of "make" (came with hpux 11.0 on my computer
/opt/OpenSource/...) to
  perform the build instructions given in sqlite README. The hpux version of
  make doesn't work. It chokes on the "+=" operators in the make file.
* after "making" sqlite, look in the "bld/.libs" directory for the sqlite
  library files. "sqlite3" command line program is there as well.
* no "sqlite.h" file is provided by the install (?) but "sqlite.h.in"
provided works.
* here's how I compiled the test program given on the sqlite web site:
  cd to my home directory.
  Copied contents of C test program on web site into file "myprog.c".
  Changed "#include " to "#include "/sqlite.h.in".
  Then: "cc -o myprog myprog.c /opt/sqlite/bld/.libs/libsqlite3.a"
* Used /opt/sqlite/bld/.libs/sqlite3 to create database "test.db" (create
table...)
  and to add some records in a table (insert into table ...).
* run myprog test program to dump the table.
  Ex: myprog test.db "select * from tablename"

  Works! Success!

* Now I need to figure out where to install the sqlite library and header
file permanently on hpux.


-- 
View this message in context: 
http://www.nabble.com/I%27m-Starving-for-New-User-Information-tf3701471.html#a10363806
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Starving for New User Information

2007-05-07 Thread km4hr

C.Peachment,

You're right, I'm not the smartest or best programmer. I know that. But I
often get the job done in spite of my handicaps.

To keep from overloading the circuit I'll try to limit the number of
questions to one at a time.

I'm trying to install sqlite on HPUX. There's no HPUX install package on the
sqlite download web site. So I downloaded the sources. The HPUX 11.0 make
utility didn't like sqlite's make files. In spite of my handicaps I notice
that I have GNU bash installed. I tried the the make utility that comes with
bash. Bingo! It worked.

So now I have a "bld" directory full of stuff. But I don't see a sqlite
library file. I look everywhere. Where is it? In spite of my slowness my
tenacity is not lacking. I keep looking. Using "find" I discover libsqlite
files in a ".libs" (hidden) directory. Very sneaky. Why would anyone hide
the directory holding the most important files? I guess to help weed out the
underprivileged. But I'm not the dullest knife in the drawer. I found it!

I'm getting around to asking my one question. I see two library files in the
".libs" directory. One named "libsqlite3.sl" and one named "libsqlite3.a".
Typically a ".a" extension indicates a library for static linking. So here's
my question. What's the ".a" file for?  As I said earlier it makes me think
it might be possible to create executables that can be run on similar
machines without first installing sqlite. 

I'll guess I'll keep plodding along to see if I can figure it out on my own. 
I'm going to try to link some files now. That can be a real challenge in
itself. I guess if I have linking questions I ask them on an HPUX site.

Thanks for the advice.










C.Peachment wrote:
> 
> You ask too many questions in one go. I will be surprised if anyone
> is willing to provide that much assistance all at once.
> 
> It appears that you need some more fundamental knowledge about
> programming on GNU/Linux and maybe even about programming in C.
> 
> Some of your questions are contradictory and suggest you have not
> done your own homework before asking others to do it for you.
> 
> e.g.
>   got a ".so" file. This is obviously a shared library ...
> 
> and
> 
>   Is a C program that uses sqlite statically linked?
> 
> You ask:
>>Once I've created a C program that uses sqlite can I administer its
database
>>with sqlite3 or do I have to write utility programs to create a database,
>>tables, view table contents, etc?
> 
> Why not try it and see for yourself?
> 
> Others have done so and not all of them are smarter than you :-)
> 
> 
> 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/I%27m-Starving-for-New-User-Information-tf3701471.html#a10361035
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] I'm Starving for New User Information

2007-05-06 Thread km4hr

Is there a sqlite introduction for programmers wanting to use the sqlite C
API? The info on the web site is pretty sparse. There seems to be plenty of
info regarding the use of sqlite3 all over the web.  But not much on getting
set up to write programs that use sqlite. 

I have some specific questions below. I am a C programmer and I want use
sqlite in my programs.

First question is about installation. I went to the sqlite download page and
got a ".so" file. This is obviously a shared library but I can't find any
installation document that confirms this. What do I do with the ".so" file?
I guess I need to put it somewhere, but where? I'm using Fedora Core4 at the
moment but what if I also want to use sqlite on RedHat 4? I'd eventually
like to use sqlite on HPUX 11.0 but I'll be happy for the moment to get
myself oriented on Linux.

Are there any link instructions? How do I link a C program on Fedora Core4
Linux for example?
"gcc  myprog.c  -o myprog  sqlite.so"?  Do I need to set a library path
environment variable to point to where the ".so" file is located? Or what?

Is a C program that uses sqlite statically linked? That is, is the final
executable a self contained program that can be moved from one computer to
similar computer? Or does it require supporting sqlite files/libraries to be
installed on each computer where the program is run? Can I just copy a
program that uses the C API to a similar computer and run it? I assume I
would at least have to copy some sqlite data file as well. No?

Once I've created a C program that uses sqlite can I administer its database
with sqlite3 or do I have to write utility programs to create a database,
tables, view table contents, etc?

I'd really like to understand how sqlite works. Not internally, but things
like where is the data stored? What does it mean to "install" sqlite? If I
run a C program in separate directories where does the data get stored? In a
common file somewhere? Or does each program have its own sqlite data file?  

On the sqlite web site there's a brief 5 minute getting started explanation.
It explains how to get going using sqlite3.  But where do I go after that
for more detailed understanding? 

How do you backup sqlite data? Just copy a data file? Or do you use sqlite3
to dump a file of sql statements?

The architecture is unclear to me. I'm hungry to learn more. Is there a
summary document somewhere? I'm finding plenty of tutorials on how to use
sqlite3, the command line interface. But is there anything that explains the
basic architecture? Installation? administration?

The sqlite C API documentation seems pretty clear. I can even find helpful
documents on the web. I just can't find anything describing how to install
and administer sqlite or basically how it works.

thanks




-- 
View this message in context: 
http://www.nabble.com/I%27m-Starving-for-New-User-Information-tf3701471.html#a10350938
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-