Questions tagged [database]

80265 questions
1

votes
1

answer
1.3k

Views

Swift Query Into Firebase Firestore Nested Array

I have nested data that I'd like to display in a tableView. My data is structured like so... /users /userid name: 'John' age: 23 /likedPosts 0:post1 1:post2 For the tableview I'd like to display these posts (which have their own collection of data). In order to do that I need to... 1) Get the coun...
pmanning
0

votes
0

answer
20

Views

SQLite3 - Select returns bad data

I have a problem without my simply database. I have defined (fields - text, decimal, data) the sales table in the database. I load data into it (code). The problem is that: Select sum(salesvalue) from sales it shows bad data. The sum is too small in relation to reality. 'Salesvalue' -> DECIMAL Inter...
Qlikeers
1

votes
1

answer
100

Views

How to test a method that makes calls to a database

I have several methods that make connections to a database and I can't figure out how to write unit tests for them. Here is a sample of what I'm talking about. public static User GetByPendingUserId(int a_PendingUserId) { User l_User = new User(); SqlConnection l_conn = DbHelp.CreateSqlConnection();...
tayopi
1

votes
1

answer
330

Views

Firebase rules and validations for update existing data

I have a data structure as following: { 'users' : { '31J59dq1clZ3inHMzoopiigsEg63' : [ { 'name' : 'Lanchana', 'timestamp' : 1516916245423, 'uid' : '31J59dq1clZ3inHMzoopiigsEg63', 'userEmail' : '*****@gmail.com', 'total-stars' : 123 } ] } } and fire rules as following: { 'rules': { 'users': { '$uid'...
lanchana gupta
1

votes
1

answer
240

Views

Azure SQL: Update Compatibility Level of [master] database

We have a single production database [ProdDatabase] on an Azure SQL Server instance that was created back in 2013. At the time of creation the compatibility level of [ProdDatabase] and [master] was hence set to 100 (SQL Server 2008). Over the past few weeks we've successfully updated the compatibili...
sammy34
1

votes
2

answer
254

Views

Can't get permission to firebase database IOS

I can't get permission to database. In xcode console I am getting this message: [Firebase/Database][I-RDB038012] Listener at /skelbimai failed: permission_denied So I went to firebase database, then Rules and changed like this: service cloud.firestore { match /databases/{database}/documents { matc...
1

votes
2

answer
225

Views

How to use Typescript as compiler in node-migrate

To start, here's my migration script: const bluebird = require('bluebird'); const mongoose = require('mongoose'); mongoose.Promise = bluebird; mongoose.connect('mongodb://localhost:27017/app', { useMongoClient: true }); const schema = { uid: { type: String, }, parentID: { type: String...
Christopher Santos
1

votes
3

answer
453

Views

MySql doesn't accepting boolean as its column datatype

I have a Java program which stores data in MySQL database in two states. For this purpose I wanted to use BOOLEAN. But whenever I enter BOOLEAN it's getting changed into TINYINT. Is there any other way to store data in two states?
pritam parab
1

votes
1

answer
2.2k

Views

How to set any column as primary key in Azure SQL data warehouse

I am trying to set one column in DB as primary key but I always get this error: Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement. While doing R & D,I found that ther...
shweta_kaushish
1

votes
2

answer
2.9k

Views

When using the onUpdate function in Firebase, how do I retrieve the record that has been updated?

When using the cloud functions on firebase, with the onUpdate trigger, how do I retrieve the record that has been updated (in other words, the record that triggers the function)? I am using JavaScript to interface with the Firebase database.
Ryan
0

votes
1

answer
15

Views

how to retrieve the values that contains a part of value in the column

Suppose i have a column lastName and i have the data as kumar yadav kumar shah raghu. kumar Now i want to write a sql query that to get the values whose last name contains kumar.
Pankaj 4 U
0

votes
1

answer
13

Views

How to create a script that can migrate database to another normalized database

I have an existing system with hundred thousands of data. I need to migrate it to another database but different structure. How can i create a script that will migrate database to a different structure. I tried csv but i need to make some columns to foreign key because the new database is much norma...
0

votes
0

answer
9

Views

is calculated table possible?

Is it a good idea to create a calculated table which contains the results of complex calculation? For examples, the calculation involves regression and prediction etc. As the results will be used in future analysis frequently, I prefer doing the calculation once when new data come in instead of calc...
Hawii Hawii
1

votes
3

answer
144

Views

Why SQL query with SHA2_256 returns NULL in WHERE clause

I need a hand on this, any comments will be highly appreciated. I have a table Users with field UserPassword with datatype varchar(60) I insert on the table users from this select SELECT HASHBYTES('SHA2_256','test') it insert its value (0x9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F...
1

votes
1

answer
47

Views

Best way to put data in multiple places in firebase database

I am not so much familiar with firebase database, I want to store data in target1, if that succeeds then will put some data to target2. Currently I'm doing this: Database.ref('target1').push({ name: name, email: email }) .then(()=>{ Database.ref('target2').push().set({ name: name, email: email }) .t...
Muhammad Ovi
1

votes
2

answer
1.7k

Views

Golang: Connect with postgreSQL schema

I am looking to connect and query to a PostgreSQL. But I only want to connect to a particular Schema. As per the doc (JDBC) we can use jdbc:postgresql://localhost:5432/mydatabase?searchpath=myschema or update As of 9.4 you can specify the url with the new currentSchema parameter like so: jdbc:postg...
Abhishek Soni
1

votes
1

answer
844

Views

How to order by child value in Firebase

I have data like this: scores: { uid1: { score: 15, displayName: 'Uciska' }, uid2: { score: 3, displayName: 'Bob' }, uid3: { etc... } } I want to rank them by score and keep only the top 100. I did that by following the doc. But it does not work. It always returns the same order even if the score ch...
uciska
1

votes
2

answer
452

Views

Can I use SQLCMD Commands in Visual Studio Database Project Stored Procedure?

I have a lot of SQL that is the same over multiple stored procedures. For example most procedures have the same variables declared, and is in the same try catch block to handle errors. I'd like to use the :r command so that I can write this code in one file and just import it into each sp. I can use...
Samuel O'Connor
1

votes
1

answer
85

Views

How do i connect to a ODBC Oracle database?

I have information about the connection like username, password, host, port, SID and i know that is an oracle database but i don't know how to connect. I am on lubuntu 18.04.
José Augusto
1

votes
2

answer
63

Views

Store Data in Multiple tables via single form

I want to store data in 3 tables via single registration form but getting error. I have tried all the way but it is not allowing due to primary key constraints violation Controller class UserController extends Controller { public function registerLawyer(Request $request){ $firstname = $request->get(...
Prathamesh Doke
1

votes
2

answer
249

Views

Azure SQL Database DTU metrics

I'm using Azure's metrics chart to see if it's feasible to merge two databases into one Pool. The two databases are currently in tier S3. The first chart is the result with 'DTU Used' metric using MAX() aggregation function in the last 30 days. It can be observed that during several intervals the 'D...
DuroForce
1

votes
2

answer
98

Views

Inconsistent querying on a partitioned CosmosDB collection

I have a partitioned cosmos DB collection which is defined as unlimited with a throughput of 1000. It has the following document structure: 'Id': 'b42129d2-5467-450c-9f7e-744f78dfe1e7', // Primary key 'ArrayOfObjects': [ { // other properties omitted for brevity 'SubId': 'ed2a49fb-51d4-45b4-9690-df0...
Sylvoo
1

votes
1

answer
78

Views

MongoDB one-to-many - array of IDs or ID ref on child model? [closed]

Specifically, I'm thinking of a chat app, where a User has many Chats and each Chat has many Messages. How would I express the Chat --has-Many--> Message relationship? Initially, I thought I'd store the list of Message ID references on Chat, e.g. a Chat document could look something like { _id: Obje...
Code Jockey
1

votes
1

answer
13

Views

problem using ORDER BY in postgres with UNION clause

I am trying to run this query in postgresql SELECT DISTINCT users.'uid', tax.'tid' FROM tax LEFT JOIN users ON tax.'uid' = users.'uid' UNION SELECT DISTINCT users.'uid', tax.'tid' FROM tax LEFT JOIN users ON tax.'uid' = users.'uid' ORDER BY users.'uid', tax.'tid' but I come across this error miss...
Ari7
0

votes
1

answer
14

Views

How to subtract two dateTime field containing dateTime in ISO format and get the result in hours?

How to subtract two dateTime field containing dateTime in ISO format and get the result in hours? I have tried subtracting two date fields but it has just subtracted date and not taken time into consideration to_number( TRUNC(to_timestamp(T1.attribute_2,'YYYY-MM-DD'T'HH24:MI:SS.ff3'Z''))- TRUNC(to_t...
Gaurav Kanodia
0

votes
0

answer
12

Views

In cucumber.js, how can I use gherkin and tables correctly for database verification?

I'm performing verification (several scenarios) on database tables. I currently am using the approach like this. Scenario: Verify the database has the correct values for table agency_supplier_data Then in the table agency_supplier_data when the 'supplier_code' is 'QE-ACHBLN-01', then the 'active'...
0

votes
1

answer
26

Views

Change “Allow access to Azure services” settings of Azure SQL Server using powershell

I want to modify (enable/disable) 'Allow access to Azure services' settings of Azure SQL Server using powershell, based on a value from my JSON configuration I do have referred couple of StackOverflow, all the answers are to create a firewall rule '0.0.0.0' to enable and '255.255.255.255' to disable...
Manjunath Rao
1

votes
1

answer
127

Views

How to analyze poor performance from Azure PostGreSQL-PaaS

I'm experiencing poor performance from Azure PostGreSQL-PaaS and need help with how to proceed. I'm trying out Azure PostGreSQL-PaaS in a project. I'm experiencing an intolerable performance from the database (or at least it seems like the database is the problem). Our application is running in an A...
Gunnis
1

votes
1

answer
636

Views

Mongo-Go-Driver Failing to Connect

So I am trying to use https://github.com/mongodb/mongo-go-driver to connect to a mongo database in golang. Here is my connection handler: var DB *mongo.Database func CreateConnectionHandler()(*mongo.Database, error){ fmt.Println('inside createConnection in database package') godotenv.Load() fmt.Pri...
Peter Weyand
1

votes
1

answer
45

Views

Fuzzy search in Azure SQL Server

In the project I work we have the necessity to use some kind of fuzzy search to fill an autocomplete field. This autocomplete field must show some information as the user type inside. I'm using Azure SQL database, and I found out that it's not possible to use Master Data Services. (https://docs.micr...
Henrique
1

votes
2

answer
43

Views

SQL - Creating Database and Querying it

I need to answer the following instructions and am wondering if I'm on the right path as far as answering it. Instructions Design a database for the following scenario: You need to track all of the dogs at an agility competition. They have different events for each competition and each dog has a sc...
mph85
1

votes
1

answer
52

Views

Tool to track SQL schema like infrastructure as code?

I have been using AWS Cloudformation and Terraform to manage cloud infrastructure as code (IAC). The benefits are obvious. 1) Template file to concisely describe your infrastructure 2) Versioning 3) Rollbacks I also have a PostgreSQL DB where I can dump the schema into a single file. Now, it would b...
Jon Vogel
1

votes
2

answer
51

Views

Cannot invoke 'setValue' with an argument list of type '(Any?, (Error?, DatabaseReference) -> Void)'

I want to send object of structure to firebase. struct commentsData{ var commentsText:String var commentTime:String var commentDay:String var commentMonth:String var commentYear:String } var data = commentsData(commentsText: '', commentTime: '', commentDay: '', commentMonth: '', commentYear: '')...
Captain Newt
1

votes
1

answer
41

Views

Unable to render react-native Component after fetching data from firebase

I am able to fetch data from the Firebase API. I am able to set the state into the data received (I can see in Console). But when I am unable to render a Component (passing props as fetched data). Here' my code: class NewMeals extends Component { constructor(props){ super(props); this.state= { data:...
Saumay Paul
1

votes
1

answer
27

Views

Get Storing updated rows and previous rows as well

Let's suppose I have table as : column_1 | column_2 | column_3 | column_4 abc 12 23 34 abc 01 12 45 I am looking for query something like insert into table(column_1,column_2,column_3,column_4) values(List of updated rows i.e select (do some logic here...
Dhanraj
1

votes
5

answer
43

Views

SQL Query Using Joining Tables, Group By, and Where

Question: Which orders have a value greater than $5,000? Query I am currently using: SELECT o.orderNumber, o.orderDate, d.quantityOrdered*d.priceEach AS totalAmt FROM orderdetails d, orders o, products p WHERE p.productCode = d.productCode AND d.orderNumber = o.orderNumber; Output Looks Like: '101...
doublepancake84
1

votes
2

answer
24

Views

how to export all databases as separate sql files instead of localhost.sql

I want to export all databases as separate .sql files but I get localhost.sql Can anyone here show me how we can accomplish this?
Lawrence Bosumbe
1

votes
1

answer
30

Views

Remove MySql database table on remote server from C# application

If I can create MySql database table on remote server from C# desktop application string createTableQuery = string.Format(table, tableName); and var cmd = new MySql.Data.MySqlClient.MySqlCommand(createTableQuery, conn); Then how do I remove table from MySql database by tableName Any guide, advice o...
viktor80
1

votes
2

answer
43

Views

Firebase orderByKey().startAt() not working as expected. What's wrong?

I'm trying to get firebase data from a node which uid must start with a passed string. I tried a code but I always get the same data. The database data is as following: And I'm using the following code: var ref = firebase.database().ref('restaurantes/history'); ref.orderByKey().startAt(userUID).onc...
Gaston Levy Mayo
1

votes
1

answer
59

Views

Is Event Sourcing helpful to Machine Learning

I am new to Event Sourcing, Event Store, Message Store and Machine Learning. And we are planning to implement message store and the reason they mentioned about implementing message store (instead traditional db, crud) is because the message store eventually helps in deep learning or machine learning...
Sreekanth Reddy

View additional questions