Load data from sql

From Bcontrol
function [saved,saved_history]=load_data_from_sql(varargin)
% [saved,saved_history]=load_data_from_sql(sessid)
% [saved,saved_history]=load_data_from_sql(data_file)
% [saved,saved_history]=load_data_from_sql(ratname, date)
% [saved,saved_history]=load_data_from_sql(ratname, daterange)
%
% If you request only one output you will get saved (which will be faster!)
% date should be of the form "YYYY-MM-DD" or a relative date like -5
% daterange should be a numeric vector in relative form like -10:-1
% if daterange(end) is not a valid session the function returns empty.