Jump to content

Search the Community

Showing results for tags 'sql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. I have a nifty query that pulls data by orders.orderid > '85000' (and I update that number every week based on orders.) But I want it to automatically pull the most recent 3,000 orders instead of changing that number all the time, so I was hoping to set a variable which is Max(order.orderid)-3000, thus pulling the last 3000 order records. Here is my static select: SELECT Orders.OrderID, Orders.OrderStatus, Orders.CustomerID, Orders.ShippingMethodID, Orders.BillingFirstName, Orders.BillingLastName, Orders.BillingAddress1, Orders.BillingAddress2, Orders.BillingCity, Orders.BillingState,
  2. I have the following sql query in vb.net and ms access , how do I create a table from the query result ? SELECT 'Table1' AS [Table], SUM(a) - SUM( AS Result FROM table1 I have tried but it does not work create table tble10 as SELECT 'Table1' AS [Table], SUM(a) - SUM( AS Result FROM table1 any help would be appreciated
  4. I created an asp.net webform that submits to an sql database on an sql server. The web server is Windows server 2012. The page successfully submits when I run the page using Visual Studio 2012, but when I run it on the web server (not using Visual Studios) I get the error message below when I click submit. It says login failed for user domainservername$, but the username in the connection string is user we created for the sql database. It uses Windows Authentication. I setup the web server for asp.net. I haven't done it before, so I assume the issue is there or in the connection strin
  5. hello... I have written a stored procedure to get a column Named as "Name" from the table DN_Software.The query is "Select Name From DN_Software Where DN_DiscoverHostID=5" for Particular ID. Now i want to display that list of names in front end page. please help me how to display using that stored procedure using asp.net displaying in c#.please... "ALTER PROCEDURE [dbo].[DN_Software_Read_Distinct_Name_By_DiscoveredHostID]( @Active [int], @DN_DiscoveredHostID Int) AS SELECT DISTINCT Name FROM DN_Software where DN_DiscoveredHostID = @DN_DiscoveredHostID --EXEC DN_Software_Read
  6. I am wanting to write a procedure that will insert new/updated fields into another table Ex: tblStaff and tblUsers Fields in tblUsers needs to be inserted into tblStaff when new records or added or fields are updated. What is the best route to go to accomplish this?
  7. I have a table called employee in which there's a field called birth_date. Iwant to get the output in the format of Jan-01-2013.My sql is $sql="SELECT emp_name,emp_address,salary,DATE_FORMAT(birth_date,'%b,%d,%Y') AS birth_date FROM employee";$query=mysql_query($sql,$connect); But the query is not succesful. What have I done wrong?Any help to correct this please
  8. I am needing to change the data type in a table but it won't allow me to. I usually manually drop and recreate a table but was going to try and use SQL server template since the table is rather large (right click on table-> script table as-> drop and create to) Would you suggest using this template or just manually writing it myself and going from there? IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblStaff]') AND type in (N'U'))DROP TABLE [dbo].[tblStaff]GOUSE [Test]GO/****** Object: Table [dbo].[tblStaff] Script Date: 07/10/2013 12:39:35 ******/SET AN
  9. I am wanting to insert fields from a table (data types are varchar(50) into another empty table (who's data type is nvarchar(50)). I believe I have created the correct query to achieve this but received an error message when executing "Msg 8152, Level 16, State 4, Line 1 String or binary data would be truncated" Would these two data types be the cause of this? I'm using some other data types (int, bigint) that could possibly be the issue but these are the main ones used to I wanted to see about them first.
  10. I'm needing to insert values into a table. I have the data type set up as varchar(4). The values are combinations of 4 letters and/or numbers. When trying to insert it won't accepts the alpha characters. The column is set to Not Null and as the primary key. Any suggestions as to why it won't accept?
  11. I was needing to change the data type for a field in a table that was the primary key. After researching the solution I came up with was to drop the table and recreate it. I dropped the table and then attempted to recreate it only it wouldn't take the original table name so I modified it and inserted the columns into the table under the correct data types. I believe in doing this I messed something up. When I access the site that the database is tied to I can't view information for the table I recreated or the main table it's connected to. I have tried to go to the affected tables and correct
  12. I want to perform a join on three tables.Table 1: part_masterColumn: Item, Item_statusTable 2: Order_DetailsColumn: Item, order_num, order_typeTable 3: OrderColumn: order_num, order_typeHere is the cardinality:part_master <--> order_details (1..1)order <--> order_details (1..n)I want to perform a search on order table, to retrieve item_status from part_master. In other word, I want to see item_status, for an order, using order_num as a search criteria.I tries something like this, however, it throws a exception:select part_master.item_status from part_master where item = (select ite
  13. I would like to create a stored routine for MySQL that figures out the number of business or working days for a month (Working Days are Monday thru Friday). I have not created the procedure portion of it yet as I want to ensure that the code works first. Please note that there is a function called first_day. This is a function provided by my hosting provider. I also have another function for this that will figure out the first day of the month if I didn't have it from the hosting company. It is not currently used and can be removed for testing purposes. I am testing this through phpmyadmi
  14. am searching the code for making pdf in asp classic, i have made a form in asp and on submit button i want that it get convert in pdf and get to attached in email. thanks in advance plz help
  15. Friends, i have 3 tables.....one named stocklist, other one....partyinsrcd, 3rd one.....sregisteri would like to select distinct vehicle model name from table stocklist whose related chassis numbers not available in the other two tables.......please help...Is this the sql for the above....pl check. i am not getting the result from the below sql......SELECT distinct stocklist.vehicle FROM (stocklist inner JOIN sregister ON stocklist.chassissregister.CHASSIS) inner JOIN partyinsrcd ON stocklist.chassisright(partyinsrcd.chassisno,7) WHERE (((sregister.CHASSIS)stocklist.chassis) and (right(partyi
  16. Hey guys...it's me again...so, below you will find the script that I have that is supposed to update my database, however, it does NOTHING but return "Record Updated" and never updated anything. Any suggestions? $update = "UPDATE clients SET ( 'userid' = '{$_SESSION['myusername']}', 'cp_firstname' = '$_POST[cp_firstname]', 'cp_lastname' = '$_POST[cp_lastname]', 'cp_address' = '$_POST[cp_address]', 'cp_city' = '$_POST[cp_city]', 'cp_state' = ' $_POST[cp_state] ', 'cp_zip' = ' $_POST[cp_zip] ', 'cp_zip4' = ' $_POST[cp_zip4] ', 'cp_homeph' = '$_POST[cp
  17. Hi, I'm using SQL loader to load my data into database. Before I insert the data I need to remove existing data in the table: options(skip=1,load=250000,errors=0,ROWS=30000,BINDSIZE=10485760)load datainfile 'G:1.csv' "str '^_^'" replaceinto table IMPORT_ABCfields terminated by "," OPTIONALLY ENCLOSED BY '"'trailing nullcols(....) But I got error like: SQL*LOADER-926: OCI error while executing delete/truncate <due to REPLACE/TRUNCATE keyword> for table IMPORT_ABCORA-30036: unable to extend segment by 8 in undo tablespace 'undo1' How can I delete data for example by 10000 rows?I know th
  18. First, I would like to thank JUSTSOMEGUY for his extensive assistance with one hurdle on my report page. Now I need to do the calculations. Since I need my calculations to operate within 3 different IF statements and within the WHILE loop, I just guessed to put all the calculations after the beginning of the WHILE statement and before the first IF statement. Here is the code from WHILE statement to the first line of the report. However, NONE of the calculations are let someone live with them...ugh! while($monthStart <= $today){$payment_found = false; foreach ($payments as $payment)
  19. I am creating an admission form which will ask for the information such as name, class, level, and such other information, so, I don't know how to connect to the database and how to make the database and how the database will store all that information. Can anybody explain it with real example with the code?
  20. Hello w3s.i'm not sure if i have asked in the right forum, was unsure if i should put the question in PHP or SQL area, anyways. i have attached a image where i show my so called forum so far made myself without trouble.Now i have ran into trouble that i would like to ask help for. LOOK AT PICTURE FOR THE IDEA here is my code: Menu: $HTMLOUT .= box_start("Forum Menu");$fm_res = mysql_query("SELECT * FROM mod_forum_menu ORDER BY fm_id ASC");$get_fc_id = (isset($_GET['fc_id']) ? '?fc_id='.$_GET['fc_id'].'&' : '?');//if isset...if (mysql_num_rows($fm_res) > 0)//if bigger than 0...{while($f
  21. Okay, here's HOW the code is supposed to work: Customer enters $startdate for a client in one form (info stored in one db table). Then customer enters several payments since $startdate. Then a report is automatically generated where the list on the left side of the report it automatically starts a date count from $startdate to $today. What I need to do is have the while loop pause, insert a payment entry based on date, then continue from there. There's also other things the report will do, but first thing's first...here's the working code that adds 1 month to the $startdate then stops when
  22. Conan

    PHP Mail() Problem

    Hello everyone, I'm new here, and I don't know where am I suppose to post this, but I think it's here .So, as the title says, my problem is that I've made everything correct, but the mail doesn't send to my email, or to the email I want, but it passes the code (I mean it gives me that "successfuly sent"), but when I check my email, there is nothing . here is the code, please id there is anything wrong tell me <?PHPfunction checkrow11($query1) { $query = mssql_query($query1); if(mssql_num_rows($query) > 0) { return true; } else { return false; } }/////////////////////////////// Co
  23. Hey Everyone! i have write this code for sending mail but it is not working. It is echoing the Error message. <?phpinclude "config.php";if(!$_POST) exit;$email = $_POST['email'];if(!preg_match('/\.([^\.]*$)/',$email )){$error.="Invalid email address entered";$errors=1;}if($errors==1) echo $error;else{$values = array ('name','email','message');$required = array('name','email','message'); $your_email = "aneeb@gmail.com";$email_subject = "New Message: ".$_POST['subject'];$email_content = "new message:\n";foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != '
  24. I have Table2 with a foreign key to Table1. I want to create a trigger that automatically update Table2 when Table1 is updated. Here is what's on my mind: create trigger MyTrigger on Table1 instead of update asif UPDATE(Table1_ID)begin declare @OldID as int, @NewID as int; select @OldID=P_ID from deleted; select @NewID=P_ID from inserted; update Table2 set Table1_ID=@NewID where Table2.Table1_ID=@OldID; update Table1 set Table1_ID=@NewID where Table1_ID=@OldID;end I received an error from SQL Server indicating that there was a conflict with the foreign key constraint when I tried to update
  25. ok, just quick... im getting this when trying to login: Unknown column 'e5035533a816cac4c54012281f58543d' in 'where clause' and this is my takelogin.php file: /*==========RUN LOGIN PROCEDURE===============*/$uname = sqlesc($_POST['username']); /*Form Names...*/$pass = sqlesc($_POST['password']); /*Form Names...*/if(isset($pass)){$passhash = md_5($pass); /*Securing The Data...*/}$query = "SELECT * FROM users WHERE username = $uname AND passhash = $passhash AND enabled = 'yes' AND status = 'confirmed'";$query_result = mysql_query($query)or die(mysql_error());//Running query to the DB...if(my
  • Create New...