Thanks. I didn't think of "CTEs" either. I need to read up on them. 

Mike

> On Sep 12, 2016, at 08:49, Dominique Devienne <ddevie...@gmail.com> wrote:
> 
>> On Sun, Sep 11, 2016 at 11:48 PM, mikeegg1 <mikee...@mac.com> wrote:
>> 
>> I think Oracle (a long distant memory) has variables like @variable or
>> @@variable.
> 
> 
> Not really. Oracle SQL doesn't have variables per se.
> 
> But APIs to interact with Oracle SQL (OCI, JDBC, ODBC, etc...) can *bind*
> and *define*
> "host language" variables, just like SQLite's API can bind/define them too.
> 
> The Oracle command-line program (of choice), SQL*Plus, allows to bind
> variables [1] [3],
> which behind the scene means allocating some memory for the variable, and
> binding it as normal.
> But there's no direct support for defining. For this you need PL/SQL (see
> below).
> 
> Then PL/SQL, the server-side language which also supports variables, has
> special syntax to
> SELECT ... INTO [2], to define variables, and natively supports bind
> variables as well.
> 
> But again, in both cases it's the host program that implements the variable
> handling,
> not SQL itself. (define variables do need special support at the SQL level
> I guess, for the INTO syntax)
> 
> sqlite3.exe, the SQLite command line driver, doesn't support bind variables
> itself.
> It could be added (using [5] and co.), but that's just not the case.
> 
> In addition to what David mentioned (temp tables), you could also use CTEs
> [4],
> which is just a variation of the same temp table technique, albeit with a
> more "transient"
> temp table.
> 
> [1]
> https://oracle-base.com/articles/misc/literals-substitution-variables-and-bind-variables
> [2]
> https://oracle-base.com/articles/misc/introduction-to-plsql#using-sql-in-plsql
> [3] http://www.adp-gmbh.ch/ora/sqlplus/use_vars.html
> [4] https://www.sqlite.org/lang_with.html
> [5] https://www.sqlite.org/capi3ref.html#sqlite3_bind_parameter_count
> _______________________________________________
> 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