Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a difference between the SQL constant user and the function dbmsinfo(username)?

0
Posted

Is there a difference between the SQL constant user and the function dbmsinfo(username)?

0

The SQL constant user is used for compatibility with older versions of Ingres – its datatype is c32. dbmsinfo(‘username’) is the preferred method to reference the current user and has a datatype of char(32). Because the datatypes are different this can lead to differences in query performance. If you have a where clause with char_col=user then each value of char_col has to be coerced to a c32 – causing a table scan even if there is an index available.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.