Search Results

Search found 58499 results on 2340 pages for 'temporal data'.

Page 189/2340 | < Previous Page | 185 186 187 188 189 190 191 192 193 194 195 196  | Next Page >

  • The best way to return related data in a SQL statement

    - by Darvis Lombardo
    I have a question on the best method to get back to a piece of data that is in a related table on the other side of a many-to-many relationship table. My first method uses joins to get back to the data, but because there are multiple matching rows in the relationship table, I had to use a TOP 1 to get a single row result. My second method uses a subquery to get the data but this just doesn't feel right. So, my question is, which is the preferred method, or is there a better method? The script needed to create the test tables, insert data, and run the two queries is below. Thanks for your advice! Darvis -------------------------------------------------------------------------------------------- -- Create Tables -------------------------------------------------------------------------------------------- DECLARE @TableA TABLE ( [A_ID] [int] IDENTITY(1,1) NOT NULL, [Description] [varchar](50) NULL) DECLARE @TableB TABLE ( [B_ID] [int] IDENTITY(1,1) NOT NULL, [A_ID] [int] NOT NULL, [Description] [varchar](50) NOT NULL) DECLARE @TableC TABLE ( [C_ID] [int] IDENTITY(1,1) NOT NULL, [Description] [varchar](50) NOT NULL) DECLARE @TableB_C TABLE ( [B_ID] [int] NOT NULL, [C_ID] [int] NOT NULL) -------------------------------------------------------------------------------------------- -- Insert Test Data -------------------------------------------------------------------------------------------- INSERT INTO @TableA VALUES('A-One') INSERT INTO @TableA VALUES('A-Two') INSERT INTO @TableA VALUES('A-Three') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-One') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-Two') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-Three') INSERT INTO @TableB (A_ID, Description) VALUES(2,'B-Four') INSERT INTO @TableB (A_ID, Description) VALUES(2,'B-Five') INSERT INTO @TableB (A_ID, Description) VALUES(3,'B-Six') INSERT INTO @TableC VALUES('C-One') INSERT INTO @TableC VALUES('C-Two') INSERT INTO @TableC VALUES('C-Three') INSERT INTO @TableB_C (B_ID, C_ID) VALUES(1, 1) INSERT INTO @TableB_C (B_ID, C_ID) VALUES(2, 1) INSERT INTO @TableB_C (B_ID, C_ID) VALUES(3, 1) -------------------------------------------------------------------------------------------- -- Get result - method 1 -------------------------------------------------------------------------------------------- SELECT TOP 1 C.*, A.Description FROM @TableC C JOIN @TableB_C BC ON BC.C_ID = C.C_ID JOIN @TableB B ON B.B_ID = BC.B_ID JOIN @TableA A ON B.A_ID = A.A_ID WHERE C.C_ID = 1 -------------------------------------------------------------------------------------------- -- Get result - method 2 -------------------------------------------------------------------------------------------- SELECT C.*, (SELECT A.Description FROM @TableA A WHERE EXISTS (SELECT * FROM @TableB_C BC JOIN @TableB B ON B.B_ID = BC.B_ID WHERE BC.C_ID = C.C_ID AND B.A_ID = A.A_ID)) FROM @TableC C WHERE C.C_ID = 1

    Read the article

  • Best way to store this data?

    - by Malfist
    I have just been assigned to renovate an old website, and I get to move it from some old archaic system to drupal. The only problem is that it's a real-estate system and a lot of data is stored. Currently all the information is stored in a single table, an id represents the house and then everything else is key/value pairs. There are a possible 243 keys per estate, there are 23840 estates in the system. As you can imagine the system is slow and difficult to query. I don't think a table with 243 rows would be a very good idea, and probably worse than the current situation. I've done some investigating and here's what I've found out: Missing data does not indicate a 0 value, data is merged from two, unique sources/formats. Some guessing is involved. I have no control over the source of the data. There are 4 keys that are common to all estates, all values look like something that is commonly searched for and could be indexed There are 10 keys that are in the [90-100)% range 8 of these are information like who's selling it, and it's address. The other two seem to belong with the below range There are 80 keys that are in the [80-90)% range This range seems to mostly just list room types and how many the house has (e.g. bedrooms_possible, bathrooms, family_room_3rd, etc) This range also includes some minor information like school districts, one or two more pieces of data on the address. The 179 keys that are in the [0-80)% range include all sorts of miscellaneous information about the estate My best idea was a hybrid approach, create a table that stores important, common information and keep a smaller key/value table. How would you store this information?

    Read the article

  • sending full form data to back end using jquery

    - by pradeep
    i have a form that is dynamically built. so the number of form elements arr not fixed. I wnat to send whole of $_POSt data from the form using jquery to back end for processing .i cant use jquery form plugin as the jquery version i am using is old. any other way ? i tied to do like this $.post('all_include_files/update_save.php',{variable:"<?php echo json_encode($_POST) ?>"},function(data) { alert(data); }) but did not work

    Read the article

  • is it possible to store server returned json data in jqgrid to display columnnames models data dynamically for every request?

    - by user1768246
    is it possible to store server returned json data in jqgrid to display columnnames models data dynamically for every request ? $("#grid").jqGrid({ type: "GET", url: "", var columnNames = $("#grid")[0].p.colNames, var columnModel = $("#grid")[0].p.colNames, var columnData = $("#grid")[0].p.colNames, datatype: 'jsonstring', datastr: columnData, colModel: columnModel, jsonReader: { root: 'innerWrapper.rows', page: "result.gridData.outerWrapper.page", total: "result.gridData.outerWrapper.total", records: "result.gridData.outerWrapper.total", repeatitems: false, }, gridview: true, pager: "pager", height: "auto", rowNum: 10, width:"auto", height:"auto", rowList: [10, 20, 30,40], viewrecords: true, caption:"Graph Data", rownumbers: true, });

    Read the article

  • Data base design with Blob

    - by mmuthu
    Hi, I have a situation where i need to store the binary data into database as blob column. There are three different table exists in my database where in i need to store a blob data for each record. Not every record will have the blob data all the time. It is time and user based. The table one will have to store the *.doc files almost for all the record The table two will have to store the *.xml optionally. The table three will have to store images (not sure what is frequency, etc) Now my questions is whether it is a good idea to maintain a separate table to store the blob data pointing it to the respective table PK's (Yes, there will be no FK's and assuming program will maintain it). It will be some thing like below, BLOB|PK_ID|TABLE_NAME Alternatively, is it a good idea to keep the blob column in respective tables. As for as my application runtime is concerned, The table 2 will be read very frequently. Though the blob column will not be required. The table 2 record will gets deleted frequently. Similarly other blob data in respective table will not be accessed frequently. All of the blob content will be read on-demand basis. I'm thinking first approach will work better for me. What do you guys think? Btw, I'm using Oracle.

    Read the article

  • Using AJAX to POST data to PHP database, then refresh

    - by cb74656
    Currently I have a button: <ul> <li><button onclick="display('1')">1</button></li> <li><button onclick="display('2')">2</button></li> <li><button onclick="display('3')">3</button></li> </ul> That when pressed, calls a javascript function, and displays PHP based on which button is pressed using AJAX. I figured this out all on my own. The AJAX gets a PHP file with a postgres query that outputs a table of data to a div. Now I want to be able to add, via form, new data and have it refresh (without reloading the page, yannknow?). I've tried a couple of things, and have hit roadblocks every time. My initial idea was to have the form submit the data using a javascript function and AJAX, then call my "display()" function after the query to reload the content. I just can't figure it out using GoogleFu. Based on my current idea, I'd like help with the following: How do I pass the form data to a javascript function. How do I use POST to pass that data to PHP using AJAX? I'm super new to javascript and AJAX. I've looked into jquery as it seems like that's the way to go, but I can't figure it out. If there's a better way to do this, I'm open to suggestions. Please forgive any misuse of nomenclature. EDIT: Once I solve this problem..., I'll have all the tools needed to finish the project preliminarily.

    Read the article

  • how I can convert the string output into data.frame

    - by user2968058
    i have a data set called SIZEDIST$AVG.µm., and i have fitted this data with a weibull curve. now i have generated the quantiles by using the quantile function and now i want to access the output of this function generated at the interval of p=0.01. fwbl<-fitdist(SIZEDIST$AVG.µm., "weibull",start=list(shape=0.8,scale=1)) fwbl quantwbl<-quantile(fwbl,probs=seq(.1,.99,.01)) quantwbl str(quantwbl) using str(quantwbl) i can visualize the output but i cant convert them into data.frame

    Read the article

  • Webservice connection data storage

    - by Mey
    Hello, I would like to ask you how can i implement the next: I have a tabBar where each tab make one different connection to one web service, and should show a different data. I would like to save this data "somewhere" and from it place load the different tabs. Where i should save this received data? Thank you, Best regards

    Read the article

  • draw graph in android with dynamically data

    - by Tikam
    In my project i want to draw a graph with dynamically updated data, and data is came from remote device and i update it from my locally sqlite data base. I have to draw a graph dynamically with having two paremeter as horizontally hours of day from {Mid night, 1, 2, ...., 11, Noon, 1 , 11, Mid Night} and vertically parameter as {One , two, Three, Four}. At particular hour i get data value from my sqlite and want to draw it on graph, and any particular hour have different value like "One", "two" etc. and i want to draw graph with hour help. Thanks in advance

    Read the article

  • How to interpret binary data as an integer?

    - by StackedCrooked
    The codebase at work contains some code that looks roughly like this: #define DATA_LENGTH 64 u_int32 SmartKey::SerialNumber() { unsigned char data[DATA_LENGTH]; // ... initialized data buffer return *(u_int32*)data; } This code works correctly, but GCC gives the following warning: warning: dereferencing pointer ‘serialNumber’ does break strict-aliasing rules Can someone explain this warning? Is this code potentially dangerous? How can it be improved?

    Read the article

  • Binding data asp.net web forms C#

    - by user2372566
    I am developing a project in asp.net web forms. I have a little problem. Whent the page load, I load some data from the dabase and present it on the page. On the same page I have form where I can input some textobox and with the click on the button make update on the same data in the database whis is at the first time loaded on the same page? The date is update, I can see it in SQL SERVER, but on the web page not. Its still the old data presents. After I close my application and run it again, then the new data appears on the page.

    Read the article

  • Javascript jQuery ajax submit default data

    - by onlineracoon
    How to submit default data when using $.ajax? I have tried: $.ajaxPrefilter(function(options, originalOptions, jqXHR) { // can't access anything here... (tried jqXHR.data but undefined) }); $.ajaxSetup({ beforeSend: function(jqXHR, settings) { // can't access anything here... (tried jqXHR.data but undefined) } }); I need this so I can send my CSRF token, each time and when logged in submit the user ID each time. I prefer not to submit a token in headers. Thanks

    Read the article

  • How to return data structure from stored procedure

    - by rodnower
    Hello, I have C# application that retrieve data from AQ with some oracle stored procedure, that stored in package. The scheme is: C# code - Stored Procedure in Package - AQ Inside of this stored procedure I use DBMS_AQ for dequeue the data to some object of some type. Now I have this object. My question is how I return it? Previously I: Created some virtual table, Make EXTEND() to table Inserted the data from object to table, Perform select on the table, And return sys_refcursor. In side of C# I filled DataSet with help of OracleDataAdapter.Fill() After that I upgraded it to return data fields during OUT parameters. But now I have much fields, and I may not to create so much OUT parameters... What the best way to do this? Thank you for ahead.

    Read the article

  • How To Securly Store Data In MySQL Using AES_ENCRYPT

    - by Justin
    We are storing sensitive data in MySQL, and I want to use AES_ENCRYPT(data, 'my-secret-key-here') which works great. My biggest question is how do I secure the key? Previously I just wast storing the key in a web PHP file, so something like: define("ENCRYPTION_KEY", 'my-secret-key-here'); This really doesn't work though, as our MySQL server and web server are the same physical machine, so if somebody gains access to the server, they can get both the encrypted data stored in MySQL and the key. Any ideas? I am thinking I need to move the key to a separate server, and read it in remotely. Or, what about generating the encryption key dynamically for each piece of data. For example taking the customer_id and running md5 on it, and then using that as the key.

    Read the article

  • How to transfer data from MYsql server to iphone

    - by creator7
    Hi All, I created a webservice in RDB with .Net.I able to transfer data from iphone to mysql and it returns the data. But i need to transfer data from RDB to iphone whenever i need (i am strucked by the ip address of iphone which one is dynamic to connect the device from a RDB) Please tell me how i will do it otherwise tell is any other way. Thanks in Advance

    Read the article

  • Query to get data from a main table

    - by Thu Thuy
    I have an Information table with 3 colums tableName/FieldName/Value and its data like this: TableName|FieldName | Value Films |DateSortie |NULL Films |Duree |NULL Films |CodeLangue |NULL Films |Documentaire |NULL Could you show me a SQL statement to put data into the Value Field, please! Note that I also have table Films and its fields like data in FieldName field of the Information table Thanks in advance TNT

    Read the article

  • asp.net dropdownlist databind on init causes data loss

    - by user2191496
    On which event or how should I bind data to the dropdownlist to avoid selected value overridden? For some reasons, I can't use "IsPostBack" to bind data only on postback I've tried binding data on page init, it works ok but when postback, the selected value will be overridden (Loss) protected void Page_Init(object sender, EventArgs e) { this.BindData(); } protected void BindData() { //grab the source of dropdownlist }

    Read the article

  • Simple iOS Get Request Not Pulling in Data

    - by user2793987
    I have a very simple get request that doesn't return data on my script. The script is fine when viewed in the web browser but the app does not pull in the data. Any other script works with this code in the app. I'm unsure of what to do because there shouldn't be a reason for this to not work. Please let me know if you need more information. Here's the script: https://shipstudent.com/complaint_desk/similarPosts.php?username=noah //retrieve saved username from user defaults (it's noah) NSUserDefaults *eUser = [NSUserDefaults standardUserDefaults]; savedUser = [eUser objectForKey:@"user"]; NSLog(@"%@",savedUser); in ViewDidLoad: NSString *categoryParam = [NSString stringWithFormat:@"https://shipstudent.com/complaint_desk/similarPosts.php?username=%@", savedUser]; NSURL *url = [NSURL URLWithString:categoryParam]; NSMutableURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageAllowed timeoutInterval:30.0]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if (connection==nil) { NSLog(@"Invalid request"); } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { postData = [[NSMutableData alloc]init]; NSLog(@"Response received"); } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [postData appendData:data]; NSLog(@"Data received"); } -(void)connectionDidFinishLoading:(NSURLConnection *)connection { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; similarPosts = [NSJSONSerialization JSONObjectWithData:postData options:kNilOptions error:nil]; [postsTbl reloadData]; for (id postObject in similarPosts) { NSLog(@"Relatable Post: %@",postObject); } }

    Read the article

  • Data structure in C# (3.0) that represents a CUBE

    - by Thinking
    Can you please give me some idea about how to design a data structure in C# (3.0) which will give a representation of 3D data structure. I mean to say something similar to cube. Like stock data to be viewed based on time , location . Kindly give a simple working example or even a link will do. It's urgent. Any example will be appreciated. Thanks in advance

    Read the article

  • Should I use AJAX or get every data beforehand

    - by rix501
    I have a web app where I need to change a drop down list dynamically depending on another drop down list. I have two options: Get all the data beforehand with PHP and "manage" it later with Javascript. Or get the data the user wants through AJAX. The thing is, that the page loads with all the data by default and the user can later select a sub category to narrow the drop downs. Which of the two options are better (faster, less resource intensive)?

    Read the article

  • MySQL Grouping of data

    - by text
    I want to group my data by Age and by gender: like this sample data: Age: 1 Male: 2 Female: 3 Age 1 Total: 5 Age: 2 Male: 6 Female: 3 Age 2 Total: 9 How can I group the data according to age and count all the male and females in that age from mysql database?

    Read the article

  • Using jquery statement within a jquery data object

    - by richardverbruggen
    As part of a jquery function u use this ajax post statement to get some reaction from a server. I want to pass some arguments to my test page. But these must be variables and are declared on the previous lines (iid and inst) How can i put these variables within the data object marked with the XX? iid = $(this).attr('iid'); inst = $(this).attr('inst'); $.post("test.php", { inst: XX, iid: XX},function(data){ alert("Data Loaded: " + data); });

    Read the article

< Previous Page | 185 186 187 188 189 190 191 192 193 194 195 196  | Next Page >