Search Results

Search found 30236 results on 1210 pages for 'insert update'.

Page 12/1210 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Update to Windows 8.1 without using Windows Store

    - by Hari
    I am currently using Windows 8 on my desktop PC. I want to upgrade to Windows 8.1. I heard that Microsoft provides this update through Microsoft Store for free. But in My home I don't have a faster internet connection. I downloaded a Windows 8.1 ISO from cafe, but when I started installing, it asks for a key. I typed my original Key for windows 8, but it didn't work. Is there any way for me to update to Windows 8.1 without an internet connection and without purchasing another key? Thank you

    Read the article

  • Apple Software Update Server for Windows

    - by Matthew Iselin
    We have just added a few iMacs to our system and we've found that they all want to download about 1.6 GB of updates... not so great when we only have limited monthly bandwidth! All of our Windows machines just use WSUS, which works great in our environment. It'd be nice if we could do the same for the iMacs without purchasing an additional Mac for a server role. So is it possible to run Apple's Software Update Server on a Windows server? Or do we need to look at purchasing a Mac in order to distribute updates across our clients? Alternatively, could we set up one of the iMacs to run the update server for the other iMacs whilst it is being used as a standard machine (ie, not installing OSX server, and keeping it available for staff to use)?

    Read the article

  • glassfish v3 - update all pakages via command line on linux

    - by orange80
    Does anyone know how to do this? I just want a one-shot command to "update everything" over the command line? This is for a remote server so it must be over the command line. I used: $ sudo pkg list -u to see the list of packages that are out of date, but I cannot for the life of me figure out how to say, "ok, update them". I have scoured the web for clues, but to no avail :( This is classic Sun Solaris-type patching that is the exact reason I am now on Linux. Please help!! Thanks :) Jamie

    Read the article

  • WSUS Showing Incorrect Version & Client Update Failure but they can check-in

    - by user132199
    One of the issues we are having is the clients will not download the updates from our WSUS server. They check-in as they are suppose too and find applicable updates but they are unable to actually download and install them. The GPO is set correctly. We decided to install the patch KB2720211to see if it would help eleviate this issue but it did not. In fact, even stranger, if I check the version that is installed on WSUS it reads 3.2.7600.226 but as far as I know it should read 3.2.7600.251. If I check Add/Remove programs to see what Windows Updates have been installed it even lists for WSUS that KB2720211 has been installed at version 3.2.7600.251. To install this update I followed the following directions Question: Has anyone seen this issue where the patch is installed yet not showing the correct version? What can I try to get my clients to update?

    Read the article

  • Video driver reports 8-bit color depth after Windows Update

    - by user3163
    Windows Update pushed out a new video driver for the Mobile Intel(R) 4 Series Express Chipset Family. One HP 6730b laptop was updated from 8.15.10.1872 to 8.15.10.2021. After the update the color depth is reported as 8-bit even if the setting is 32-bit. This means that Areo effects are disabled. Downgrading to 8.15.10.1872 did not help. Is there any way to force the video driver to report 32-bit color depth?

    Read the article

  • Windows update not working (2008 R2)

    - by Le_Quack
    long story short, one of our domain controllers is won't update. when an update is attempted it says the service is not running (checked and restarted yes it is) and event viewer says its error 0x80072ee2 but this apparently means there is a connection issue but as far as I can work out there isn't. this isn't a short term issue either seems to have been going on since at least feburary. any ideas? Note: Server updates fall to another (more senior) member of the team please do not ask me why they have been so neglected. He doesn't know what the issue is so I'm just trying to get to the bottom of this. many thanks

    Read the article

  • insert and modify a record in an entity using Core Data

    - by aminfar
    I tried to find the answer of my question on the internet, but I could not. I have a simple entity in Core data that has a Value attribute (that is integer) and a Date attribute. I want to define two methods in my .m file. First method is the ADD method. It takes two arguments: an integer value (entered by user in UI) and a date (current date by default). and then insert a record into the entity based on the arguments. Second method is like an increment method. It uses the Date as a key to find a record and then increment the integer value of that record. I don't know how to write these methods. (assume that we have an Array Controller for the table in the xib file)

    Read the article

  • dynamic insert php mysql and preformance

    - by Ross
    I have a folder/array of images, it may be 1, maximum of 12. What I need to do is dynamically add them so the images are added to an images table. At the moment I have $directory = "portfolio_images/$id/Thumbs/"; $images = glob("" . $directory . "*.jpg"); for ( $i= 0; $i <= count($images); $i += 1) { mysql_query("INSERT INTO project_images (image_name, project_id)VALUES ('$images[0]', '$id')") or die(mysql_error()); } this is fine but it does not feel right, how is this for performance? Is there a better way? The maximum number of images is only ever going to be 12. Thanks, Ross

    Read the article

  • insert and mofigy a record in an entity using Core Data

    - by aminfar
    I tried to find the answer of my question on the internet, but I could not. I have a simple entity in Core data that has a Value attribute (that is integer) and a Date attribute. I want to define two methods in my .m file. First method is the ADD method. It takes two arguments: an integer value (entered by user in UI) and a date (current date by default). and then insert a record into the entity based on the arguments. Second method is like an increment method. It uses the Date as a key to find a record and then increment the integer value of that record. I don't know how to write these methods. (assume that we have an Array Controller for the table in the xib file)

    Read the article

  • python MySQLdb got invalid syntax when trying to INSERT INTO table

    - by Michelle Jun Lee
    ## COMMENT OUT below just for reference "" cursor.execute (""" CREATE TABLE yellowpages ( business_id BIGINT(20) NOT NULL AUTO_INCREMENT, categories_name VARCHAR(255), business_name VARCHAR(500) NOT NULL, business_address1 VARCHAR(500), business_city VARCHAR(255), business_state VARCHAR(255), business_zipcode VARCHAR(255), phone_number1 VARCHAR(255), website1 VARCHAR(1000), website2 VARCHAR(1000), created_date datetime, modified_date datetime, PRIMARY KEY(business_id) ) """) "" ## TOP COMMENT OUT (just for reference) ## code website1g = "http://www.triman.com" business_nameg = "Triman Sales Inc" business_address1g = "510 E Airline Way" business_cityg = "Gardena" business_stateg = "CA" business_zipcodeg = "90248" phone_number1g = "(310) 323-5410" phone_number2g = "" website2g = "" cursor.execute (""" INSERT INTO yellowpages(categories_name, business_name, business_address1, business_city, business_state, business_zipcode, phone_number1, website1, website2) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s') """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) cursor.close() conn.close() I keep getting this error File "testdb.py", line 51 """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) ^ SyntaxError: invalid syntax any idea why? By the way, the up arrow is pointing to website1g (the b character) . Thanks for the help in advance

    Read the article

  • SQL (mySQL) update some value in all records processed by a select

    - by jdmuys
    I am using mySQL from their C API, but that shouldn't be relevant. My code must process records from a table that match some criteria, and then update the said records to flag them as processed. The lines in the table are modified/inserted/deleted by another process I don't control. I am afraid in the following, the UPDATE might flag some records erroneously since the set of records matching might have changed between step 1 and step 3. SELECT * FROM myTable WHERE <CONDITION>; # step 1 <iterate over the selected set of lines. This may take some time.> # step 2 UPDATE myTable SET processed=1 WHERE <CONDITION> # step 3 What's the smart way to ensure that the UPDATE updates all the lines processed, and only them? A transaction doesn't seem to fit the bill as it doesn't provide isolation of that sort: a recently modified record not in the originally selected set might still be targeted by the UPDATE statement. For the same reason, SELECT ... FOR UPDATE doesn't seem to help, though it sounds promising :-) The only way I can see is to use a temporary table to memorize the set of rows to be processed, doing something like: CREATE TEMPORARY TABLE workOrder (jobId INT(11)); INSERT INTO workOrder SELECT myID as jobId FROM myTable WHERE <CONDITION>; SELECT * FROM myTable WHERE myID IN (SELECT * FROM workOrder); <iterate over the selected set of lines. This may take some time.> UPDATE myTable SET processed=1 WHERE myID IN (SELECT * FROM workOrder); DROP TABLE workOrder; But this seems wasteful and not very efficient. Is there anything smarter? Many thanks from a SQL newbie.

    Read the article

  • MYSQL Fast Insert dependent on flag from a seperate table

    - by Stuart P
    Hi all. For work I'm dealing with a large database (160 million + rows a year, 10 years of data) and have a quandary; A large percentage of the data we upload is null data and I'd like to stop it from being uploaded. The data in question is spatial in nature, so I have one table like so: idLocations (Auto-increment int, PK) X (float) Y (foat) Alwaysignore (Bool) Which is used as a reference in a second table like so: idLocations (Int, PK, "FK") idDates (Int, PK, "FK") DATA1 (float) DATA2 (float) ... DATA7 (float) So, Ideally I'd like to find a method where I can do something like: INSERT INTO tblData(idLocations, idDates, DATA1, ..., DATA7) VALUES (...), ..., (...) WHERE VALUES(idLocations) NOT LIKE (SELECT FROM tblLocation WHERE alwaysignore=TRUE ON DUPLICATE KEY UPDATE DATA1=VALUES(DATA1) So, for my large batch of input data (250 values in a block), ignore the inserts where the idLocations matches an idLocations values flagged with alwaysignore. Anyone have any suggestions? Cheers. -Stuart Other details: Running MySQL on a semi-dedicated machine, MyISAM engine for the tables.

    Read the article

  • Multi-table Update(MySQL)

    - by smokinguns
    Hey all, I have a question regarding multi-table update(MySQL). Consider table t1 and t2. The PKEY for t1 is 'tid' which is a foreign Key in t2. There is a field "qtyt2" in t2 which depends on a field called "qtyt1" in table t1. Consider the foll SQL statement: UPDATE t2,t1 SET t2.qtyt2=IF(( t2.qtyt2- t1.qtyt1 )<0,0,( t2.qtyt2- t1.qtyt1 ) ), t1.qtyt1 ="Some value.." where t2.tid="some value.." AND t2.tid=t1.tid In this example qtyt2 depends on qtyt1 for update and the latter itself is updated.Now the result should return 2 if two rows are updated. Is there a guarantee that the fields will be updated in the order in which they appear in the statement( first qtyt2 will be set and then qtyt1).Is it possible that qtyt1 will be set first and then qtyt2? Is the order of tables in the statement important (UPDATE t2, t1 or UPDATE t1,t2)? I found that if I wrote "UPDATE t1,t2" then only t1 would get updated, but on changing the statement to "UPDATE t2,t1" everything worked correctly.

    Read the article

  • mysqli insert problem

    - by Simon
    Hello i have this error: Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in E:\wamp\www\classes\UserLogin.php on line 31 and i dont know what it is :/ here is my code function createUser($username, $password) { $mysql = connect(); if($stmt = $mysql->prepare('INSERT INTO users (username, password, alder, hood, fornavn, efternavn, city, ip, level, email) VALUES (?,?,?,?,?,?,?,?,?,?)')) { $stmt->bind_param($username,$password, $alder, $hood, $fornavn, $efternavn, $city, $ip, $level, $email); $stmt->execute(); $stmt->close(); } else { echo 'error: ' . $mysql->error; } then my user create the user they only need to type username and password, and later they can edit the profile and edit, email,alder,hood and like that :). Thanks for helping me

    Read the article

  • Insert xelements using LINQ Select?

    - by Simon Woods
    I have a source piece of xml into which I want to insert multiple elements which are created dependant upon certain values found in the original xml At present I have a sub which does this for me: <Extension()> Public Sub AddElements(ByVal xml As XElement, ByVal elementList As IEnumerable(Of XElement)) For Each e In elementList xml.Add(e) Next End Sub And this is getting invoked in a routine as follows: Dim myElement = New XElement("NewElements") myElement.AddElements( xml.Descendants("TheElements"). Where(Function(e) e.Attribute("FilterElement") IsNot Nothing). Select(Function(e) New XElement("NewElement", New XAttribute("Text", e.Attribute("FilterElement").Value)))) Is it possible to re-write this using Linq syntax so I don't need to call out to the Sub AddElements but could do it all in-line Many Thx Simon

    Read the article

  • IStatelessSession insert object with many-to-one

    - by Andrew Kalashnikov
    Hello guys. I've got common mapping <class name="NotSyncPrice, Portal.Core" table='Not_sync_price'> <id name="Id" unsaved-value="0"> <column name="id" not-null="true"/> <generator class="native"/> </id> <many-to-one name="City" class="Clients.Core.Domains.City, Clients.Core" column="city_id" cascade="none"></many-to-one> <!--<property name="City"> <column name="city_id"/> </property>--> I want to use IStatelessSession for batch insert. But when i set city object to NotSyncPrice object and call IStatelessSession I've got strange exception: NHibernate.Impl.StatelessSessionImpl.get_Timestamp() When its null or int all is ok. I try use real && proxy city object. But no result. What's wrong:( Please help

    Read the article

  • select for update problem in jdbc

    - by kartiku
    I'm having a problem with select for update in jdbc. The table i'm trying to update is the smalldb table, i'm having problems-- i'm using select for update which does a lock on the selected row the update statement is -- String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE name = ?"; the select statement is -- rs = stmt1.executeQuery("SELECT hIx FROM libra.smalldb for update"); rs0 = stmt2.executeQuery("SELECT name,aff FROM libra.smalldb"); the second statement is because i need those fields as well. Here is the complete code -- import java.sql.*; import java.util.ArrayList; import java.util.Collections; public class Jdbcexample1 { /** * @param args */ public static void main(String[] args) { Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql:///test", "root", "*****"); //String url = "jdbc:msql://200.210.220.1:1114/Demo"; //Connection conn = DriverManager.getConnection(url,"",""); Statement stmt1 = con.createStatement(); Statement stmt2 = con.createStatement(); Statement stmt3 = con.createStatement(); Statement stmt4 = con.createStatement(); ResultSet rs0; ResultSet rs; ResultSet rs1; ResultSet rs2; String name; String hIx; int hIxInt; StringBuffer sb = new StringBuffer(); String affiliationSmall; ArrayList<String> affiliation = new ArrayList<String>(); ArrayList<Float> matchValues = new ArrayList<Float>(); ArrayList<Integer> hixValues = new ArrayList<Integer>(); ArrayList<Integer> idValues = new ArrayList<Integer>(); boolean moreFlag = false; String queryString; int tmpIdx; String name1; //get the hix at that index where the similarity is maximum int tmpHidx = 0; int tmpHix = 0; int id = 0; int count; int tmpidIdx = 0; //rs = stmt.executeQuery("SELECT id FROM libra.researchint WHERE id = 910887"); // Get name, affiliation , hIx from smalldb //rs = stmt1.executeQuery("SELECT name,aff,hIx FROM libra.smalldb"); // String cursorName = "OUR_CURSOR"; // stmt1.setCursorName(cursorName); //rs = stmt1.executeQuery("SELECT name,aff,hIx FROM libra.smalldb for update"); rs = stmt1.executeQuery("SELECT hIx FROM libra.smalldb for update"); rs0 = stmt2.executeQuery("SELECT name,aff FROM libra.smalldb"); while ( rs.next() && rs0.next() ) { //String lastName = rs.getString("id"); hIx = rs.getString("hIx"); hIxInt = Integer.parseInt(hIx); //if hIx if (hIxInt==-1) continue; //name = rs.getString("name"); name = rs0.getString("name"); name1 = new String(name); System.out.println(name); //affiliationSmall = rs.getString("aff"); affiliationSmall = rs0.getString("aff"); //name = "\"" +name+ "\""; // Get matching names from large faculty table //String queryString = "SELECT id,name,hIx FROM libra.faculty WHERE name = " +name; //name = does not work names are similar but not same (in faculty and // smalldb) String query = "SELECT id,name,hIx FROM libra.faculty WHERE name like ?"; //String query = "SELECT id,name,hIx FROM libra.faculty for update of hIx WHERE name like ?"; PreparedStatement prepStmt = con.prepareStatement(query); String[] nameArr = name.split(" "); StringBuffer tmpSb = new StringBuffer(); for(int idx = 0;idx<nameArr.length;idx++) { tmpSb.append(nameArr[idx] + "%"); } name = tmpSb.toString(); prepStmt.setString(1, name); rs1 = prepStmt.executeQuery(); //Try to get matching names from faculty big db //Execute the query on faculty table //rs1 = stmt2.executeQuery(queryString); if(rs1.isClosed()) continue; count = 0; matchValues.clear(); affiliation.clear(); while(rs1.next()) { //name = rs1.getString("name"); id = Integer.parseInt(rs1.getString("id")); //idValues.add(id); tmpHix = Integer.parseInt(rs1.getString("hIx")); queryString = "SELECT aff FROM libra.affiliation WHERE id = "+id; rs2 = stmt3.executeQuery(queryString); //affiliation = rs1.getString("aff"); sb.delete(0, sb.length()); while (rs2.next()) { //Concatenate it to the same string using a stringbuffer sb.append(rs2.getString("aff")); //affiliation.add(rs2.getString("aff")); } affiliation.add(sb.toString()); count++; // if(count1) // { // moreFlag = true; // //Call fuzzy match function, store the distance values and select the // //affiliation that has the minimum distance from affiliationSmall // // //problem is here, affiliation.get Index: 2, Size: 2 // // matchValues.add(fuzzyMatch(affiliationSmall,affiliation.get(count))); // hixValues.add(tmpHix); // idValues.add(id); // } }//end of while rs1 -> faculty rs1.close(); int idx = 0; if(count>1) { moreFlag = true; //Call fuzzy match function, store the distance values and select the //affiliation that has the minimum distance from affiliationSmall //problem is here, affiliation.get Index: 2, Size: 2 matchValues.add(fuzzyMatch(affiliationSmall,affiliation.get(idx))); hixValues.add(tmpHix); idValues.add(id); idx++; } if(moreFlag) { Object obj = Collections.max(matchValues); float maxVal = Float.parseFloat(obj.toString()); //int tmpIdx = matchValues.indexOf(new Float(maxVal)); //get the index at which similarity between affiliation strings is maximum, //as returned by fuzzyMatch //int tmpIdx = matchValues.indexOf(maxVal); tmpIdx = matchValues.indexOf(maxVal); //get the hix at that index where the similarity is maximum //int tmpHidx = hixValues.get(tmpIdx); tmpHidx = hixValues.get(tmpIdx); tmpidIdx = idValues.get(tmpIdx); //update the smalldb table String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE name = ?"; //String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE current of "+cursorName; //PreparedStatement prepStmt1 = con.prepareStatement("UPDATE libra.smalldb SET hIx = ? WHERE current of "+cursorName); PreparedStatement prepStmt1 = con.prepareStatement(updateQ); //PreparedStatement prepStmt1 = con.prepareStatement(updateQ); prepStmt1.setString(2, name1); prepStmt1.setString(1, Integer.toString(tmpHidx)); prepStmt1.executeUpdate(updateQ); //prepStmt1.execute(); //stmt4.executeUpdate(updateQ); }//end of if //For matching names get the affiliation based on id from affiliation table //con.close(); //System.out.println(lastName); System.out.println(name); }//end of while rs -> smalldb rs.close(); // String updateQ = "UPDATE libra.smalldb1 SET hIx = "+Integer.toString(tmpHidx)+ "WHERE id = "+Integer.toString(tmpidIdx); // stmt4.executeUpdate(updateQ); con.close(); } catch (Exception e) { System.err.println("Got an exception! "); System.err.println(e.getMessage()); e.printStackTrace(); } } public static float fuzzyMatch(String affiliationSmall, String affiliation) { //float distance = 0; String[] temp = null; temp = affiliationSmall.split(" "); int index; //int index1 = affiliation.indexOf(affiliationSmall); int matchCount = 0; for (int idx = 0;idx<temp.length; idx++) { index = affiliation.indexOf(temp[idx]); if (index!=-1) { matchCount++; } } float tmpFloat = matchCount/temp.length; //int[] aff1= new int[affiliation1.length()]; //int[] aff2 = new int[affiliation2.length()]; return tmpFloat; } } i think it is because of the second select statement (rs0) Here is the error- Got an exception! 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 '?' at line 1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '?' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2690) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1648) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1567) at Jdbcexample1.main(Jdbcexample1.java:184)

    Read the article

  • Problem with UPDATE statement in stored-procedure in Oracle Database

    - by MKP
    Hello, I have stored-procedure in Oracle database like this: create or replace PROCEDURE EDYTUJ_PRACOWNIKA (PR_IMIE IN VARCHAR2, PR_NAZWISKO IN VARCHAR2, PR_PENSJA IN FLOAT, PR_PRZELOZONY IN NUMBER, PR_ODDZIAL IN NUMBER, PRAC_ID IN NUMBER) AS tmpPensja FLOAT := 0; tmpPrzel NUMBER := 0; BEGIN select przelozony into tmpPrzel from pracownik where id = PRAC_ID; IF(tmpPrzel IS NOT NULL) THEN select pensja into tmpPensja from pracownik where id = tmpPrzel; IF(tmpPensja < 1150) THEN UPDATE PRACOWNIK SET pensja = 1000 WHERE id = tmpPrzel; ELSE UPDATE PRACOWNIK SET pensja = pensja - 150 WHERE id = tmpPrzel; (4) END IF; END IF; IF(PR_PRZELOZONY > 0) THEN UPDATE PRACOWNIK SET imie = PR_IMIE, nazwisko = PR_NAZWISKO, pensja = PR_PENSJA, przelozony = PR_PRZELOZONY, oddzial = PR_ODDZIAL WHERE id = PRAC_ID; (2) select pensja into tmpPensja from pracownik where id = PR_PRZELOZONY; IF(tmpPensja > 4850) THEN UPDATE PRACOWNIK SET pensja = 5000 WHERE id = PR_PRZELOZONY; ELSE UPDATE PRACOWNIK SET pensja = pensja + 150 WHERE id = PR_PRZELOZONY; (1) END IF; ELSE UPDATE PRACOWNIK SET imie = PR_IMIE, nazwisko = PR_NAZWISKO, pensja = PR_PENSJA, przelozony = NULL, oddzial = PR_ODDZIAL WHERE ID = PRAC_ID; (3) END IF; END; where przelozony and pensja are columns in pracownik table. And I have problem that when running procedure with parameters that provide that line marked with "(1)" (there is the same problem with line marked with "(4)") should be executed that update statement don't have any effect. What's more statements in lines marked with "(2)" and "(3)" works fine. I have no ideas how to fix it. Thank you in advance for your help.

    Read the article

  • Adding a Line Break in mySQL INSERT INTO text

    - by james
    Hi Could someone tell me how to add a new line in a text that i enter in a mySql table. I tried using the '\n in the line i entered with INSERT INTO statement but '\n is shown as it is. Actually i have created a table in Ms Access with some data. Ms Access adds new line with '\n. I am converting Ms Access table data into mySql . But when i convert, the '\n is ignored and all the text is shown in one single line when i display it from mySql table on a php form. Can anyone tell me how mySQL can add a new line in a text ? Awaiting response Thanks !!

    Read the article

  • Insert value in SQL database

    - by littleBrain
    In SQL Server 2005, I'm trying to figure out How to fill up the following fields? Any kind of help will be highly appreciated.. INSERT INTO [Fisharoo].[dbo].[Accounts] ([FirstName] ,[LastName] ,[Email] ,[EmailVerified] ,[Zip] ,[Username] ,[Password] ,[BirthDate] ,[CreateDate] ,[LastUpdateDate] ,[TermID] ,[AgreedToTermsDate]) VALUES (<FirstName, varchar(30),> ,<LastName, varchar(30),> ,<Email, varchar(150),> ,<EmailVerified, bit,> ,<Zip, varchar(15),> ,<Username, varchar(30),> ,<Password, varchar(50),> ,<BirthDate, smalldatetime,> ,<CreateDate, smalldatetime,> ,<LastUpdateDate, smalldatetime,> ,<TermID, int,> ,<AgreedToTermsDate, smalldatetime,>)

    Read the article

  • PHP MySQL Insert Help

    - by user364333
    Hey I am trying to make a page that inserts some strings into a MySQL table but it just dosn't seem to be working for me. Here is the code I am using at the moment. <?php mysql_connect($address, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "insert INTO user (movieid, moviename)('" . $id . "','" . $name . "') or die(mysql_error())"; mysql_query($query); mysql_close(); ?> Where am i going wrong?

    Read the article

  • Update table instantly or “Bulk” Update in database later? And is it advisable?

    - by Mestika
    Hi, I have a question regarding a semi-constant update in a database. In short it is regarding a checkout function on a web page, which each time the checkout function is evoked it do five steps. I want to try to optimize this function and have my eye on a step where I update a table each time the checkout is performed. I take the information retrieved from the shopping cart and then update the table in question. I do have some indexes on the table, the gain from those are greater than leaving them so this is a cost I’m willing to take. Now, my question is. Could it in some way regarding to performance be better to not update the table instantly but collect every checkout items and save them in some way (maybe in a file) and then at a specific time (or several times) at day take this file and then update the table with the new information. Then I started thinking about if there was a possibility to use some sort of Bulk Update to take a file, hashmap, array (or?) and then update it. And I’m using IBM DB2 version 9.7 Mestika

    Read the article

  • Proper code but can't insert to database

    - by Dchris
    I have a Visual Basic project using Access database.I run a query but i don't see any new data on my database table.I don't have any exception or error.Instead of this the success messagebox is shown. Here is my code: Dim ID As Integer = 2 Dim TableNumber As Integer = 2 Dim OrderDate As Date = Format(Now, "General Date") Dim TotalPrice As Double = 100.0 Dim ConnectionString As String = "myconnectionstring" Dim con As New OleDb.OleDbConnection(ConnectionString) Try Dim InsertCMD As OleDb.OleDbCommand InsertCMD = New OleDb.OleDbCommand("INSERT INTO Orders([ID],[TableNumber],[OrderDate],[TotalPrice]) VALUES(@ID,@TableNumber,@OrderDate,@TotalPrice);", con) InsertCMD.Parameters.AddWithValue("@ID", ID) InsertCMD.Parameters.AddWithValue("@TableNumber", TableNumber) InsertCMD.Parameters.AddWithValue("@OrderDate", OrderDate) InsertCMD.Parameters.AddWithValue("@TotalPrice", TotalPrice) con.Open() InsertCMD.ExecuteNonQuery() MessageBox.Show("Successfully Added New Order", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information) con.Close() Catch ex As Exception 'Something went wrong MessageBox.Show(ex.ToString) Finally 'Success or not, make sure it's closed If con.State <> ConnectionState.Closed Then con.Close() End Try What is the problem?

    Read the article

  • SQL: Using a CASE Statement to update 1000 rows at once

    - by SoLoGHoST
    Ok, I would like to use a CASE STATEMENT for this, but I am lost with this. Basically, I need to update a ton of rows, but just on the "position" column. I need to update all "position" values from 0 - count(position) for each id_layout_position column per id_layout column. OK, here is a pic of what the table looks like: Now let's say I delete the circled row, this will remove position = 2 and give me: 0, 1, 3, 5, 6, 7, and 4. But I want to add something at the end now and make sure that it has the last possible position, but the positions are already messed up, so I need to reorder them like so before I insert the new row: 0, 1, 2, 3, 4, 5, 6. But it must be ordered by lowest first. So 0 stays at 0, 1 stays at 1, 3 gets changed to 2, the 4 at the end gets changed to a 3, 5 gets changed to 4, 6 gets changed to 5, and 7 gets changed to 6. Hopefully you guys get the picture now. I'm completely lost here. Also, note, this table is tiny compared to how fast it can grow in size, so it needs to be able to do this FAST, thus I was thinking on the CASE STATEMENT for an UPDATE QUERY. Here's what I got for a regular update, but I don't wanna throw this into a foreach loop, as it would take forever to do it. I'm using SMF (Simple Machines Forums), so it might look a little different, but the idea is the same, and CASE statements are supported... $smcFunc['db_query']('', ' UPDATE {db_prefix}dp_positions SET position = {int:position} WHERE id_layout_position = {int:id_layout_position} AND id_layout = {int:id_layout}', array( 'position' => $position++, 'id_layout_position' => (int) $id_layout_position, 'id_layout' => (int) $id_layout, ) ); Anyways, I need to apply some sort of CASE on this so that I can auto-increment by 1 all values that it finds and update to the next possible value. I know I'm doing this wrong, even in this QUERY. But I'm totally lost when it comes to CASES. Here's an example of a CASE being used within SMF, so you can see this and hopefully relate: $conditions = ''; foreach ($postgroups as $id => $min_posts) { $conditions .= ' WHEN posts >= ' . $min_posts . (!empty($lastMin) ? ' AND posts <= ' . $lastMin : '') . ' THEN ' . $id; $lastMin = $min_posts; } // A big fat CASE WHEN... END is faster than a zillion UPDATE's ;). $smcFunc['db_query']('', ' UPDATE {db_prefix}members SET id_post_group = CASE ' . $conditions . ' ELSE 0 END' . ($parameter1 != null ? ' WHERE ' . (is_array($parameter1) ? 'id_member IN ({array_int:members})' : 'id_member = {int:members}') : ''), array( 'members' => $parameter1, ) ); Before I do the update, I actually have a SELECT which throws everything I need into arrays like so: $disabled_sections = array(); $positions = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { if (!isset($disabled_sections[$row['id_group']][$row['id_layout']])) $disabled_sections[$row['id_group']][$row['id_layout']] = array( 'info' => $module_info[$name], 'id_layout_position' => $row['id_layout_position'] ); // Increment the positions... if (!is_null($row['position'])) { if (!isset($positions[$row['id_layout']][$row['id_layout_position']])) $positions[$row['id_layout']][$row['id_layout_position']] = 1; else $positions[$row['id_layout']][$row['id_layout_position']]++; } else $positions[$row['id_layout']][$row['id_layout_position']] = 0; } Thanks, I know if anyone can help me here it's definitely you guys and gals... Anyways, here is my question: How do I use a CASE statement in the first code example, so that I can update all of the rows in the position column from 0 - total # of rows found, that have that id_layout value and that id_layout_position value, and continue this for all different id_layout values in that table? Can I use the arrays above somehow? I'm sure I'll have to use the id_layout and id_layout_position values for this right? But how can I do this? Ok, guy, I get an error, saying "Hacking Attempt" with the following code: // Updating all positions in here. $smcFunc['db_query']('', ' SET @pos = 0; UPDATE {db_prefix}dp_positions SET position=@pos:=@pos+1 ORDER BY id_layout_position, position', array( ) ); Am I doing something wrong? Perhaps SMF has safeguards against this approach?? Perhaps I need to use a CASE STATEMENT instead?

    Read the article

  • SQL Server insert with XML parameter - empty string not converting to null for numeric

    - by Mayo
    I have a stored procedure that takes an XML parameter and inserts the "Entity" nodes as records into a table. This works fine unless one of the numeric fields has a value of empty string in the XML. Then it throws an "error converting data type nvarchar to numeric" error. Is there a way for me to tell SQL to convert empty string to null for those numeric fields in the code below? -- @importData XML <- stored procedure param DECLARE @l_index INT EXECUTE sp_xml_preparedocument @l_index OUTPUT, @importData INSERT INTO dbo.myTable ( [field1] ,[field2] ,[field3] ) SELECT [field1] ,[field2] ,[field3] FROM OPENXML(@l_index, 'Entities/Entity', 1) WITH ( field1 int 'field1' ,field2 varchar(40) 'field2' ,field3 decimal(15, 2) 'field3' ) EXECUTE sp_xml_removedocument @l_index EDIT: And if it helps, sample XML. Error is thrown unless I comment out field3 in the code above or provide a value in field3 below. <?xml version="1.0" encoding="utf-16"?> <Entities> <Entity> <field1>2435</field1> <field2>843257-3242</field2> <field3 /> </Entity> </Entities>

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >