w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » DATABASE » Page 1
How can i give SECADM to instance owner in DB2?
Original database authorities and privileges are restored from the backup image, so by default your new instance owner ID does not have any special privileges apart from those inherited from PUBLIC. Prior to restoring the database set the DB2 registry variable db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON and restart the instance. After the restore the authorization ID performing it will be grant

Categories : Database

Remote Oracle connection
Depending on your privileges, and on the version of Oracle you're on, one of the following should give you the server name: select sys_context ('USERENV', 'SERVER_HOST') from dual; or select host_name from v$instance; If this works, bear in mind it may well be the first step in a frustrating process that ends with you banging your head against your desk before calling your DBA and network/

Categories : Database

NoSQL best practice : should I save derivative (calculated data) as it is used in app?
It's a balance between over-denormalizing and having an efficient structure in terms of space and complexity (re keeping everything in sync if you do denormalise). Start with your user stories, the query patterns this will dictate what information is needed in a single document. It sounds like this is how you've done it anyway. Embedded sub-docs which you make calculations on during entry. K

Categories : Database

Find duplicate records in MongoDB
You can find the list of duplicate names using the following aggregate pipeline: Group all the records having similar name. Match those groups having records greater than 1. Then group again to project all the duplicate names as an array. The Code: db.collection.aggregate([ {$group:{"_id":"$name","name":{$first:"$name"},"count":{$sum:1}}}, {$match:{"count":{$gt:1}}}, {$project:{"name":1,"_id"

Categories : Database

Laravel orWHere function
Either use an orWhere filter: if (isset($input['filter']['color'])) { $query->where(function($query) use ($input) { foreach ($input['filter']['color'] as $color) { $query->orWhere('color', $color); } }); } Or just use whereIn: if (isset($input['filter']['color'])) { $query->whereIn('color', $input['filter']['color']); }

Categories : Database

Populating a TableView with data from Database JavaFX
There seem to be many errors in your code. First, you have made artistTable static. Don't do this - it makes no sense at all, and static fields won't be injected by the FXMLLoader. This is why you are getting the null pointer exception. Second, the value you pass to the PropertyValueFactory ("Artist") does not match the name of any property in your model class Artist. (I.e. there is no ArtistPro

Categories : Database

I need an event fired after successful export on DataTables 1.10
See the documentation. Below an example with Excel-button : ... "oTableTools": { "aButtons": [ { "sExtends": "xls", "fnComplete": function ( nButton, oConfig, oFlash, sFlash ) { alert( 'Excel-export complete' ); } } ] } ...

Categories : Database

Monitor Start-AzureSqlDatabaseCopy in Azure powershell cmdlets
You can check the percentage as below. Start-AzureSqlDatabaseCopy -ServerName $SourceServerName -DatabaseName $SourceDatabaseName -PartnerServer $TargetServerName -PartnerDatabase $TargetDatabaseName $i = 0 do { sleep -Seconds 5 $check = Get-AzureSqlDatabaseCopy -ServerName $TargetServerName -DatabaseName $TargetDatabaseName $i = $check.PercentComplete } while ($i -ne $null)

Categories : Database

Spring REST - /account/{id} - access only for user who exists in database
I think you can write Interceptor or filter for it,like below. <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/controller1/path1"/> <mvc:mapping path="/controller2/path2"/> //other controller path <bean class="com.test.interceptor.UserInterceptor" /> </mvc:interceptor> </mvc:interceptors> Then in

Categories : Database

Cypher - How is negation handled?
I got an answer to this question on LinkedIn which can be found here: https://www.linkedin.com/groups/Does-anybody-know-similarities-differences-2623939.S.5939804856381382658 The answer below refers to this query: MATCH (n:Asteroid) WHERE NOT n.name = 'Ceres' RETURN n LIMIT 25 The answer is as follows: There are two answers to your question regarding negation: (i) The negation of

Categories : Database

How to migrate my database backup which is in ".txt" file to my new Rails App?
If you have those values separated by comma(,), you could use CSV to import them to your new rails database. Put your file in a directory under db, in the following example I called 'data'. You must edit the file seeds.rb that lies in your db directory and put something like this: require 'csv' CSV.foreach(Rails.root.join("db/data/<yourfile>.csv"), encoding: "ISO-8859-1", headers: true, co

Categories : Database

Oracle DB query - joining two tables
1- It's better to use inner join for this case, because every record in table 1 has a id in table 2. 2- In left outer join case you can also get result with Table 1 has record that's not exists in Table 2. Final query is like this : select t1.ID, t2.UserID, t1.Name, t1.Action, t1.IPAddress from Table1 t1 inner join Table2 t2 on t1.ID =t2.ID

Categories : Database

Dataset size for recommendation algorithm
As reported in this post, there are some guides or rules-of-thumb that could be used for preparing sufficient data for the model. Some of the advice here included: At least six times the number of features as training cases At least three times the number of features per class Please note that these are only rules of thumb, and may or may not be enough depending on the complexity of your data

Categories : Database

Hierarchical database model
Your question sounds like a case of class/subclass. In object modeling, the design uses the fundamental mechanism of inheritance, and the design pattern of subclasses that extend and revise superclasses. Relational modeling is different from object modeling, and table design is different from object design. There are a couple of techniques that help bridge the gap. There are two tags in this

Categories : Database

Generating cursor query dynamically
You query is just accepting a value dynamically, and not a Dynamic SQL itself. DECLARE l_emp_id number(12); /* Don't use the column name itself as variable name */ CURSOR empList_cur is select emp_id from employee; BEGIN LOOP FETCH empList_cur Into l_emp_id ; EXIT WHEN customerList_cur%NOTFOUND; FOR I IN (select empDetails from empDet where empNo=l_emp_id)

Categories : Database

how to identify quantity of an entity
1) you can add another attribute name pro_qyt, where your quantity on product will store, 2) you can increase or decrease a column value using query but if the attribute has a numeric value.. 3) yes you can change the attribute using SQL after making a Database and decrease in quantity of a product. 4) It's depend on you, you can also make a 4 or more digit random key using php that can unique

Categories : Database

Database Table repeat of data in rows
I think your basic design is fine. Repeating rows is a natural consequence when you normalize a database so that each table only holds information about an entity and you model a many-to-many relationship such as employees and competencies/levels, and jobs and competencies w/ proficiency levels. This design makes it easy to add new requirements - you only have to add new rows in the job requiremen

Categories : Database

Haskell strongly typed data bases
Bartek's comment pretty much answers the question (if you come up with a better one please write your answer): According to hackage Web/Databases and Persistence page, there is ACID-state and happstack-state.

Categories : Database

How to write a SQL command to move all old data from access table into another database/table?
There is no MOVE command but you can copy the records across to the target and then use a similar query to remove them from the source when you are sure you have no Paste Errors. INSERT INTO MyArchive (fld1, fld2, fld3, fld4) SELECT fld1, fld2, fld3, fld4 FROM MyTable WHERE fld4 < DATEADD("y", -5, Date()) That copies across everything older than 5 years. After confirming the transfer, DELET

Categories : Database

Why are foreign keys stored in child items rather than parent items in a database
The idea is to be able to add new things to the old without modifying them. Suppose you have a client with names and addresses, then you add transactions. Transactions shouldn't modify the client. Then you add special orders for the client and so on. You shouldn't have to modify client table for all of those. Code should work the same. This is a core principle of oop called coupling/cohesion

Categories : Database

How to merge dating correctly
Is there a reason you put those underscores after ID__? Otherwise, the code you provided will work An example: dat1 <- data.frame("ID"=seq(1,20,by=2),"varx2005"=1:10, "vary2005"=2:11) dat2 <- data.frame("ID"=5:14,"varx2006"=1:20, "vary2006"=21:40) # create data frames of differing lengths head(dat1) ID varx2005 vary2005 1 1 1 2 2 3 2 3 3 5 3

Categories : Database

Count from multiple fields in a record
No way I can think of that's pretty... You would have to create a query, add all your fields to it, and then add this at the end: Med2: IIF([No1.Median] = 2, 1, 0) + IIF([No2.Median] = 2, 1, 0) + IIF([No3.Median] = 2, 1, 0) + IIF([No4.Median] = 2, 1, 0) + IIF([No5.Median] = 2, 1, 0) + IIF([No6.Median] = 2, 1, 0) Then add another field like this: Med3: IIF([No1.Median] = 3, 1, 0)

Categories : Database

What would be the best database server to store value of PI?
This may be taking you in the wrong direction but... Using MySQL seems to be a high-overhead way of solving the specific problem of finding a string in a file. 100M digits, 8 bytes each, is only 100MB. In Python, you could write the file as a sequence of bytes, each byte representing an ascii number. Or, you could pack them into nibbles (4 bits will cover digits 0-9). In Python, you can read th

Categories : Database

Is it okay for the foreign key field to have a different name than the field it references in the other table?
Yes it is ok. Read sqlite foreign key document. It gives similar example. As you can see, column names are not same, but foreign key added nonetheless. CREATE TABLE artist( artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( trackid INTEGER, trackname TEXT, trackartist INTEGER, FOREIGN KEY(trackartist) REFERENCES artist(artistid) );

Categories : Database

How to implement stacks in Tcl without using lists?
There is struct::stack in the Tcl standard library. Of course, that package is implemented using lists. One could also store the stack content in a delimited string and add to / chop off the end of the string. Or, I think, encode the stack content as integers and use multiplication, division, and module operations to push and pop (the value span needs to be smaller than the smallest item, though

Categories : Database

Database design User Group Orders
As usual - it depends. If you're familiar with object oriented design, you may find it helpful to think of "members" and "groups" as objects. Is a group really a type of member (inheritance)? Is there a common super type for both members and groups? When you go further with the data model, will there be shared attributes between members and groups? If "member" and "group" have nothing more in com

Categories : Database

Algorithm for concurrent access to resource(s) on database
Edit: The setup below will still work on a cluster if you use a queueing program that can coordinate among multiple processes / servers, e.g. RabbitMQ. You can also use a simpler queueing algorithm that only uses the database, with the downside that it requires polling (whereas a system like RabbitMQ allows threads to block until a message is available). Create a Requests table with a column for

Categories : Database

Is this considered loop in my ERD?
There are two ways to handle your sitch. Option #1: Decouple user from device user id user_photo id user_id device_id photo_device id token value With this option when a user uploads a photo you can list out all devices from the photo_device table, then the user can select which device, and upon save, save user_id, and selected device_id into the user_photo table.

Categories : Database

Is it normal to hard code the input of over 80 input fields?
I have two concerns. A table with 80 columns may not be normalized. Once you've normalized the table you may find the screen size shrinks. 80 fields on a page seems excessively busy. As you mentioned sectioning the form with accordian headers, you may want to use separate forms for each section. These sections may help with normalization of the data.

Categories : Database

How do I configure database connection per user account in Spring Data?
Which database? Which ORM implementation? Spring has the AbstractRoutingDataSource, which lets you change the DataSource at runtime. You could also use a delegation pattern, where the web server connects as a limited user, and then changes role to a different user if their authentication is successful. See How to run SQL SET statements against db at start of connection/session using Hibernate?

Categories : Database

dataTables table row not linking to URL
You're nearly there but the delegate isn't required: $(document).ready(function() { var table = $("#example").DataTable(); $('#example tbody').on('click', 'tr', function(){ var row_date = table.row(this).data(); console.log(row_date[0]); window.location = "http://www.google.com/search?q"+row_date[0]; }); }); Example here, it won't change the URI though as it'

Categories : Database

Can Oracle SQL*Loader work without a control file
SQL*Loader is the wrong tool for the job. It is designed for repeatable loads. Clearly that's not what you're doing. "I want to save the cost of creating, opening and other costs associated with the file I/O operation." And your benchmark for this onerous cost is ... ???? Anyway, if you really want to load from a different file structure each time you need something which can read the fil

Categories : Database

MSAccess: How do I create a form with a field that updates multiple tables that share that field?
Why do it in a form when you can do it in the database? Just set up relationships for the tables (linking on Lot #) and then set them up for cascading updates. See Microsoft's KB and particularly the section about cascading updates and deletes.

Categories : Database

Update command only updates first row vb.net
Only updates the first row because the parameters collection of the command object has not been cleaned. Try to do the following: With sqlcommand .CommandText = sqlquery .Parameters.Clear() '<─────── Insert this line in your code. .Parameters.AddWithValue("@Attendance", newrow.Item(1)) .Parameters.AddWithValue("@ID", newrow.Item(0)) .Connection = Connectio

Categories : Database

DB Design : one or two tables to remember a user choice
Option #1, but wouldn't like and dislike be mutually exclusive? In that case, why not a single table with item-id, user-id, is-liked. If the user/item is in the table you know if the like/dislike is set. If the user/item is not in the table, then it has not been set Tables get big, but that's not really a problem if it's indexed properly.

Categories : Database

PLS 00306 Error PL/SQL
I don't think the problem is the BETWEEN expression. It's the DBMS_OUTPUT line. It can't handle BOOLEAN values. The following code works: set serveroutput on DECLARE v_sal NUMBER:= 3000; v_valid BOOLEAN; BEGIN v_valid := v_sal BETWEEN 1000 AND 5000; dbms_output.put_line(CASE WHEN v_valid THEN 'true' ELSE 'false' END); END; /

Categories : Database

How to create a chart that shows timeline against months in Qlikview?
I found this helpful when i made a similar type of project chart. Here is an example .qvw also To be able to create this chart, you need some type of event in the data model, where each event has a start date (or time) and possibly also an end date. Further, an event should belong to some grouping, typically a project or a phase in time. Given the above, we can now start making the graph: Cre

Categories : Database

Magento Varien_Data_Collections: when is SQL query executed
Magento uses lazy-loading and only performs the query when it really needs data from the resultset. So as long as you don't use a result, you can keep adding conditionals or filters without really executing the query.

Categories : Database

database design for millions of rows
The general rules for performance optimization are: Don't optimize prematurely Measure before you start. If you're using a SQL database, you should start by building a properly normalized database schema, and start tweaking it for performance only when you actually start running into performance problems. That way, you actually know where the bottle-necks are. If you start out by designing a

Categories : Database




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.