database

Mongoimport ignore leading zero in csv

我们两清 提交于 2021-02-17 05:13:19
问题 I have a .CSV export file from a SQL Server database, with a phone number field (number type) that field values started with leading zero. Leading zero is presented in the CSV file. When I attempt to mongoimport it to DB (in string type) I find data imported without leading zero. The target field number is string. How can I solve this problem? 回答1: you can specifically define the type of the field using the import option --columnsHaveTypes Instructs mongoimport that the field list specified

Problem with modifying an MSI database property

亡梦爱人 提交于 2021-02-17 05:12:30
问题 I need to modify the UpgradeCode property of the Upgrade MSI table via C#. This code works ok with other tables' properties, but throws an error when I'm trying to modify these. using (var database = new Database(TEMPDATABASE, DatabaseOpenMode.Direct)) { string upgradeCode = Guid.NewGuid().ToString("B").ToUpper(); database.Execute("Update `Upgrade` Set `Upgrade`.`UpgradeCode` = '{0}'", upgradeCode); } The error is: Microsoft.Deployment.WindowsInstaller.InstallerException: 'Function failed

Creating table via SQL Command Line, invalid identifier

橙三吉。 提交于 2021-02-17 03:31:18
问题 I'm currently learning SQL and I've installed oracle 11g express on my system. I'm trying to create a table however when I try to run the below command I get the following Error Message: ERROR at line 3: ORA-00904 : invalid identifier CREATE TABLE PROJECTS ( proID NUMBER(4) NOT NULL, Desc CHAR(20), sDate DATE, eDate DATE, Budget NUMBER(7,2), maxStaff NUMBER(2) ); Can anybody please tell me what I'm doing wrong? Thanks for all the replies, I ran this command succesfully: CREATE TABLE PROJECTS

Changes to database session context persists with pooled connection reuse

流过昼夜 提交于 2021-02-17 02:47:45
问题 In my application, I have a connection pool that I use to obtain connections to Oracle database. I need to execute statements that call stored procedures that might affect the database session context/variables so that these changes affect only the current use of the connection. When I close the connection and obtain another connection from the pool, I want it like a new connection/session at which the effect of the procedure doesn't exist. Unfortunately, this doesn't happen. So I obtain a

Oracle Database, SQL Update statement will not work (OLEDB)

别等时光非礼了梦想. 提交于 2021-02-17 02:46:10
问题 I set a numeric primary key, and an alphanumeric field that stores truck FINS, which is just a random mix of numbers and letters. I do not generate the fins, these fins will always be the same as it's the truck fleet identification number. Here is the code view: storeTruckSplit = truckSplit[1];//Stores truck FIN //Update truck value try { conn.Open(); OleDbCommand command; command = new OleDbCommand( "Update Trucks" + " SET Trucks.TruckInUse = ? WHERE TFIN = " + storeTruckSplit.ToString(),

Power BI Report with Bridge Table

≡放荡痞女 提交于 2021-02-17 02:42:30
问题 I am trying to use Power BI with my SQL DB. We have a three layer structure A Main table, with information about the year and unique key for each firm A bridge table which an information about the type of the firm Many end Tables with information about sales and stuff On some occasions these end tables are jointly used by different firm types and some only by one firm type. When I load the tables into Power BI all the relationships are correctly imported and I was expecting no issue to create

import text file to Access 2003 database using Python

故事扮演 提交于 2021-02-16 21:22:36
问题 I'm trying to import a pipe delimited text file into an access database with an existing table using a Python 3.4 application I'm working on, but I'm having some trouble. The application will be used to import different text files so I'm using an entry widget to write in the filename and I want the contents of the file entered to be loaded into my table. I tried loading the file into the able just using access and it worked fine so the formatting should be good. Below is some of the code I've

how to save only time not date in database through sql query

百般思念 提交于 2021-02-16 15:31:28
问题 this query is saving complete date and time. but i want to save only time not date in database. is there any query to do this? update table set current_time=now(); 回答1: Your column must be set to either DATETIME or TIMESTAMP. If you use the TIME type then your query would work as expected. If you are using any other type of column then you could use CURTIME() method or CAST(column AS TIME) as mentioned by other answers, however this would use more space on disk, and make for much slower

MySQL application users vs database users

别等时光非礼了梦想. 提交于 2021-02-16 13:43:47
问题 Unfortunately this question may be a little broad, because I can't work out the proper terms to help me bring all this together. I'm very new to php/SQL, and I'm attempting to set up a minimal site with very simple login/register functionality. Should I be creating a new database user whenever I register a new web user? Are CRUD privileges safe to give to all users of the website? Should I actually make a DB user for registering, one which can only insert into the user table and nothing else

Explain SQL query using UML diagram? [closed]

让人想犯罪 __ 提交于 2021-02-16 13:38:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 days ago . Improve this question I have to present some complex queries and PL/SQL codes to people who don't know anything about my project. I need to explain how tables are connected, how conditions are affecting the outcome, joins, loops, etc. Is there a way to document this SQL and PL/SQL