Questions tagged [sqldatatypes]
Concerns data types used with SQL.
1,427
questions
0
votes
1
answer
6
views
Lookup Condition in Informatica for double and decimal datatype
I have a lookup table which have column name 'Serial_Number' in double format and source table (SQ) Serial_Number in double format. How both table can be connected in the lookup condition?
I am trying ...
-1
votes
2
answers
41
views
I want to replace fields with STRING with correct data type FLOAT64 in BigQuery. How do I do it?
I am new to learning Data Analysis. I have a field in my BigQuery dataset named Unemployment_rate that should be FLOAT64. However, some fields that should be 0 are represented as 'NaN', which is ...
0
votes
1
answer
28
views
Is there a way to revert a numeric datatype back to date time? (python pandas, snowflake)
I was converting a pandas dataframe column from a string ("YYYY-MM-DDTHH:MM:SSZ") to date time. After the conversion I stored it in a snowflake database where it ended up being a numerical ...
1
vote
1
answer
51
views
Why the value changes on MySQL different versions?
I got an export of a MySQL table (version 5.7.42) containing a bit(15) column named permissions, the value was shown like this: 111111101110111. I imported that dump to a new MySQL server (version 8....
0
votes
0
answers
43
views
How to change datatype nvarchar to bigint in SQL Server? [duplicate]
I am using SQL Server Management Studio and have a table defined with S_id AS NVARCHAR (80), and this cannot be changed. Now there are some values coming as AEC123, ID-33009, 456KP889 which according ...
0
votes
1
answer
34
views
How to use Postgresql's "real" (float4) type in Rails 7.0, instead of the "double precision"?
I've got a Rails 7.0 app connected to a Postgres Database.
I've got tables with several millions of rows, and each row storing more than 10 columns as float types.
The default way of storing numbers ...
0
votes
1
answer
38
views
How to handle datetimeoffset(7) datatype in snowflake?
I have a DDL that has LastUpdatedTime with datatype datetimeoffset(7) in sql server. what's the equivalent datatype in snowflake or how to handle this to get exact value that is in source.
I tried ...
0
votes
2
answers
120
views
Converting a string to an integer failing in Azure Data Factory pipeline
I have constructed an ADF pipeline with copy data to create a CSV from an Azure SQL DB query. It needs to run as a delta load each time, so I have the following...
Lookup - To get the maximum row ID ...
0
votes
0
answers
26
views
Unable to change datatype of columns while import CSV to SQL in R
I have a csv file. I need to import it in SQL. But while importing I need to change the names of columns and I want to change the datatype for all the columns. Csv columns are little weird. Few ...
0
votes
0
answers
42
views
What should be my SQL data type to pass my json payload?
I'm building an API in Anypoint Studio - Mule 4 that will push the payload to a SQL table. However, i can not retrieve my payload because the data type i set in sql is not correct. I've tried (decimal,...
0
votes
0
answers
11
views
Casting Datatypes SQL DataFrames
I am trying to read in a dataframe to an RDD in databricks but have have not been able to determine why the program is reading my integer columns as string.
from pyspark.sql import Row
masterRowsRDD =...
0
votes
1
answer
47
views
Converting a String to Time(7) Using Azure Data Factory Expressions
I have two tables, one is a legacy table I am migrating from that uses strings to denote a date range. For example: "07:00 AM - 19:00 PM".
This is then separated using derived columns into ...
1
vote
1
answer
42
views
Data Type for duration/time - values in Directus
I'ld like to store duration(time)-values, e.g." 1 h, 30 m".
Is there any "time-type" or do I have to store the value in seconds and use anything like DATETIME to convert into the ...
-1
votes
2
answers
63
views
when try to convert varchar data type (mixed date formats) to a datetime data type resulted in an out-of-range value
These are some values stored in my started_at column:
31/5/2022 10:27
1/5/2022 17:03
24/6/2022 9:54
.
.
.
2022-08-09 19:09:55
2022-08-18 14:58:56
2022-11-17 22:50:52
There are more than 1'000'000 ...
0
votes
0
answers
49
views
ODI numeric and date format mask in datastores
In Oracle Data Integrator, I am creating a file datastore which has numbers in the following format:
1.234.567,89-
222,44
,56-
In Oracle I can use the to_number function with a format ...
-1
votes
2
answers
51
views
How to prevent invalid column error in SSMS?
I have two tables in the trading schema -
trading.members (
"member_id" VARCHAR(6),
"first_name" VARCHAR(7),
"region" VARCHAR(13)
);
trading.transactions (
"...
0
votes
0
answers
22
views
Troubleshooting Upload Errors for CSV File Conversion and MySQL Upload
uploading data into MySQL with the error messagepost converting a file to CSV in Excel, many upload error messages are received while uploading the file to MySQL. Is it feasible to upload this data ...
0
votes
1
answer
52
views
PostgreSQL ISNULL transform null to minimum value of datatype
I have a PostgreSQL database and I have a complex query which is generated dynamically from C#. I need to use the ISNULL built-in function which in PostgreSQL is called COALESCE by replacing with ...
1
vote
0
answers
35
views
Why am I getting a 'Numeric value not recognized' error when converting an int column to varchar in SQL?
This is the code I used:
select *
FROM tableA a where cast(columnA as varchar)= 'ABC' limit 10;
However the error i got is:
Numeric value 'BCD' is not recognized
The weird thing is:
I already ...
0
votes
0
answers
57
views
How to change Django model field from Integer to Decimal field for Postgres DB?
I'm trying to change the data type of a Django model field from PositiveBigIntegerField() into DecimalField().
From:
quantity=models.PositiveBigIntegerField()
To:
quantity=models.DecimalField(...
0
votes
1
answer
88
views
Money data type issue
Just wondering about SQL Server Money data type:
------- SCRIPT 1
declare
@test table (
Seg varchar(1),
amt money
)
insert @test
select 'a', -427614103835526.00 union all
select 'a', -...
0
votes
0
answers
36
views
Sequelize: defaultValue: DataTypes.NOW doesn't work
I am trying to create model that one of the columns will be date of creation. For some reason defaultValue: DataTypes.NOW does not being added as default value for the column.
const { Model, ...
2
votes
0
answers
17
views
A problem with writing nanosecond timestamps to a millisecond precision database in cnosdb
I created a database with millisecond precision
create database ms with precision 'ms';
and wrote a timestamp with nanosecond precision into it.
create table ms_t (value BIGINT,tags(str));
insert ...
1
vote
4
answers
54
views
How can I probe optimal datatype from existing MySQL columns with PHP?
I have a MySQL table with ~400 columns
The columns are accumulated from external data so I don't really have control over the count initially at least
In the interest of avoiding errors whilst making ...
0
votes
1
answer
34
views
How to choose numeric datatypes and precision for data input into SQL Server from C#?
I have a C# Windows Form UI that controls a serial instrument (a digital scale) using NI VISA, and I'm trying to figure out the best way to format the output for results tracking in a SQL Server ...
0
votes
0
answers
79
views
Why did importing a CSV file into QGIS and converting it to PostgreSQL using DB Manager result in all columns being character varying?
I'm current working on this dataset. I imported a CSV file into QGIS and used the DB Manager to convert the data and columns into a PostgreSQL database in PgAdmin 4. However, I noticed that the data ...
0
votes
1
answer
188
views
Why do I keep getting datatype mismatch errors in sqlite3
I keep getting datatype mismatch errors when running the following lines in sqlite3. I will include all of it from db creation to where I get the error.
CREATE TABLE PilotAirlines (
...> PilotID ...
0
votes
1
answer
38
views
Type for currency in postgresql
I downloaded data from Mockaroo with column price where the currency sign does exist.
create table car (
id BIGSERIAL NOT NULL PRIMARY KEY,
make VARCHAR(100) NOT NULL,
model VARCHAR(100) ...
0
votes
0
answers
14
views
Why does this new column infection_rate all show 0s? [duplicate]
Just as the title says. If I had to guess, I would think maybe it's because the values are too small and they're getting rounded off to 0? But then that wouldn't make sense because with the values ...
0
votes
1
answer
98
views
Spark Column level Data based on data type in a pyspark data frame
I am trying get Column level Data based on data type of column name
If column data type is
string - get count, distinct count values
int/decimal - get min, max, mean, count, distinct count values
...
0
votes
0
answers
30
views
How to get field types for other fields when using foreign_keys in PostgreSQL?
I can query for fields data_type like this:
SELECT *
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'table-name';
This way I can get data types for building ...
0
votes
0
answers
22
views
Access : Trouble with calculating in new query (data type mismatch in criteria expression)
I'm new on Access and I'm struggling to do something that looks easy. I need your help
In a table i have a field (PERMITTIVITY) in a number (double) data type.
I would like to create a new field (...
0
votes
1
answer
49
views
How to reformat string as int and repalce values in SQL?
I am currently trying to pull in a field (NMBR) in SQL Server that has a datatype of char(5), which I would like to convert to int. However, some of the values in the field are not numbers, in which ...
0
votes
0
answers
127
views
Convert Long binary data (OLE Object) type from Access to PostgreSQL database
I'm trying to migrate an Access database to a PostgreSQL DB, some columns' data type in Access is "OLE Object",I tried to setup BYTEA data type in PostgreSQL to be able to handle this data ...
0
votes
0
answers
22
views
What is the difference between PostgreSQL text and unlimited varchar data types? [duplicate]
PostgreSQL suggests to use either text of unlimited varchar for columns without specific higher limit:
If you desire to store long strings with no specific upper limit, use text or character varying ...
0
votes
0
answers
92
views
SSIS Change Data Capture (CDC) error - "Cannot convert between unicode and non-unicode data types"
I'm trying to set up a Change Data Capture (CDC) SSIS package solution, however I'm getting an error that I cannot understand. I'm getting the following error when I'm setting up the dataflow that ...
0
votes
1
answer
211
views
How to fix error: Arithmetic overflow error converting expression to data type int
I just used count function in query statement but got an error as shown below:
SELECT count(*)
FROM [my_table_data]
Error messages:
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error ...
1
vote
1
answer
93
views
Pass an arbitrary table type as the polymorphic type parameter to a postgresql function
I'm trying to call a polymorphic function where the table type can be determined by a subsidiary function, say, which_table(). The problem is that I can't convert the returned varchar into an actual ...
0
votes
0
answers
42
views
Postgres/psycopg2 "executue_values": Which argument was not converted during string formatting?
I am using execute_values to insert a list of lists of values into a postgres database using psycopg2. Sometimes I get "not all arguments converted during string formatting", indicating that ...
0
votes
1
answer
144
views
Storing values as real data type in PostgreSQL. Confusion about the concept of precision
I am confused about the real data type in PostgreSQL:
CREATE TABLE number_data_types (
numeric_column numeric(20,5),
real_column real,
double_column double precision
);
INSERT INTO ...
0
votes
0
answers
51
views
Insert Arabic values in SqlServer 2019 using php
I want to insert arabic values, so i used this syntax :
$sql = "
insert into sdka_creation (creation_time, sdka_for, creator_ip)
values ('$creation_time',N\'$name\', '$creator_ip')
";...
0
votes
1
answer
27
views
Changing data type of a column containing data in Oracle db
I am using Oracle 19c.
I have a table,which I need to change the data-type of one of its columns:
from number to number (24,8)
The column contains data, nearly 300.000 records and I am required to ...
0
votes
1
answer
30
views
Are EXTENDED VARCHAR2 baned to become synchronized record fields?
My app is built on an Oracle Database.
Would it be possible to overcome the 4000 byte of Text limitation we have for Synchronized Record fields of appian?
I know the VARCHAR2(4000) limitation is ...
0
votes
1
answer
347
views
SQL error (invalid input syntax for type double precision: "") when trying to run query
I am working with world health's covid data for a projoect and have had no issues until this specific query keeps throwing the, invalid input syntax for double precision: "" error.
I should ...
0
votes
0
answers
25
views
How to read MDSYS.MBRCOORDLIST type of column in Oracle
I have a table in Oracle which has a column type as MDSYS.MBRCOORDLIST.
Can someone please help me with the SELECT query to read the data from that column?
I tried,
SELECT b.* FROM table(SCHEMA_NAME....
0
votes
1
answer
32
views
DATA TYPE TIME manupilation
how to aggregate the sells by date i want to know the total of sells for each day
|DATE | SELLS |
|2022-01-27 |48$ |
|2022-01-27 | 25$ |
|2022-01-27 | 150$ |
|2022-01-25 | 55$ |
no ...
0
votes
0
answers
52
views
Why after group by 0 becomes null?
I have the function:
CREATE FUNCTION fnc_successful_checks_blocks(block1 varchar, block2 varchar)
RETURNS TABLE(Started_block1 BIGINT, Started_block2 BIGINT, Started_both BIGINT, Started_no_one BIGINT)...
1
vote
1
answer
140
views
Best data type for hex values in Oracle database
What is the best data type for storing hex values in an Oracle database? With a 33-byte value like this:
0x54906a620d3c1e82c8e812b0f8d1214beafc05c74820c1dd3675b0c38f4a83aa
is there a preferred data ...
0
votes
0
answers
244
views
Teradata : ByteInt format , Compress and Numeric Overflow
I am working on an existing script where the format of one of the columns is set as :
column A BYTEINT Compress (0,1,2,3,4,5,6,7,8,9,NULL)
The possible values for this field lie between 1 - ...
0
votes
1
answer
30
views
What is the reason of using 'CHAR' with DATATYPE SIZE when declaring variable
WHY THE 'CHAR' IS USING WITH SIZE ?
declare
lf constant varchar2(1 char) := chr(10);
lf2 constant varchar2(2 char) := lf || lf;
begin
dbms_output.put_line('LINE-X'||lf||'LINE-Y'||lf2||'LINE-Z');
...