Is there a way to reset an entire column to zero using Oracle SQL Express 11g


all,

This is my first posting on the forums. Here is my question:

I want to reset an entire column to zero monthly. Is the possible using Oracle SQL Express 11g I looked for a way to do it in the Oracle SQL Developer, but I didn't find away to easily do it there.

This is for a school project. One of the columns in the table is called monthly sales. That is the column that I want to reset to zero on the 1st of the month.
Posted On: Monday 31st of December 2012 01:09:27 AM Total Views:  255
View Complete with Replies

RELATED TOPICS OF Microsoft SQL Server PROGRAMMING LANGUAGE




Is there a better way to do this?

Hi all quick quesiton. Hope you can help with this one. Is this the most effiecient way to do this I want to display all columns in MS SQL: Code: select syscolumns.name as [Column], syscolumns.xusertype as [Type], sysobjects.xtype as [Objtype] from sysobjects, syscolumns where sysobjects.id = syscolumns.id and sysobjects.xtype = 'u' and sysobjects.name = 'tblAssociation' order by syscolumns.name Hope you can help. Kind regards MG
VIEWS ON THIS POST

72

Posted on:

Thursday 25th October 2012
View Replies!

Is there a way do use If inside Where clause?

I am trying to do the following: select * from table1 where createddate = '7/25/06' and id = @temp where @temp is char(1). The problem is @temp may be null or blank. I didn't want to check @temp and then run the select statement. How to check if @temp is not null or not empty inside WHERE clause and then run the select statement if @temp not empty
VIEWS ON THIS POST

114

Posted on:

Friday 26th October 2012
View Replies!

Expected output by sql

HI, I am having data as shown below ItemCode Attr1 Attr2 InStock ITEM-000001 43 S 1 ITEM-000001 52 L 2 ITEM-000006 42 R 1 ITEM-000006 44 R 2 ITEM-000009 56 R 1 ITEM-000011 40 R 2 And by using Pivot table (or any other technique) i want the reslut like as Output for ITEM-000001 O/H 43 52 S 1 - L - 2 Same for others. (I want to use the above output as a sub-report) O/H - On hand stocks Attr1 & Attr2 will change, so i want to create a dynamic columns of Attr2 & Attr1 as row header. Kind regards, Om
VIEWS ON THIS POST

99

Posted on:

Wednesday 7th November 2012
View Replies!

Database calculations

i have three tables in my database ( employee, salary, payroll), the basic salary of an employee is stored in the salary table but the payroll table stores all the calculation of the payroll. i want to calculate the employees salary from the salary table but i want the system to be able to calculate from the current date of increase i.e the payroll should calculate (if the previous salary was $2000 by 2004 and the new salary is $4000 by 2006 the system should calculate from the new salary.
VIEWS ON THIS POST

65

Posted on:

Wednesday 7th November 2012
View Replies!

Newbie needs help

I have set up SQL Server on a Windows 2003 Server, also running Sharepoint Team Services. However, I need to tell SQL server to do full text searching within file extensions other than the default. I really hope someone can tell me what I need to do and how, as I can not find any relevant help topics on the web. Many
VIEWS ON THIS POST

117

Posted on:

Saturday 10th November 2012
View Replies!

SELECT, IN statement

Can someone tell me how to use a variable with the IN statement This works: declare @emp [varchar](20), @per [varchar](6), @seq [varchar](30) set @emp='025390' set @per='200401' set @seq='84' Select Employee, RegHrs, OvtHrs, RegPay, OvtPay into #tmppd from EMPayrollDetail where Employee = @emp AND Period = @per AND PostSeq = @seq When I try and use the IN statement I get a syntax error: declare @emp [varchar](20), @per [varchar](6), @seq [varchar](30) set @emp='025390' set @per='200401' set @seq='84,92,98,99' Select Employee, RegHrs, OvtHrs, RegPay, OvtPay into #tmppd from EMPayrollDetail where Employee = @emp AND Period = @per AND PostSeq IN @seq I've tried to make @seq ('84','92','98','99') but it doesn't like that either. Can I use a variable with the IN statement Help
VIEWS ON THIS POST

171

Posted on:

Saturday 10th November 2012
View Replies!

Sql server express - decimal insert

i loop a text file lne and get this value similar: 53.710,00 27.650,00 62.950,00 40.340,00 0,00 120,00 i use this sql: TEST = "53.710,00" .... SQL = "INSERT INTO GIACENZE (IMPORTO) VALUES ('" & TEST & "')" cnt.Execute SQL, , adCmdText Or adExecuteNoRecords .... i want to know: 1) how to dim TEST in vb6 2) how to set type field MYFIEL in a sql server table to have the minimal 2 decimal in records in this case: 53.710,00
VIEWS ON THIS POST

103

Posted on:

Sunday 11th November 2012
View Replies!

Indexing the char field as integer

I have some character data stored in the database but when i am trying to index its not providing me results as required for example after indexing the data i can see in the order as 1 111 1111 12 2 21 but i need in the following order 1 2 12 21 111 1111 i have used the statement below Code: select col_1 from orderTable order by convert(int, col_1) but i am wondering if i can do the same and create index based on converting the filed into int is it possible , kindly share any example code.
VIEWS ON THIS POST

81

Posted on:

Sunday 11th November 2012
View Replies!

Count Function

I select 3 random records from a certain catagory, now I want to count and see if there are ast least 3 records returned, sometimes theres only 1 or 2 and I wanna see that. I Cant figure out how to include count with Top. Heres my code Code: strsql = "Select TOP 3 * from tb_inventory where profile='" & strprofile & "' AND sold >= 1 order by NewID()"
VIEWS ON THIS POST

62

Posted on:

Sunday 11th November 2012
View Replies!

Invalid object name

Firstly, I have searched the forum for my problem and couldn't find a solution. We just upgraded from SQL 2000 to SQL 2005. We still have the 2000 box running because we're having problems with the 2005 server. We have a classic asp application that uses the database. We researched and found that all sql queries, connection strings would work with sql 2005 without having to modify them. Now on the sql 05, when we view an asp page we get this error: Code: Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E37) Invalid object name 'TableName'. /systema/Image/Soft/repor.asp, line 139 Where line 139 is where the connection string is: Code: strConnect = "Provider=SQLOLEDB.1; Initial Catalog=dbname; Data Source=servername; User ID=test_sa; Password=test_sa" From the research we did on that problem we found that in most cases its the permission settings for the user or something like that. But, we copied the user permissions EXACTLY from sql 2000 settings. And in sql 2000 it worked fine. The thing is that when we modify the actual select statements in the asp file to include the username in front of the table name it works, shown below: Code: rS1.Open "Select [ID],[Name] From test_sa.HardwareSection Where [Department]=" & rS("ID") & " Order By [Name]" When I do this (shown below), it doesn't work: Code: rS1.Open "Select [ID],[Name] From HardwareSection Where [Department]=" & rS("ID") & " Order By [Name]" Now the thing is that I can't go into every asp file (there are a lot) and modify this. There has to be something more general that needs to be changed for this to work.
VIEWS ON THIS POST

151

Posted on:

Monday 12th November 2012
View Replies!

Force Encryption Login not working

i've enabled the certification authentication login i use SQL 2K5 ENT my problem is like that: in the client network utility i check the Force protocol encryption and connect to the server the client can't connect because he doesn't have the which it's OK. the problem is when i remove the Force protocol encryption on the client he connect successfully without the certificate install on his machine or any thing. i double check that on the server i've YES on the Force Encryption in the protocols For MSSQLSERVER. why is that\t THX
VIEWS ON THIS POST

79

Posted on:

Tuesday 20th November 2012
View Replies!

Database online

hi all consider i have a data presenter in my application and i want to it shows my data from sqlserver database , can i view my data in data presenter control online \t that's mean when i changed a record in table without any refresh i see changes in my control. its possible its relative with sql server or not same vfp(visual foxpro databases)
VIEWS ON THIS POST

104

Posted on:

Tuesday 20th November 2012
View Replies!

Data File Crashed!!! Could not redo log record

My server crashed unpredictably and after rebooting the server I cannot mount my database file. The Sql Server says: "Microsoft SQL - DMO (ODBC SQLSATRE: HY000) Error 3456: Could not redo log record (238735:1315:1), for trunsaction ID (0:99832840), on page(1:315980), database saprykin (7). Page ... Is thear any way to restore my data I have trunsaction log, but I dodn't have a back up copy.
VIEWS ON THIS POST

97

Posted on:

Tuesday 20th November 2012
View Replies!

UNION: select order

i have 2 selects: select * from view_veiculos where nome_marc like '%fiat%' and ano='2001' union select * from view_veiculos where nome_marc like '%fiat%' when i execute it on sql server, i get the following results: id 1 _______ ano 2004 id 2 _______ ano 2001 the row with ano 2004 is before the row with ano 2001 the problem is that id like it to be ordered following the select order, which means that 2001 should be displayed before 2004, like that: id 1 _______ ano 2001 id 2 _______ ano 2004 all the results from the first select from the query need to be placed before the results from the second query. how can i make it
VIEWS ON THIS POST

95

Posted on:

Tuesday 20th November 2012
View Replies!

Need help understanding .NET Pet Shop 4.0

! I was assigned a task on creating a web application that connects and display database information on a grid view. My supervisor suggested me to download .NET pet shop 4.0 as to serve as a template for my project. As I only have limited basic knowledge on C# and HTML codings, the .NET pet shop 4.0 is too difficult for me to understand. So I have a few questions: Which function are required to connect to the databaseWhich function display information of the databaseHow do I change the categories of the .NET pet shop 4.0If I want to add a grid view to display the records instead of listing information for product, how will the code roughly look like I need urgent help as I need to produce results soon,
VIEWS ON THIS POST

111

Posted on:

Tuesday 20th November 2012
View Replies!

Drop down list

Hi Everyone, I have created an SQL database on 1 and 1 (my host) server and needed some assistance. 1 and 1 do not allow you to make an external connection to MS SQLServer due to security reasons! I have to hand code everything. I wanted to populate a drop down list with a column from the database. I have a column called menu_type with the values starters, main course and desserts. I want to populate the drop down list with these three values - and then when 1 is selected (for example starters) then a table of the starter menu appears. How can I go about doing this
VIEWS ON THIS POST

84

Posted on:

Tuesday 20th November 2012
View Replies!

Anyway to Reset identity back to start value?

I have a table in which the primary key is an id starting from 1 and incremented by 1 each time. So it goes 1,2, Now for testing, I delete info from the table and say if I delete record 1 the next record added has id as 2 and not 1. Anyway to reset this without creating the tables all over again
VIEWS ON THIS POST

178

Posted on:

Tuesday 20th November 2012
View Replies!

NOLOCK and SQL Server... Perfect together?

I'm using NOLOCK on some search queries... some times I get this error message throught the day. [Microsoft][ODBC SQL Server Driver][SQL Server]Could not continue scan with NOLOCK due to data movement Is there anything I should lookup I am also getting a ton of timeouts recently and I can not figure out why... not all of my connects are getting timeouts... just some of the search queries... Any thoughts or directions would be mucho apprciated
VIEWS ON THIS POST

105

Posted on:

Tuesday 20th November 2012
View Replies!

Tricky SQL Query WHERE Clause

Im a little stuck on an sql query. I am trying to achieve the following in the WHERE clause:- Code: WHERE the current date is 14 days less than 15/04/(current year using datepart) I have tried:- Code: WHERE ({ fn NOW() } + 14 = '15/04' & DatePart (YYYY) = DatePart(YYYY, {fn now()}) & ) I think it would be something similar on these lines
VIEWS ON THIS POST

85

Posted on:

Monday 26th November 2012
View Replies!

Changing database

and gals... i need to move from a access to SQL db, i've never done this before, is there a procedure to follow or just some tips for me
VIEWS ON THIS POST

149

Posted on:

Monday 26th November 2012
View Replies!

Select * From question

If i got a database. the database contains: Audi, ford, opel, etc.. sql = "SELECT * FROM Cars WHERE Model='" & model & "';" Now i gotta write Audi to get audi.. How do i get so i just write Au, or Fo, or something like that so i get everything that goes with those letters
VIEWS ON THIS POST

119

Posted on:

Monday 26th November 2012
View Replies!

Sql Server Primary Key Violations

I am trying to upsize an MS Access Database to SQL 2000 and running into problems with som of my append and update queries. In MS access if you run an append query and some of the data your are appending violates the primary key of the table you are appending to, Access will disregard the duplicate records, but will go ahead and append all the rest of the records that don't violate the primary key. If you run the same query in SQL Server, no records get appended if only one record violates the primary key (I think). Is there a way to make SQL server act the same as MS Access - Disregard the records that violate the primary key, but go ahead and append the records that don't violate the primary key
VIEWS ON THIS POST

47

Posted on:

Monday 26th November 2012
View Replies!