More simple than that.  In MSSQL there's the DECLARE and SET commands (
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/variables-transact-sql?view=sql-server-2017
)

I was thinking that while I'm going through my list of "To make this, you
need that and the other thing", I was going to have three variable set with
three different strings I could just copy/paste to generate that
comparative list.  But then I got to thinking I could do the same kind of
thing with Excel, export to CSV, and just import it into SQLite.  Then I
got really lazy and decided to write an actual application to handle the
database instead, and use a GUI with Combo boxes and lists to show me what
I can make with what I have, etc.  Saves typing and keeps up accuracy, so
my request for this project is kind of moot.

But the principal for having this for some things would be nice. It'd
mostly fix the going in-and-out of quotes to create the SQL statements.  I
know binding is available in most places, but this just "sounds" more
easier.

On Fri, Jan 18, 2019 at 9:12 PM Keith Medcalf <kmedc...@dessus.com> wrote:

>
> SQLite3 does have variables.
>
> You set them by binding values to an SQL statement, and retrieve them by
> retrieving column values resulting from the execution of an SQL Statement.
> For example:
>
> sqlite3_prepare('select var1, var2 from table1 where val3=?;')
>
> You bind a value to the val3 variable using one of the bind functions,
> then when you sqlite3_step the statement, you can use sqlite3_column_xxx to
> retrieve the value of the var1 and var2 variables.
>
> Or did you have something else in mind?
>
>
> ---
> The fact that there's a Highway to Hell but only a Stairway to Heaven says
> a lot about anticipated traffic volume.
>
>
> >-----Original Message-----
> >From: sqlite-users [mailto:sqlite-users-
> >boun...@mailinglists.sqlite.org] On Behalf Of Stephen Chrzanowski
> >Sent: Friday, 18 January, 2019 18:52
> >To: General Discussion of SQLite Database
> >Subject: [sqlite] Variable Declaration
> >
> >Tonight, I wanted to write up a small database to keep tabs on
> >certain
> >things I've done in a game, and show me new tasks I can do based on
> >what
> >I've completed.  I have a full list of items, and what pairs of items
> >I
> >need to poses to get the next thing, but, getting the data into the
> >DB is
> >tedious.   I'm still going to do it, but, the thought of using
> >variables
> >came to mind, and apparently this isn't something that's supported?
> >
> >I've seen long wind answers to how this can be completed on
> >stackoverflow,
> >and other sites, and for this one-time thing I'm doing, I'm not
> >really
> >interested in those proposals.
> >
> >So for now, trudging on without, but, has there been recent
> >discussions or
> >any plans on introducing variables to SQLite?  I know it's a bit of
> >fluff,
> >and the whole "Keeping it light" thing, but, it's kind of useful in
> >some
> >cases.
> >_______________________________________________
> >sqlite-users mailing list
> >sqlite-users@mailinglists.sqlite.org
> >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to