PRAGMA case_sensitive_like

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

PRAGMA case_sensitive_like

Chris Locke
While the pragma *case_sensitive_like *can be set, there doesn't seem to be
a way to read it.
Is there a reason for it being write only?
A hacky workaround is to use the SQL, "select 'x' like 'X'  ", but is there
a better way?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: PRAGMA case_sensitive_like

J Decker
https://www.sqlite.org/pragma.html#pragma_pragma_list

A pragma can take either zero or one argument. The argument is may be
either in parentheses or it may be separated from the pragma name by an
equal sign. The two syntaxes yield identical results. In many pragmas, the
argument is a boolean. The boolean can be one of:

*1 yes true on0 no false off*

Keyword arguments can optionally appear in quotes. (Example: 'yes' [FALSE].)
Some pragmas takes a string literal as their argument. When pragma takes a
keyword argument, it will usually also take a numeric equivalent as well.
For example, "0" and "no" mean the same thing, as does "1" and "yes". When
querying the value of a setting, many pragmas return the number rather than
the keyword.
looks like , from the docs, `  pragma *case_sensitive_like` should rteturn
the value; a pragma without a value.
there's also a pragma pragma_list which (if compiled in) will return all
available pragmas

On Thu, Aug 16, 2018 at 6:16 AM Chris Locke <[hidden email]> wrote:

> While the pragma *case_sensitive_like *can be set, there doesn't seem to be
> a way to read it.
> Is there a reason for it being write only?
> A hacky workaround is to use the SQL, "select 'x' like 'X'  ", but is there
> a better way?
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: PRAGMA case_sensitive_like

David Raymond
https://www.sqlite.org/pragma.html#pragma_case_sensitive_like

Basically nope, there isn't a better way. There is no 0 argument version of the pragma, and there is no table-valued function as it's a pragma with a side effect. So running a small query where you know what the answer is is currently the only way.

Also means that if you're going to change it, you want to run that test query again afterwards to make sure it stuck. If there's a typo in your pragma call then it gets silently ignored, and there's no return value when setting it.


-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of J Decker
Sent: Thursday, August 16, 2018 10:16 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] PRAGMA case_sensitive_like


...


looks like , from the docs, `  pragma *case_sensitive_like` should rteturn
the value; a pragma without a value.


...

On Thu, Aug 16, 2018 at 6:16 AM Chris Locke <[hidden email]> wrote:

> While the pragma *case_sensitive_like *can be set, there doesn't seem to be
> a way to read it.
> Is there a reason for it being write only?
> A hacky workaround is to use the SQL, "select 'x' like 'X'  ", but is there
> a better way?
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: PRAGMA case_sensitive_like

Chris Locke-3
In reply to this post by J Decker
Thanks J - not entirely sure how that's helpful - I know how to call the
pragma, but I was enquiring as to whether there was a way of reading a
write-only pragma (which sounds nonsense now that I've written that down!!)

Thanks,
Chris


On Thu, Aug 16, 2018 at 3:16 PM J Decker <[hidden email]> wrote:

> https://www.sqlite.org/pragma.html#pragma_pragma_list
>
> A pragma can take either zero or one argument. The argument is may be
> either in parentheses or it may be separated from the pragma name by an
> equal sign. The two syntaxes yield identical results. In many pragmas, the
> argument is a boolean. The boolean can be one of:
>
> *1 yes true on0 no false off*
>
> Keyword arguments can optionally appear in quotes. (Example: 'yes'
> [FALSE].)
> Some pragmas takes a string literal as their argument. When pragma takes a
> keyword argument, it will usually also take a numeric equivalent as well.
> For example, "0" and "no" mean the same thing, as does "1" and "yes". When
> querying the value of a setting, many pragmas return the number rather than
> the keyword.
> looks like , from the docs, `  pragma *case_sensitive_like` should rteturn
> the value; a pragma without a value.
> there's also a pragma pragma_list which (if compiled in) will return all
> available pragmas
>
> On Thu, Aug 16, 2018 at 6:16 AM Chris Locke <[hidden email]>
> wrote:
>
> > While the pragma *case_sensitive_like *can be set, there doesn't seem to
> be
> > a way to read it.
> > Is there a reason for it being write only?
> > A hacky workaround is to use the SQL, "select 'x' like 'X'  ", but is
> there
> > a better way?
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: PRAGMA case_sensitive_like

Clemens Ladisch
In reply to this post by Chris Locke
Chris Locke wrote:
> Is there a reason for it being write only?

This pragma just installs a different LIKE() function, and there is no easy
mechanism to read the function pointer back.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users