FAQ Database Discussion Community


How to get node.js to connect to mongolab using mongoose

database,node.js,mongodb,mongoose,mongolab
I've been trying to use mongoose (module for node.js and mongodb). And tried to get a connection with mongolab up and running. I tried the following at the top of my app.js file, but I couldn't seem to enter the db.on function. global.mongoose = require('mongoose'); var uri = 'mongodb://username:[email protected]:#####/db'; global.db...

How do I access website databases? [closed]

database
I'm trying to better understand databases and networking. Basically my question is how do websites like these access player data from the game when they're not affiliated with the company? Do you have to have permission by the website to read their statistics? Are these databases private? What are different...

What type of database is the best for storing array or object like data [on hold]

database,node.js,sockets
I'm just curious what the best method would be if I'm trying to have a bot running on my Node server that I could play Blackjack against. But for multiple connected clients via sockets, each connected socket will have their own bot to play against but I need some way...

CakePHP Unable to insert to database (datetime format)

database,datetime,cakephp,insert
I was new to Cakephp and I actually following the tutorial of the Blog tutorial however I didn't follow their database and try my own. Currently my database: My Model: class FypCakephp extends AppModel { //Table Name public $useTable = 'Report'; public $primaryKey = 'report_id';} My Controller: public function add()...

Calculations between 2 records of 2 tables need to extend to more then 1300 fields. How and which database can achieve this?

database,postgresql,database-design
For one of our projects we are using PostgreSQL and access two tables with complex SQL calculations due to performance advantages. Each table, lets call them TableA and TableB, have 1301 fields of type double precision (field number restriction by PostgreSQL!) The field names for TableA are: id, A1, A2,...

Database only adds (x) amount of rows before error system resources exceeded

database,vb.net,ms-access
I am having a problem with my code where i am only able to add so many lines of text before i get an error "system resources exceeded". This is my code: Dim x As Integer = MsgBox("Update Record?", MsgBoxStyle.YesNo, "Are you sure?") If x = MsgBoxResult.Yes Then Dim accessconn...

PHP mysql field 1 plus field 2 * 5 wrong result [closed]

php,html,mysql,database,html5
I have a table with 4 fields in MySQL. 1 is product price cost 2 is price we sell 3 is stock of products 4 is earning by unit. Example Cost of product for us 100, Selling price to customers is 120, Stock is 10 The follow code calculate the...

Database object with different data

sql,asp.net,asp.net-mvc,database,entity-framework-6
I'm making a web page in ASP.NET MVC which compares prices from different shops. I have a one-to-many with products and the shops, where the SHOP has one PRODUCT and a PRODUCT has many SHOPs, the problem is that the product is the same but the price is different. Example:...

Group query results by “today”, “in last 7 days”, “in last month” and “older”

mysql,sql,database,group-by,group
I have a simple question related to grouping rows by date with some "narrative" periods. Let's assume that I have very simple table with articles. ID which is PK, title and date. The date column is datetime / timestamp. I would like to group somehow my results so I can...

Using MySQL database twice in the same function returns a 1 instead of actual string

python,mysql,database
I am struggling to understand why I am getting a 1 returned after the second time I use my database in my function. I need to access two different tables to get the information I need. class getSubdivs: def __init__(self): self.con = mdb.connect('localhost', 'root', 'root', 'shannon') self.cur = self.con.cursor() def...

How do I prevent MySQL Database Injection Attacks using vb.net?

mysql,.net,database,vb.net,sql-injection
I am using vb.net in Visual Basic 2010 and using Query to edit my Online MySQL Database from the application (WinForms). Here is a sample to insert a new user into the database: MySQLCon.Open() Dim SQLADD As String = "INSERT INTO members(member,gamertag,role) VALUES('" & memberToAdd.Text & "','" & membersGamertag.Text &...

string split and subquery in mysql

php,mysql,database
first of all i have 1 table in database. 1)tags : id name 1 theme1=test1 2 theme1=test2 3 theme1=test3 4 theme2=test1 5 theme2=test2 6 theme2=test3 And i have bunch of id of tags in array. like 1,3. Now, 1)select name from tags where id=1 result: theme1=test1 (now using wildcard) 2)select...

Speeding up a SQL query with indexes

sql-server,database,performance
I have a table called Products. This table contains over 3 million entries. Every day there are approximately 5000 new entries. which only happens during the night in 2 minutes. But this table gets queried every night maybe over 20 000 times with this query. SELECT Price FROM Products WHERE...

Superuser Role Specific to certain Databases in PostgreSQL

database,postgresql,role,superuser
I have created a User Role with superuser privilege. I have around 30 Databases on my server. I want to assign this role to only only DB. The current role lets the user access all the DBs as super user. How can I restrict him from accessing other DBs as...

Reading a database diagram

mysql,database,diagram
I've been trying to figure out how to get the products that match a certain category id but I have been unable to figure out how to move from category to products. How would a query that basically selects all products that match a certain category id look? ...

In simple RESTful design, does PATCH imply mapping to CRUD's (ORM's) “update” and PUT to “destroy”+“create” (to replace a resource)?

database,rest,http,orm,crud
I'm trying to create a simple REST API and map it to CRUD. I have an ORM (DataMapper) which has methods like create, update and destroy. If I get it right, given a resource {a:'foo',b:'bar',c:'baz'}, performing a PUT {b:'qux'} is supposed to replace the resource and result in the same...

Is there a way to create a primary key and have it cascade into other tables without re-entering data into the new tables?

mysql,database,cascade
I am working on setting up a database and have created tables that cascade out like using the cascade on update for the foreign key. I have two tables being worked with to try to solve this. My tables are like this: create table Item(Item int(4) not null, EquipName varchar(20),...

How I could create a db with the messages that are saved in admin/reports/dblog?

database,drupal,watchdog
I want to create a table in the db with the column message and with values from column message on admin/reports/dblog...Could someone help me? Or take the message from the db but in db the messages are with separated variables :/

Make connection string ADO.NET

c#,database,connection-string,oledb,sql-server-express
How can you make a connection string for an OleDbConnection? I have tried a lot of combinations and variants, but nothing works. I use a MS-SQL platform with C# to make the connection for SQL EXPRESS. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data\Northwind.mdb;User Id=admin;Password=; Data Source=(local);Provider=SQLOLEDB;Initial Catalog=FastCycle;Integrated Security=true Persist Security Info=False;Data Source=Northwind;Integrated Security=SSPI;Trusted_Connection=TRUE;providerName=System.Data.OleDb Provider=SQLOLEDB;Data...

Multiply time with a decimal value in mysql?

mysql,database,stored-procedures
I am trying to multiply a time with decimal value but not to get it right. That is, when I multiply with any decimal value, it is rounding that value to nearest integer and then doing the multiplication. For Example: All the below operations are resulting the same value 1....

Combining two select statements

sql,database,select,where
I have two statements as such: var chgAssociationQuery1 = (from a in sostenuto.PROBLEMS join b in sostenuto.S_ASSOCIATION on a.SERVICEREQNO equals b.FROMSERVICEREQNO join c in sostenuto.Changes on b.TOSERVICEREQNO equals c.SERVICEREQNO where b.FROMSERVICEID == 101001110 && b.TOSERVICEID == 101001109 && a.NAME.Contains(name) select new { ProblemReqNo = a.SERVICEREQNO, ProblemId = a.SERVICEREQID, ChangeReqNo =...

What would be the fastest way to insert this data

mysql,sql,database,performance,csv
Okay, so I have a MySQL table called entries which contains the columns name VARCHAR(255) NOT NULL and address VARCHAR(255) The table has about a million sets of data. For every set of data, name has a value e.g. "john" whilst address is NULL. For example: +------+---------+ | name |...

How connect database class with an array connect

php,database,database-connection
How can i connect into another script my database class function? I need to make it without change every file with the connection file. Here is my config file(conn.php): define('DB_HOST', "localhost"); define('DB_TYPE', "mysql"); define('DB_USER', "user"); define('DB_PASS', "123456"); define('DB_NAME', "dbuser"); Here is the config I need to change to the DEFINE...

Memsql, Is it possible to add more leaf nodes on the same host machine?

database,cluster-computing,memsql
I installed a functional test with Memsql on a machine with an aggregation node on port 3307 and a leaf node 3306. As queries being ran, there might be additional cpu available. Hence, is it possible to add more leaf nodes on the same machine to take advantages of available...

Using a case statement to set the values of declared variables

sql,sql-server,database,tsql,case
I wanted to know if its possible to set the values of declared variables by using a case statement. example: CASE WHEN fieldValue ='stringValue1' THEN SET @DeclaredVar1 = 100 END ...

Using onUpGrade with multiple versions of App to add columns

android,database,sqlite
I have versions 4,5 out in production for my application. Between 4 and 5 I added new columns to my app's database adapter using the alter statement: public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { //add new columns String alter = "ALTER TABLE " + DATABASE_TABLE + " ADD...

Why does the date doesn't match with what I have inserted into the database?

sql,database,oracle
I tried to display the sqlcommand after I saved into the database. Everything seemed to work pretty fine, but when I opened my table from TOAD, the dates are wrong. Here is my sql command: INSERT INTO USERTASK (USERTASKKEY, USERID, TASKKEY, TASKDATE, CREATEDATE, CREATEUSERID) VALUES (USERTASKSEQUENCE.NEXTVAL, 'admin2', '1', TO_DATE('05-06-2015','yyyy/mm/dd HH24:MI:SS'),...

docker run local script without host volumes

database,shell,docker,docker-compose
The goal is to add data to my database server containers of a multi-container web app from a download using curl once the database containers are running. I can do this from docker-compose.yml or from docker run independent of the web app, as long as I use host volumes. How...

what is the SQL prepared stament for lo_import in postgreSQL

c++,sql,database,postgresql,odbc
In postgreSQL we have option to import the file into database using lo_import method, which returns a OID using that we can export the file from database to the filesystem. eg: describe test table name text, file_id oid insert into test values('arul_test',lo_import('/home/arul/test.txt')); prepared statement would be insert into test values(?,?);...

echo both users

php,mysql,sql,database,loops
The code at the bottom of this post currently echoes: Name: Spongebob Squarepants Description: I live in a pineapple under the sea. Role: editor But there are two users in "wp_usermeta". It's only echoing one. The result needs to look like this: Name: wp_dev_05 Description: My name is Chris Topher!...

Android :: SQLIte Db don't insert the datas

android,database,sqlite
I've a problem! I've a quiz app with few questions what generated from the code, but I make an Activity, where I can put some questions to the other in an SQLite Db from the running program. I write an insert code, but when I load the SaveDataActivity, fill the...

Order by count not sorting the records correctly?

php,mysql,database
I am using MySQL. I have two table i have attached the images of the both tables? When i apply ORDER by Count then the query retrieving result's from database but not sorting them correctly, i don't know what wrong i am doing? i searched some similar question in stack...

How to copy all database users from one database to another [closed]

sql,sql-server,database
I am making a database from a backup file (I'll call this db 1) and I need to duplicate the users of one database (and this db 2) to the newly restored database. The first step I know must be done is to delete all the existing users in the...

How to calculate number of days by subtracting date_time field from current date_time?

sql,database,ms-access,ms-access-2007
I have reservations table to store hotel reservations, this table has reservation_id, customer_id, rommno, and checking date also there is another optional field, checkout field which will use when person checked out and also the status field will updated to checkout status wile firstly putted checking status. i need a...

Complex SQL with Multiple Joins

mysql,database,join
I have a database of politicians, political parties and candidacies for a post in the election. The database consists of the following tables: People, Groups, Candidacies and Posts. The Candidacies table is a join relationship between People and Groups. Each record in the Candidacies table represents a candidacy in the...

get information in database and insert into session codeigniter

php,database,codeigniter,session
i am new to codeigniter and using session. i am having a problem in inserting individual data in session. Model: function get_user_info() { $user_email = $this->input->post('signin-email'); $this->db->select('acct_id, acct_fname, acct_lname, acct_mname'); $this->db->where('email', $user_email); $query = $this->db->get('account'); return $query->result_array(); } Controller: public function LoginValidation(){ $this->load->library('form_validation'); $this->form_validation->set_rules('email', 'Email',...

ElasticSearch asynchronous post

database,post,asynchronous,elasticsearch,get
I'm posting data on my ElasticSearch database. I've noticed that data is not immediately available, it requires some milliseconds to show up in a GET request. I can live with that (after all, the calls are asynchronous so this behavior is expected) but in my test code I need to...

creating stored procedure in mysql calculate profit from product table

mysql,sql,database,stored-procedures
My following code show some error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN SET @v1:= (select sum( cost_price * current_stock) from product)' at line 2 CREATE PROCEDURE sp_profit BEGIN...

Does MongoDB find() query return documents sorted by creation time?

database,mongodb,sorting
I need documents sorted by creation time (from oldest to newest). Since ObjectID saves timestamp by default, we can use it to get documents sorted by creation time with CollectionName.find().sort({_id: 1}). Also, I noticed that regular CollectionName.find() query always returns the documents in same order as CollectionName.find().sort({_id: 1}). My question...

findOrFail laravel 5 function for specific filed

database,laravel,view,eloquent
This is my code: $get_all = Geo_Postal_us::findOrFail($postal); With this query,laravel try to find ID filed in table. I don't have id filed, for primary key i have postal column. So, how to set function to find value in postal column, not to search from id column ? Thanks,...

HQL order by expression

java,sql,database,hibernate,hql
I have two persistent classes, Comment and Vote. A Comment can be associated with many Votes and there is a @OneToMany - @ManyToOne relationship between them that's working correctly. What I'm trying to do is to sort the comments by most upvotes. A Vote is an upvote if Vote.up column...

How to store the content for android application

android,database,sqlite
I'm a complete newbie in android development with some basic programming knowledge. Right now, I want to develop an E-Commerce app which allows the user to upload pictures for the public to browse through. However, I have no idea how should I store all the data, including the details(username and...

MySQL: Select several rows based on several keys on a given column

mysql,sql,database
I have this mysql table structure: ------------------------------------ | item_id | meta_key | meta_value | ------------------------------------ 159 category Bungalow 159 location Lagos 159 price 45000 160 category Bungalow 160 location Abuja 160 price 53500 ... 350 category Bungalow 350 location Lagos 350 price 32000 What I'd like to do is select...

Extremely basic SQL Misunderstanding

mysql,database
I'm preparing for an exam in databases and SQL and I'm solving an exercise: We have a database of 4 tables that represent a human resources company. The tables are: applicant(a-id,a-name,a-city,years-of-study), job(job-name,job-id), qualified(a-id,job-id) wish(a-id,job-id). the table applicant represents the table of applicants obviously. And jobs is the table of available...

Golang ORDER BY issue with MySql

mysql,database,go
I can't seem to dynamically ORDER BY with db.Select(). I've Googled without any luck... WORKS rows, err := db.Query("SELECT * FROM Apps ORDER BY title DESC") DOES NOT WORK rows, err := db.Query("SELECT * FROM Apps ORDER BY ? DESC", "title") I'm not getting any errors, the query simply fails...

ODBC ISAM_EOF without any reason

c#,database,odbc,cobol
I have a strange behavior with an ODBC Driver and the underlying COBOL database. The database driver is acuODBC of AcuCorp(now Microfocus), the database itself is a COBOL database. The DSN is a system DSN and works just fine. Via Access/Excel u can read/write data with the DSN successfully. In...

How To Get the Sum of a Column within a given Date range in a Table and Update a particular Cell in The Table with The Sum in TSQL?

sql-server,database,tsql,stored-procedures
I have a Table named PersonalLedgerForTheiftFundAndShareClone I want to get The Sum Of TInterest ( TheiftFundInterest ) within The Date Range Of 2014-03-31 00:00:00.000 To 2015-03-31 00:00:00.000 For each Employee and Then Update The TInterest with The Sum Where Date is 2015-03-31 00:00:00.000 For that Specific Employee. I Have Written...

Elasticsearch and C# - query to find exact matches over strings

c#,.net,database,elasticsearch,nest
I need a way to search documents using a plain exact match over two or multiple fields which are of type "string" and "integer". I'd like to avoid standard query as I don't care about scoring or best match, just a yes/no outcome if both the fields match or not....

SQL checking for NULL fields

php,mysql,database,pdo
SOLVED: I knew there were fields that were empty that should have caught the check, but they were empty rather than NULL. So, when I was checking for NULL fields, it didn't find any. I'm trying to check whether elements in a row with a specific name have any blank...

Foreign key in C#

c#,sql,sql-server,database
I have two tables, A and B, in a dataset in SQL Server; I have created a connection to the dataset in a c# project in visual studio. How can I create a foreign key ( A is the parent) between my two tables ? I want to create the...

Does Maria DB support ANSI-89 join syntax

sql,database,join,syntax,mariadb
Does Maria DB support ansi-89 join syntax? SELECT sites.site_id, sites.site_name, pages.page_id, pages.page_title FROM sites, pages WHERE sites.site_id = pages.site_id; or only ansi-92 syntax? SELECT sites.site_id, sites.site_name, pages.page_id, pages.page_title FROM sites INNER JOIN pages ON sites.site_id = pages.site_id; ...

Access Database Total Field not calculates empty records?

sql,database,ms-access-2007,ms-access-2010
My Query Result is as below Query: SELECT reservations.customerid, (SELECT SUM(balances.balance) FROM balances WHERE balances.customer_id = reservations.customerid) AS Preveious_balance , (SELECT SUM(services.Amount_due) FROM services WHERE services.customer_id = reservations.customerid AND services.status=0) AS Service_due , (SELECT SUM(foods.Amount_due) FROM foods WHERE foods.customer_id = reservations.customerid AND foods.status=0) AS Food_due, ((due_nights.Due_nights - reservations.billed_nights) * rooms.rate)...

Extracting data from Excel to Access Database

database,excel,ms-access,ms-word
There is a standard company form currently in Word format (could use a different technology) with fields. How do I extract the data into my Access DB from this fields?. I am also open to advice of which technology would suit my requirements better with the requirements being: Need document...

Sharing database between android and windows phone

java,android,database,windows-phone
I have application developed by different apk/api, I have version java Desktop application and Android Application and Windows phone 8.1 Application , My problem that the three version use the same database to access it can modify and insert ..etc how i create shared database between them to use the...

Check if value exists in MySQL DB in Java?

java,mysql,database,jdbc
I'm creating a game right now that stores quest values into a DB when a player completes his or her quest. The issue I'm having right now is writing a method that searches the MySQL table for the player id and the quest id to check if he or she...

replacing vales in one table with values from another table using multiple criteria

sql-server,database,sql-update,inner-join
I have two tables, one called accajd, which a screenshot of is shown below, which has the old and new values in it. and one called jobcost with about 15 fields, 3 of which need to be updated with the data from the accadj table (accno, jno, and saccno). What...

Is there a way to implement a wcf service connected to a database without paying for azure?

database,wcf,azure,windows-phone-8
It seems like everything that I read is saying that for Windows Phone 8 Development, in order to create a database that connects to my WCF Service, I need to pay for it (Azure). Is that the truth? I want to create a database that my mobile app can access...

Dgrid - Display label for number (i.e. 02 = Cat) I want to display Cat - not the number

javascript,database,dojo,dgrid
In my Dgrid I have a column that displays the code (in number format) for an event. enter image description here I want to display the label not the number in the dgrid. So if 1 = Cat. In the database it shows as a 1 - but I want...

Pull information from SQL database and getting login errors

php,sql,database
I am creating a very small, simple CRM for a company, they require the function to be able to view the last 25 orders via the dashboard. The orders are added via a Order-add form within the CRM. When adding the following code to the CRM I get an error:...

Copying (Cloning) DB to another Vertica Cluster with Different no. of Nodes and Different IP Addresses

database,database-migration,vertica,database-cloning
I have this requirement where I have to copy the complete DB from a single node installation to a 2 nodes cluster of Vertica. As per the documentation this is not possible. Are there no workaround methods for performing this? We may not always have same no. of nodes in...

Python Sqlite3: Create a schema without having to use a second database

python,database,sqlite,sqlite3
I would like to create a schema for a sqlite3 database in python, but sqlite does not appear to support CREATE SCHEMA (sqlite docs). I've looked into ATTACH, and it seems like it would do the job by using a second database but I only need one database that has...

SQLITE_BUSY error in iOS application

ios,database,swift,sqlite3
I am writing an iOS application to allow medical doctors to select diagnoses codes from a database and bill patients that are also in the sqlite3 database. The main page is a form that asks for the patient name and date of birth. Also on the main page is a...

SQLite: Individual tables per user or one table for them all?

database,sqlite
I've already designed a website which uses an SQLite database. Instead of using one large table, I've designed it so that when a user signs up, a individual table is created for them. Each user will possibly use several hundreds of records. I done this because I thought it would...

SQlite foreign key logic

database,sqlite
I am using SQlite and the PK column seems to be auto-incrementing. I am a bit concerned about following approach where I want to normalize the type-column: Table: Book id type name ... ... ... 15 1 Foo 16 2 Bar ... ... ... Table: Type id typename 1 magazine...

How to update SQL table from other table when they are on different servers

sql,sql-server,database,merge,sql-update
I've already run the following command to include another server instance. EXEC sp_addlinkedserver @server='Server' Now I'm trying to synchronize these databases using this: UPDATE [Server].[ServerDB].[dbo].[tableName] SET [Server].[ServerDB].[dbo].[tableName].[columnName] = [LocalDB].[dbo].[tableName].[columnName] FROM [Server].[ServerDB].[dbo].[tableName], [LocalDB].[dbo].[tableName] WHERE [Server].[ServerDB].[dbo].[tableName].id = [LocalDB].[dbo].[tableName].id This gave me the following error: The objects "LocalDB.dbo.tableName" and...

C# Storing player cards Database Design

c#,mysql,sql,database,database-design
I'm having really hard time figuring out how to store cards each player owns in SQL database. My bets idea so far is to have one table with cards: [id], [cardName] And to associate it with players like that: [id], [playeName], [cardId], [quantity] This setup will allow me to easly...

How To Implement A Recent History Table

mysql,database
I have an app where you can select a person from a list to view more details. Now each time a person is selected to view more details, I want to record that in a recent history table. I'm not sure the best way to approach this to have say...

Difference between dba_SEGMENTS and dba_data_files

mysql,sql,database,oracle11g,oracle-sqldeveloper
Shouldn't these two queries give the same result? First is a sum of all segments while other is the sum of all data files. They are giving different results for me. While the first one gives me 149522MB, the other gives 214973.34 MB select sum(bytes)/1024/1024 MB from dba_segments; select sum(bytes)/1024/1024...

How to rename a database in Web SQL?

sql,database,rename,web-sql
Is there a way to rename a database in Web SQL? I need a simple way to backup all data to another Web SQL database.

ElasticSearch - how to get the auto generated id from an insert query

c#,mysql,database,elasticsearch,nest
On my ElasticSearch database I need to get the autogenerated id from my insert query (I'm using .NET C#). How to do it? I tried debugging the readRecords response but I didn't find such id. Basically I need the equivalent of the MySQL LAST_INSERT_ID() command. var readRecords = elasticClient.Search<HistoryRecord>(s =>...

Desktop Database with Server without installation

java,database,server,desktop,h2
i have Java-Application that growth a lot over the past month. All configurations from the programm and all the logs are stored in .txt or .log files. The programm should change now. The user could install the programm on his own pc but the programm itself should get all the...

select data according to Row in Sqlite

android,database,sqlite,android-sqlite
image i want to get the whole row i am using this code to get my desired data but its giving me null pointer exception at temp_address1 here is the code as in mentioned image i want to get the whole row matching phone number. how can i achive that...

PreparedStatement.executeUpdate() doesn't insert in sqlite database

java,database,sqlite
i'm trying to make a DAO class for my Java project. I've a SQLite Database with only one table "USER". The schema is: CREATE TABLE USER( username VARCHAR(20) NOT NULL PRIMARY KEY, password VARCHAR NOT NULL, total_matches INTEGER DEFAULT 0, victories INTEGER DEFAULT 0, times_alien INTEGER DEFAULT 0, times_human INTEGER...

Creating a generic / abstract “DBContext” Class for shared functionality among different DBs

c#,database,generics,inheritance,abstract-class
I am working on a C# project that is pulling data from SQL Server, ODBC data-sources and Oracle Databases at different times. At this point, I have created 3 different classes - Once for each type of DB access. However, I am seeing that 95% of the code is identical...

Id in database using qt

database,qt,sqlite
I am new to qt. I have created a table in sql, and what I'm trying to do is to give an id whenever user adds data. For the first thing inserted it will be 1, second 2 and so on. So how to check what number was the last...

Working with multiple rows from a MySQL query

php,mysql,database,pagination
Before I begin, I want to point out that I can solve my problem. I've rehearsed enough in PHP to be able to get a workaround to what I'm trying to do. However I want to make it modular; without going too much into detail to further confuse my problem,...

normalization of database structure

mysql,database,database-design,database-schema
I was reading the concept of normalization of database structure. I got confused with the following situation in my project. I have two tables "TableA" and TableB Both tables are independent of each other and have no realtionship at all They represent completely different data Both the tables will have...

IBM Cognos _days_between function not working

mysql,database,date,cognos
I'm having an issue with Cognos 10. I'm trying to calculate the number of days between to dates so I use the _days_between( date1, date2 ) function. _days_between ([Derniere Date Changement diaphragme] , [Premiere Date Changement diaphragme]) I'm quite sure the two Dates are Date objects ( I set them...

Export database from a remote server into a specific folder on my computer

php,mysql,database,shell,command-line-interface
I'm having trouble with a database export that is too big for phpmyadmin to handle. I'm curious what the syntax would be for exporting a mysql database from a remote server and getting the export file into a specific folder on my own computer, all using the command line. Say...

Displaying MySQL results in a single table

php,mysql,database
I created an interface in which the user can choose which results are going to be displayed. The options selected by the user are saved in an array, so the MySQL query goes through the different elements of this array. So I want to display the results in a single...

Purging Database - Count purged/not-purged tables

mysql,sql,sql-server,database,stored-procedures
So I am working with a database where I will be purging various tables that contain rows that are older than 30days. I have fairly limited knowledge of SQL and wanted to know if there was a certain way to select the row that will be purged and the rows...

Return One value if more than one Exsist

android,database,sqlite,android-sqlite
if i have same values in a column and i want to return only one instead of all of them what would be a method. ArrayList<String> getAllNotes() { Cursor cursor; mDbHelper = mSqliteHelper.getWritableDatabase(); String query = "SELECT * FROM " + SqliteHelpers.TABLE_NAME; cursor = mDbHelper.rawQuery(query, null); ArrayList<String> arrayList = new...

Property “CHasOneRelation.limit” is not defined

php,database,yii
How to get rid of this error: Property "CHasOneRelation.limit" is not defined. here is my relation method: public function relations() { return array( 'documents' => array(self::HAS_MANY, 'Document', 'dossier_id',), 'lastLogline' => array( self::HAS_ONE, 'Logline ll', 'dossier_id', 'limit' => 1, 'order' => 'll.create_date DESC'), 'lastmodifiedUser' => array(self::HAS_ONE, 'User', 'lastmodified_user_id',), 'loglines' => array(self::HAS_MANY,...

SQL Server: checkident: “[S00014][2560] Parameter 3 is incorrect for this DBCC statement.”

sql-server,database
Using an SQL Server database. A lookup table is having 50 new items added to it using a database versioning tool so the same script will be run on all three databases. There is a Dev, QA, and Prod version of the database and because of political reasons prod can't...

How to connect and access mssql Database server from Android app? [closed]

android,sql-server,database
I am developing an android application, in that application i simply created login page in that login page i need to load mssql database for login. Please tell the solution and example coding for this one

Pandas sql update efficiently

python,database,pandas
I am using python pandas to load data from a MySQL database, change, then update another table. There are a 100,000+ rows so the UPDATE query's take some time. Is there a more efficient way to update the data in the database than to use the df.iterrows() and run an...

System.ArgumentOutOfRangeException in For loop due to entry deleted from database. Help fix it

database,vb.net,for-loop,indexing
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim TimeNow As DateTime TimeNow = DateTime.Now With ReservationTableDataGridView For i As Integer = 0 To (.Rows.Count - 1) ListView1.BackColor = Color.Black Dim ToBeTested As DateTime ToBeTested = (.Rows(i).Cells(1).Value) # Console.WriteLine(ToBeTested) If ToBeTested > TimeNow.AddMinutes(45) Then Me.ReservationTableTableAdapter.Delete((.Rows(i).Cells(4).Value), (.Rows(i).Cells(1).Value), (.Rows(i).Cells(2).Value), (.Rows(i).Cells(3).Value))...

ER diagram for booking database

database,database-design
I'm creating a database for booking apartments app. I have a question - it is allowable to keep user's passwords in DB (for example using BCrytp)? Another question - where is the best way to keep price if it may vary during several months?

Hikari connections and active AS400 jobs

java,database,ibm-midrange,hikaricp
I am using Hikari connection pool manager to query some tables in an AS400 machine. I've set a minimum of 1 connection pool connections and a maximum of 10. I am querying 5 tables at the same time. The problem is that despite using HikariDataSource getConnection() method before querying and...

What are Relational Objects?

database,jpa,persistence
I am referring to this http://www.tutorialspoint.com/jpa/jpa_architecture.htm for learning JPA ,Here a table is given In query row what is relational object they are referring to? Are they the objects of entity classes which I am making or something else....

How to use existing SQLite database in swift?

ios,database,xcode,sqlite,swift
I know there are some resources available for this but none of them clearly show the way how to do it properly. I have already populated .sqlite database (MTrader.db) and i want to connect it to my swift project and load the data from the database into spinner. I tried...

Why am getting this error?: Unknown column 'firstname' in 'field list'

php,database,mysqli
if(isset($_POST["submit"])) { // Details for inserting into the database $id = htmlentities($_POST["id"]); $firstname = htmlspecialchars($_POST["firstname"]); $lastname = htmlspecialchars($_POST["lastname"]); $username = htmlspecialchars($_POST["username"]); $password = htmlspecialchars($_POST["password"]); // Dealing with inserting $query = "INSERT INTO `myDatabaseForAll`.`users` (`id`, `firstname`, `lastname`, `username`, `password`) VALUES (NULL, $firstname, $lastname,$username,$password)"; $result = mysqli_query($connection,$query);...

Prevent upvote model from being called for every comment

ruby-on-rails,ruby,database,performance,model
I have three models: User, Comment and Upvote. User-to-Comment has a one-to-many relation, Comment-to-Upvote has a one-to-many relation and User-to-Upvote has a one-to-many relation. I want to do something similar to the upvoting done on Stackoverflow. So when you upvote/downvote the arrow will highlight and remain highlighted even if you...

How to add +1 value to php

php,html,ajax,database
So I am making a pie chart with only PHP and Ajax. But I can't see how I must code further to make it work (see the first picture). So when someone clicks on button A B C or D, it must be seen (without page loading) that you have...

SimpleMembershipProvider WebSecurity.InitializeDatabaseConnection The login from an untrusted domain

asp.net,database,exception,model-view-controller
I export the database to the server and i've problem. When I start application i see this error An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. WebSecurity.InitializeDatabaseConnection("DefaultConnection",...

If I export my database with phpmyadmin will it lock my tables or take my database down?

mysql,database,phpmyadmin
I want to create a backup of my database using the phpmyadmin export function. the database can't have any down time so I need to know if running a database export will take the database down? I've looked on-line but all I get is instructions on how to export. No...

Improving work with SQL DataTime

sql,sql-server,database,tsql
I have a business in my Date. I need change date below for each date before 25 of each month I want get 25 of month before and for each date after 25 of each month I want get 25 of the same month. Example : for 2015/06/24 (or 2015/06/06)...

sql script to find index's tablespace_name only

sql,database,oracle
Trying to find the specific tablespace names that were created for indexes only. I don't want to see the tablespaces names that are already used for tables. Something like below, but i couldn't have it working due to syntax error. Can someone fix it? select tablespace_name from dba_indexes where tablespace_name...

Getting Multi Rows in Database and transferring it in a multiline textbox in VB.net WinForms

database,vb.net,winforms,textbox
Here in my code, i have a database which has table of my applicants. As you will see in the code below, i want to get the number of rows from my command text and transfer it to the string "abc" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...

Does rails set anything in a mysql database?

mysql,ruby-on-rails,database
Basically, if I have two rails applications, with different database.yml settings, both connecting to the same database, will they conflict with each other? Or is database.yml specific to the local application? Essentially, does rails create just a raw database connection like mysql workbench would? Or is there more to it?...