cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL error using sqlanywhere php API sasql_query()

Former Member
5,725

I'm having problem executing a specific query using php API from sqlanywhere 12.

It only happens with SET OPTION query.

<?php
    // setup omitted for clarity here
    $result = sasql_query( $conn, "SET OPTION PUBLIC.AjusteFuso = '0'" );
    // clean up omitted for clarity here
?>

I receive the following exception:

'AjusteFuso' is an unknown option SET OPTION PUBLIC.AjusteFuso = '0'

But this is not true, it is known option in my database!

1 - others select/update/delete/insert works normal as expected.

2 - SET OPTION works ok if i test it using sybase central.

This same query was working normal using sql anywhere 9 with sybase_query() old API.

EDIT:

I did the same SQL command using .net API and it does not work too.

SACommand sql = new SACommand("SET OPTION AjusteFuso = 10", conn); conn.Open(); Console.WriteLine(sql.ExecuteNonQuery());

EDIT 2 Correction: in .net API DOES WORKS. I was doing wrong test.

View Entire Topic
Former Member

I could not solve the problem.

I did a work around wrapping SET OPTION inside a procedure, it works, but it leaded me to another big frustration i could not understand.

If you're curious, i opened a question here since it is another issue.

http://sqlanywhere-forum.sap.com/questions/7856/procedure-weird-set-option-error

VolkerBarth
Contributor
0 Likes

Well, obviously that weird problem seems solved:)