Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Qt_script_getbit

Paweł Salawa edited this page Feb 21, 2024 · 1 revision

Definition

Language: Qt Script
Plugin for language: ScriptingQt
How to use: Create custom SQL function. Suggested name: getBit
Function arguments bitIndex, intValue
Function usage: SELECT getBit(0, some_integer_column)
Description: It extracts bit of given index from a given integer value

Code

return ((1 << arguments[0]) & arguments[1]) >> arguments[0]

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /