Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere embedded SQL » Library function reference


sql_needs_quotes function

unsigned int sql_needs_quotes( SQLCA *sqlca, char * str );

Returns a TRUE or FALSE value that indicates whether the string requires double quotes around it when it is used as a SQL identifier. This function formulates a request to the database server to determine if quotes are needed. Relevant information is stored in the sqlcode field.

There are three cases of return value/code combinations:

  • return = FALSE, sqlcode = 0   The string does not need quotes.

  • return = TRUE   The sqlcode is always SQLE_WARNING, and the string requires quotes.

  • return = FALSE   If sqlcode is something other than SQLE_WARNING, the test is inconclusive.