Loading data

In this section, you load data into the multiplex database using the coordinator and a writer. This is the most efficient use of multiplex resources because it distributes the workload to multiple servers. In this demonstration, different servers are used in serial to load data. In a production environment, you can perform loads on separate tables in parallel from multiple servers.

This demonstration uses the Contacts and SalesOrderItems tables using the load files that ship with IQ 15.3.

On UNIX, these files are in $IQDIR15/demo/adata.

On Windows, these files are in %ALLUSERSPROFILE%\SybaseIQ\demo\adata.

Substitute the appropriate path to these input files in the following LOAD statements.

StepsLoading data from the coordinator

  1. Use Interactive SQL to connect to the coordinator server PC62573_iqdemo.

  2. Truncate the Contacts table because it gets loaded with the same data during the creation of the demo database.

  3. Load the Contacts table. (Type the file path on a single line, not as shown.)

    On UNIX

    TRUNCATE TABLE Contacts;
    
    LOAD TABLE Contacts (ID, Surname,GivenName, 
    Title, Street, City, State, Country, PostalCode,
    Phone, Fax, CustomerID) 
    USING FILE '/sun62574/users/userid/ 
    /syb_install_dir/IQ-15_3/demo/adata/contact.dat' 
    ROW DELIMITED BY '|' 
    ESCAPES OFF;
    
    COMMIT; 
    

    On Windows

    TRUNCATE TABLE Contacts;
    
    LOAD TABLE Contacts (ID, Surname,GivenName, 
    Title, Street, City, State, Country, 
    PostalCode, Phone, Fax, CustomerID) 
    USING FILE 
    'C:\Documents and Settings\All Users
    \SybaseIQ\demo\adata\contact.dat' 
    ROW DELIMITED BY '|' 
    ESCAPES OFF;
    
    COMMIT; 
    

StepsLoading data from the writer

  1. Use Interactive SQL to connect to the writer server PC62573_iqdemo_w1 server.

  2. Truncate the SalesOrderItems table, as it gets loaded with the same data during the creation of the demo database.

  3. Load the SalesOrderItems table. (Type the file path on a single line, not as shown.)

    On UNIX

    TRUNCATE TABLE SalesOrderItems;
    
    LOAD TABLE SalesOrderItems (ID, LineID, 
    ProductID, Quantity, ShipDate) 
    USING FILE '/sun62574/users/userid/ 
    /syb_install_dir/IQ-15_3/demo
    /adata/sales_oi.dat' 
    ROW DELIMITED BY '|' 
    ESCAPES OFF;
    
    COMMIT; 
    

    On Windows

    TRUNCATE TABLE SalesOrderItems; 
    
    LOAD TABLE SalesOrderItems (ID, LineID, 
    ProductID, Quantity, ShipDate) 
    USING FILE 'C:\Documents and Settings\All Users\
    SybaseIQ\demo\adata\sales_oi.dat'
    ROW DELIMITED BY '|' 
    ESCAPES OFF; 
    
    COMMIT; 
    

When the data is loaded into the database, you can execute queries against the data from any server in the multiplex. You can use this base multiplex for further experimentation. You can also explore how to perform additional operations on this data by adapting the iqdemo scripts.

NoteIf you have questions about installing or running the software, contact Sybase Technical Support or the Sybase subsidiary in your area.