Jump to content

Search the Community

Showing results for tags 'INSERT INTO'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 4 results

  1. I have a stored procedure that I have scheduled as a job to run nightly at midnight. I want the stored procedure to insert the data into a table when it runs. Do I have to create the table first or is there a way to create the table when the stored procedure runs? My second question is: I then need a job to purge that same table every night at 11pm prior to the stored procedure running again at midnight. Thank you for any help you can provide. I appreciate it. Here is my Stored Procedure: USE [TMWSUITE] GO /****** Object: StoredProcedure [dbo].[Wynne_DriverSnapshot] Script Date: 10/22/2019 6:35:18 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[Wynne_DriverSnapshot] as WITH cte (mpp_id, mpp_firstname, mpp_lastname, mpp_status, mpp_fleet, mpp_terminal) as ( Select mpp_id, mpp_firstname, mpp_lastname, mpp_status, mpp_fleet, mpp_terminal from manpowerprofile where mpp_terminationdt >= GETDATE() ), cte2 (lgh_number, lgh_startdate, lgh_enddate, lgh_outstatus, rn, lgh_driver1, lgh_class, lgh_class2) as ( Select lgh_number, lgh_startdate, lgh_enddate, lgh_outstatus, ROW_NUMBER() OVER (PARTITION by lgh_driver1 order by lgh_number desc) as rn, lgh_driver1, lgh_class1, lgh_class2 From legheader ) Select mpp_id, mpp_firstname, mpp_lastname, mpp_status, mpp_fleet, mpp_terminal, lgh_number, lgh_startdate, lgh_enddate, lgh_outstatus, lgh_driver1, lgh_class, lgh_class2 from cte left join cte2 on mpp_id = lgh_driver1 where rn = '1' and mpp_id NOT IN ('UNKNOWN','TESDR','TESDR2') order by mpp_id
  2. Hi, I have a goDaddy account and I'm learning to import data. I've had success with a couple of uploads, but I get an error message and I don't understand what I need to do to get rid of it. My code is below, along with the error message I get and the excerpt from the mySQL documentation. Can anyone offer some advice about how to proceed and what may be the problem? The query works and updates the table with the info perfectly, but I think I should find out what this error is b/4 I incorporate into my website. Thanks a million! SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `myUsers` ( `UserID` char(8) NOT NULL, `firstName` varchar(24) NOT NULL, `lastName` varchar(24) NOT NULL, `viewPref` varchar(16) NOT NULL, `pagePref` varchar(48) NOT NULL, PRIMARY KEY (`UserID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; INSERT INTO `myUsers` (`UserID`, `firstName`, `lastName`, `viewPref`, `pagePref`) VALUES ('sak20007', 'John', 'Smith', 'mobile_phone', 'about.html'); UPDATE; #1064 - 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 Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR) Message: %s near '%s' at line %d
  3. Hello internet I am pulling out my hair trying to figure this one out. Below is the only code I have in the php file. What I am trying to do is delete the only line of data in the database table and replace it with a new line of data. The data will delete but it will not do the insert function to put the new data in. I started out trying an UPDATE function but that did not work either. Separately each set of <?php ?> code works if I put them in separate files but together they do not work. Why? How can I achieve the desired effect? Please help. <?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");mysql_close($con)?> <?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?>
  4. Hi all, i have a simple DB with 2 tables:Table1.....ID|1st Lot No|No of Blocks|Part Number|Date|Lot Qty.Table2.....ID|---------Lot No-----------|Part Number|Date|Lot Qty.What im trying to achieve is When the user inputs values in Table1, the data is pulled through to Table2, but i need the value in [Table2,Lot No] to auto increment Based on the Table1.No of blocks.e.g. User inputs:ID|1st Lot No|No of Blocks|Part Number|Date |Lot Qty.1 | 62204 | 6 | TR456 |1/1/12|2.978KMThen when Table1 Row_inserted, Table2 is auto updated to:ID| Lot No|Part Number|Date |Lot Qty1 |62204 | TR456 |1/1/12 |2.978KM2 |62205 | TR456 |1/1/12 |2.978KM3 |62206 | TR456 |1/1/12 |2.978KM4 |62207 | TR456 |1/1/12 |2.978KM5 |62208 | TR456 |1/1/12 |2.978KM6 |62209 | TR456 |1/1/12 |2.978KMI am using aspmaker and putting the code in the server event:' Row Inserted eventSub Row_Inserted(rsold, rsnew) End SubI have been trying to achieve this using dims, insert into, i'v done numerouse tutorials and i just cant get it to work. My sql knowledge is moderate. But i'v been stuck on this for about 200hrs NO JOKE, i dont like giving up.Please If anyone has the skills to show me the way, then i would greatly appreciate your help.Regards, Mike.
×
×
  • Create New...