![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#3
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#4
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#5
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#6
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#7
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#8
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#9
| |||
| |||
|
|
I'm currently trying to insert data into a table which contains a bit(32) field. However, the "32" bits should be kept variable, that means I do not want to code something that relies on the field length to be 32, it might well be 48 or 64. So what I'm trying to do is the following INSERT INTO mytable (bitfield) VALUES (CAST(0 AS bit(32))); This works. However, the bit(32) is explicit. What I'd like is something like INSERT INTO mytable (bitfield) VALUES (CAST(0 AS TYPEOF(bitfield))); How is that possible when using Postgres? |
#10
| |||
| |||
|
|
What do you want to achieve, I mean, what is your goal? Maybe there is a different way to do it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |