Hello!

I did read prezentation of SQL Anywhere® 11
http://www.sybase.com/files/White_Papers/Sybase_SQLAnywhere_Top10newFeatures_wp.pdf

and there are very useful features which can make replication very simple. How 
may be it realised in SQLite?

"1. UNLOAD to a Variable
   The LOAD and UNLOAD statements now work with variables as well as files. I 
don’t mean just using a variable to hold a
file specification, I mean loading and unloading data stored in variables as 
well as files. You can UNLOAD all the rows and
columns of a table into a single string variable, and the reverse: LOAD a 
table from a string:
   BEGIN
        DECLARE s LONG VARCHAR;
        UNLOAD TABLE t1 TO s;
        LOAD TABLE t2 FROM s;
   END;
"

And 

"2. FROM OPENSTRING
   The new OPENSTRING clause lets you name a file or variable in the FROM 
clause of a SELECT and have SQL Anywhere
treat the data inside that file or variable as a set of rows and columns. 
That’s a little bit like using a proxy table to treat a file
like a table via ODBC remote access middleware, but it’s way easier and more 
flexible, not to mention that OPENSTRING lets
you use variables as well as files.

...

CREATE VARIABLE @var LONG VARCHAR;
UNLOAD
   SELECT *
      FROM SYSDOMAIN
INTO VARIABLE @var;
CREATE VIEW V AS
   SELECT *
      FROM OPENSTRING ( VALUE @var ) WITH
               ( domain_id   SMALLINT,
                 domain_num VARCHAR ( 128 ),
                 type_id     SMALLINT,
                 “precision” SMALLINT )
           AS T;
"


Best regards, Alexey.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to