Search Results

Search found 17867 results on 715 pages for 'delete row'.

Page 135/715 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • Can I lock rows in a cursor if the cursor only returns a single count(*) row?

    - by RenderIn
    I would like to restrict users from inserting more than 3 records with color = 'Red' in my FOO table. My intentions are to A) retrieve the current count so that I can determine whether another record is allowed and B) prevent any other processes from inserting any Red records while this one is in process, hence the for update of. I'd like to do something like: cursor cur_cnt is select count(*) cnt from foo where foo.color = 'Red' for update of foo.id; Will this satisfy both my requirements or will it not lock only the rows in the count(*) who had foo.color = 'Red'?

    Read the article

  • How to delete rows based on comparison from Data Flow Task in an SSIS?

    - by vikasde
    I have a DataFlow task with two OLE DB Source objects. This is the SQL I want to achieve using SSIS: Insert into server2.db.dbo.[table2] (...) Select col1, col2, col3 ... from Server1.db.dbo.[table1] where [table1.col1] not in (Select col5 from server2.db.dbo.[table2] Where ...) I am pretty new to SSIS and not sure how to achieve this. I thought I could do this using the Data Flow task and populating the first source with the data from server1.db.dbo.table1 and the second source with server2.db.dbo.[table2] and then do the conditional check before inserting it into server2.db.dbo.[table2]. I am not sure how to do the conditional check though. Any help is appreciated.

    Read the article

  • When empty field comes, removed the row in the Grouped Table view in iPhone?

    - by Pugal Devan
    Hi friends, I have displayed the datas in grouped table view. The data's are displayed in the table view from XML parsing. I have 2 section of the table view, the section one has three rows and section two has two rows. section 1 -> 3 Rows section 2 - > 2 Rows. Now i want to check, if anyone of the string is empty then i should remove the empty cells, so i have faced some problems, if i have removed any empty cell, then it will changed the index number. So how can i check, anyone of the field is empty?, Because some times more number of empty field will come, so that the index position will be change. So please send me any sample code or link for that? How can i achieve this? Sample code, - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 0) { if([userEmail isEqualToString:@" "] || [phoneNumber isEqualToString:@" "] || [firstName isEqualToString:@" "]) { return 2; } else { return 3; } } if (section == 1) { if(![gradYear isEqualToString:@" "] || ![graduate isEqualToString:@" "]) { return 1; } else { return 2; } return 0; } Please Help me out!!! Thanks.

    Read the article

  • Is there a way to hide a row or column in excel without using VBA?

    - by AJ
    I know of several approaches using a macro (VBA) to show/hide columns and rows in Excel, but I cannot figure out or find a way to do this using either a formula or conditional formatting. Of particular interest is Excel 2007 - but I'd be curious to know if someone has managed to do it in any version of Excel. For those who want background, I have a spread of data with dates across the top and labels down the first column. I would like to specify a date window (on another sheet) as two cells with drop down dates (months) which would then show/hide the appropriate columns on the data sheet.

    Read the article

  • Adding a row to a ListView that displays "Loading" while information is downloaded. Like in the Market.

    - by user577139
    I've tried, but have had no luck trying to find this answer elsewhere. I want to add a row to the bottom of my listview that displays "Loading..." and maybe a spinning progress indicator. My program already loads additional information into the listview once the user scrolls to the bottom. But I want the user to be able to see that the program is indeed loading something. Example: If you go to the android marketplace and scroll to the bottom of one of the lists, the last row will say "Loading...". Then once the data is loaded, that bar is replaced with the first item of the new data. Sorry, it's a little hard to describe. I am NOT trying to add a footer to the bottom of the list view. I want it to be an actual item in the listview.

    Read the article

  • Is there a way to get each row's value from a database into an array?

    - by Guyver
    Say I have a query like the one below. What would be the best way to put each value into an array if I don't know how many results there will be? Normally I would do this with a loop, but I have no idea how many results there are. Would I need run another query to count the results first? <CFQUERY name="alllocations" DATASOURCE="#DS#"> SELECT locationID FROM tblProjectLocations WHERE projectID = '#ProjectName#' </CFQUERY>

    Read the article

  • Add columnname and data from datatable to a dictionary? C#

    - by Nick
    Hi, I am looping through a datatable and currently I do string customerId = row["CustomerId"].ToString(); string companyName = row["Company Name"].ToString(); Instead of declaring every variable how do I add these do a dictionary? I was thinking something like: foreach (DataRow row in customerTbl.Rows) { Dictionary<string, string> customerDictionary = new Dictionary<string, string>(); customerDictionary.Add(row[].ToString(), row[].ToString()); so yeah, how do I get the row name and value into there? Thanks in advance.

    Read the article

  • Disregard a particular TD element

    - by RussellDias
    Below I have the code that allows me to edit a table row inline. However it edits ALL of the TDs within that row. My problem, along with the code, are stated below. Any help is appreciated. <tbody> <tr> <th scope="row">Test</th> <td class="amount">$124</td> <td class="amount" id="" >$154</td> <td class="diff">- 754</td> </tr> </tbody> The above table is just a sample. What I have been trying to accomplish is, to simply edit the TDs within that particular row, but I need it to disregard the diff TD. I'm fairly new to jQuery and have got the following code via the help of a jQuery book. $(document).ready(function() { TABLE.formwork('#current-expenses'); }); var TABLE = {}; TABLE.formwork = function(table){ var $tables = $(table); $tables.each(function () { var _table = $(this); _table.find('thead tr').append($('<th class="edit">&nbsp;</th>')); _table.find('tbody tr').append($('<td class="edit"><input type="button" value="Edit"/></td>')) }); $tables.find('.edit :button').live('click', function(e) { TABLE.editable(this); e.preventDefault(); }); } TABLE.editable = function(button) { var $button = $(button); var $row = $button.parents('tbody tr'); var $cells = $row.children('td').not('.edit'); if($row.data('flag')) { // in edit mode, move back to table // cell methods $cells.each(function () { var _cell = $(this); _cell.html(_cell.find('input').val()); }) $row.data('flag',false); $button.val('Edit'); } else { // in table mode, move to edit mode // cell methods $cells.each(function() { var _cell = $(this); _cell.data('text', _cell.html()).html(''); if($('td.diff')){ var $input = $('<input type="text" />') .val(_cell.data('text')) .width(_cell.width() - 16); _cell.append($input); } }) $row.data('flag', true); $button.val('Save'); } } I have attempted to alter the code so that it would disregard the diff class TD, but have had no luck so far.

    Read the article

  • How can I use innerHTML without delete the before innerHTML?

    - by Mikelon85
    I want to convert an Array to a HTML table, but innerHTML deletes it writes before. Here is the code: <html><div id="tablaP"></div> function cargar2() { document.getElementById('tablaP').innerHTML= "<table>" var h=1 for (i=0;i<miArray.length;i++){ document.getElementById('tablaP').innerHTML = '<tr>' for (j=0;j<miArray[i].length;j++){ document.getElementById("tablaP").innerHTML = '<td><td>' } document.getElementById('tablaP').innerHTML = '</tr>' h++ } document.getElementById('tablaP').innerHTML = '</table>' }

    Read the article

  • Easy plugin or procedure for sqlserver Management Studio to script row inserts.

    - by Patrick Karcher
    I've never been able to find a good script or plugin for sql server Management Studio (2005 and or 2008) for a very common scripting need: specifying a few/all rows in a table and scripting their insert. You can guess my story: I've got some configuration data in my dev db and I need to script it for deployment to UAT and then production. I've found a few cludgy systems in the past, that were more trouble than they were worth. I need something free and unobtrusive. Once I find it I'll share it with the other 20 developers in my shop who are annoyed by this. Aren't we all annoyed by this by the way? What is the best, easiest, free, way to specify a few/all rows in a table and get a script their insert?

    Read the article

  • Looking for an example of selecting a row(s) with multiple columns from a grid view and add them to

    Here is the situation dealing with a vb.net website, I have students who will be enrolled into a course. The student grid view has many columns like client_no, student_name, date_of_birth, address, etc. There are over 100000 students so I will need to filter the student grid view to find the correct student to enroll in the course. Once they are found, the user selects them and somehow moves them to the enrolled grid view. If a student drops out then they would be removed from the enrolled grid view. This process needs to be easy to understand and use. Are there any examples available or other suggestions on how to do this?

    Read the article

  • My php script only reads the first row from mysql and doesn't check the rest of the rows for matches

    - by RobertH
    I'm trying to write a script for users to register to a club, and it does all the validation stuff properly and works great until it gets to the part where its supposed to check for duplicates. I'm not sure what is going wrong. HELP PLEASE!!! Thank you in Advance, <?php mysql_connect ("sqlhost", "username", "password") or die(mysql_error()); mysql_select_db ("databasename") or die(mysql_error()); $errormsgdb = ""; $errordb = "Sorry but that "; $error1db = "Name"; $error2db = "email"; $error3db = "mobile number"; $errordbe = " is already registered"; $pass1db = "No Matching Name"; $pass2db = "No Matching Email"; $pass3db = "No Matching Mobile"; $errorcount = 0; $qResult = mysql_query ("SELECT * FROM table"); $nRows = mysql_num_rows($qResult); for ($i=1; $i< $nRows+1; $i++){ $result = mysql_query("SELECT id,fname,lname,dob,email,mobile,agree,code,joindate FROM table WHERE fname = '$ffname"); if ($result > 0) { $errorcount = $errorcount++; $passdb = 0; $errormsgdb = $error1db; echo "<div class=\"box red\">$errordb $errormsgdb } else { $pass = 1; $errormsgdb = $pass1db; echo "<div class=\"box green\">$errormsgdb</div><br />"; } //--------------- Check if DB checks returned errors ------------------------------------> if($errorcount <= 0){ $dobp = $_REQUEST['day'].'/'.$_REQUEST['month'].'/'.$_REQUEST['year']; $dob = $_REQUEST['year'].$_REQUEST['month'].$_REQUEST['day']; //header('Location: thankyou.php?ffname='.$ffname.'&flname='.$flname.'&dob='.$dob.'&femail='.$femail.'&fmobile='.$fmobile.'&agree='.$agree.'&code='.$code.'&dobp='.$dobp); echo "<div class='box green'>Form completed! Error Count = $errorcount</div>"; } else { echo "<div class='box red'>There was an Error! Error Count = $errorcount</div>"; } } ?>

    Read the article

  • Find first cell in a row that contains a number?

    - by Dexter
    I'm working in Excel with an exported table such as this: |-------------------------------------------------------------------------------| | | A | B | C | D | E | F | G | H | I | |---|-------------------|-----|-----|-----|-----|-----|-------|-----|-----------| | 1 | Domain | JAN | FEB | MAR | APR | MAY | Start | End | Change | |---|-------------------|-----|-----|-----|-----|-----|-------|-----|-----------| | 2 | www.mydomain1.com | | 1 | 4 | 3 | 1 | 1 | 1 | 0 | |---|-------------------|-----|-----|-----|-----|-----|-------|-----|-----------| | 3 | www.mydomain2.com | 2 | 4 | 12 | 18 | 23 | 2 | 23 | 21 | |---|-------------------|-----|-----|-----|-----|-----|-------|-----|-----------| | 4 | www.mydomain3.com | | | 14 | 12 | | 14 | xxx | NOT FOUND | |-------------------------------------------------------------------------------| I'm trying to compare the current state (last cell) to the original cell (first cell with a value). In column I, I have the formula =IF(G2 = "xxx", "NOT FOUND", IF(H2 = "xxx", "NOT FOUND", H2 - G2)) In column H, I have the formula =IF(F2 = "", "xxx", F2) In column G, I need to find the first cell with a number. If there isn't one in that range, I need G to be "xxx". I suppose I only need to check for the first cell in the range (B2 to F2) that contains a value, not just a number. I tried using an Index and Match combo, but I couldn't quite understand it.

    Read the article

  • How do I add on multiple $_POST['row'] and variables?

    - by Ralph The Mouf
    I am struggling to find out the syntactically correct way in which to add on more variables and rows to these statements: /* WANT TO ADD ON FIVE MORE $_POST[''] */ if(isset($_POST['check_prof']) && $_POST['check_prof'] == 'checked') { $check_prof = "checked"; }else{ $check_prof = "unchecked"; } /* SAME HERE, WANT TO ADD THE OTHER FIVE IN HERE AS WELL */ $query = "UPDATE `Users` SET `check_prof` = '" . $check_prof . "' WHERE `id` = '" . $auth->id . "' LIMIT 1"; mysql_query($query,$connection); $auth->refresh(); }

    Read the article

  • Changing find to echo

    - by waszak
    This is almost good find *.txt -print0 | xargs -0 rm -f And i want to have something like that echo *.txt ./zad3.sh | xargs -l rm -f First version is good because I can delete file with white spaces but I can't use my script to select file to delete. Second version I can select files but I can't delete file with white spaces. I want to find files with end on .txt and delete some of them. zad3.sh is a script wich is returning file name if i agree to delete it rm catch the name and delete it. It works only for file without white space and special characters. Second version is better but i cant put my script inside it. find *.txt -print0| xargs -0 ./zad3.sh |xargs rm -f it works almost but i cant pass arg to rm and part of my code Thx

    Read the article

  • c# performance- create font

    - by user85917
    I have performance issues in this code segment which I think is caused by the "new Font". Will it be faster if fonts are static/global ? if (row.StartsWith(TILD_BEGIN)) { rtbTrace.SelectionColor = Color.Maroon; rtbTrace.SelectionFont = new Font(myFont, (float)8.25, FontStyle.Regular); if (row.StartsWith(BEGIN) ) rtbTrace.AppendText(Environment.NewLine + row + Environment.NewLine); else rtbTrace.AppendText(Environment.NewLine + row.Substring(1) + Environment.NewLine); continue; } if (row.StartsWith(EXCL_BEGIN)) { -- similar block } if (row.StartsWith(DLR_BEGIN)) { -- similar block } . . .

    Read the article

  • Is it possible to download a large database using mysql query

    - by Rose
    i am downloading files from server using WinSCP.Is it possible to write a query to download a large database using mysql query? Or using any other method i have tried with this code but i am not able to get the whole database structure <?php if(file_exists('backup_sql/my_backup.zip')) { unlink('backup_sql/my_backup.zip'); } $tables='*'; $host='MY HOST NAME'; $user='MY_USERNAME'; $pass='MYPASSWORD'; $name='MY_DB_NAME'; $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; //cycle through foreach($tables as $table) { $result = mysql_query('SELECT * FROM '.$table); $num_fields = mysql_num_fields($result); //$return.= 'DROP TABLE '.$table.';'; $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table)); $return.= "\n\n".$row2[1].";\n\n"; for ($i = 0; $i < $num_fields; $i++) { while($row = mysql_fetch_row($result)) { $return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); //$row[$j] = ereg_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } $rand_var=time(); $files_to_zip = array( "'backup_sql/db-backup-'.$rand_var.'.sql'", ); $name = 'db-backup-'.$rand_var.'.sql'; $data = $return; ?> any one please help me... thank you

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >