0

help! hosted storage

I'm trying to put a block of content about 10K into yahoo hosted storage!

I have tried this
yql_query = 'update yql.storage set value="' + boeData + '" where name="'+ store_u + '"';
yql_base_url = "http://query.yahooapis.com/v1/public/yql";
yql_query_url = yql_base_url + "?q=" + yql_query;
yql_query_url += "&diagnostics=true&format=xml&debug=true";
var q = y.query(yql_query_url);

but I get an exception error,

Exception: Syntax error(s) [line 1:4 no viable alternative at character ':',line 1022:30 no viable alternative at character ':']

if I escape the yql_query variable I still get the same exception??

help!?!

by
3 Replies
  • Hi Pete,

    Maybe the data inside 'boeData' has a " and that's causing the syntax error.
    Also if the file you are trying to upload is close to 10K, I will suggest to use another approach, instead of inserting the content itself, insert the data from a url:

    insert into yql.storage.admin (url) values ("http://hostingdomain.com/mytable.xml")

    More info:

    http://developer.yahoo.com/yql/guide/yql-s...new-records-url

    Cheers,
    Francisco

    QUOTE (Pete @ Sep 24 2010, 06:31 AM) <{POST_SNAPBACK}>
    I'm trying to put a block of content about 10K into yahoo hosted storage!

    I have tried this
    yql_query = 'update yql.storage set value="' + boeData + '" where name="'+ store_u + '"';
    yql_base_url = "http://query.yahooapis.com/v1/public/yql";
    yql_query_url = yql_base_url + "?q=" + yql_query;
    yql_query_url += "&diagnostics=true&format=xml&debug=true";
    var q = y.query(yql_query_url);

    but I get an exception error,

    Exception: Syntax error(s) [line 1:4 no viable alternative at character ':',line 1022:30 no viable alternative at character ':']

    if I escape the yql_query variable I still get the same exception??

    help!?!
    0
  • QUOTE (arcturus @ Sep 24 2010, 07:31 AM) <{POST_SNAPBACK}>
    Hi Pete,

    Maybe the data inside 'boeData' has a " and that's causing the syntax error.
    Also if the file you are trying to upload is close to 10K, I will suggest to use another approach, instead of inserting the content itself, insert the data from a url:

    insert into yql.storage.admin (url) values ("http://hostingdomain.com/mytable.xml")

    More info:

    http://developer.yahoo.com/yql/guide/yql-s...new-records-url

    Cheers,
    Francisco


    I found one of my problems and that was that y.query just takes the YQL query and not the complete url [DOH!]
    Another 'gotcha' was that as you can run multiple queries within the same <execute> if you want the force a sequential process then you must call for the results of each query directly after it. eg

    var a = y.query'select * from yql.storage where name="' + store_a + '"');
    var result_a = a.results;
    var b = y.query'select * from yql.storage where name="' + store_a + '"');
    var result_b = b.results;

    ::more comments from the edge of sanity
    0
  • QUOTE (Pete @ Sep 24 2010, 08:05 AM) <{POST_SNAPBACK}>
    I found one of my problems and that was that y.query just takes the YQL query and not the complete url [DOH!]
    Another 'gotcha' was that as you can run multiple queries within the same <execute> if you want the force a sequential process then you must call for the results of each query directly after it. eg

    var a = y.query'select * from yql.storage where name="' + store_a + '"');
    var result_a = a.results;
    var b = y.query'select * from yql.storage where name="' + store_a + '"');
    var result_b = b.results;


    ::more comments from the edge of sanity

    TO arcturus
    yes a nice 'gotcha' as you are placing your data inside a set of double quotes all of your double quotes need to be escaped or converted to single quotes... who knew!!
    I feel a nice little function coming on to sort that one out.
    It would also appear that y.query is not limited to the length of a url string :)
    0

Recent Posts

in YQL