|
it is Express Edition.
Oracle Database Express Edition at the top and it's FREE and limited to 11 GB..!
It's confusing now..!
Technology News @ www.JassimRahma.com
|
|
|
|
|
From version 11g2 it's 11GB, before that it's 4GB.
|
|
|
|
|
|
If you go to the next page[^] they specify it as 11GB of user data. (emphasis mine)
|
|
|
|
|
What about the size of your current MySQL database? The space required for storing the data and the indexes does not differ a lot between different databases.
|
|
|
|
|
I am going to define a table for Book's Publisher so I want to give a name like Book_Publisher_Mapping. But when I will map this with EF then It creates a partial class that name is Book_Publisher_Mapping. So it is not good name for class. I think class name should be like BookPublisherMapping. So I should define table like BookPublisherMapping. It's a good naming convention for table name in Pascal case without _.
Thanks
|
|
|
|
|
It is an excellent naming convention underscores (_) were invented because the devil (Oracle) could not work out what lower case is.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i am receiving Emplid in this action,
public ActionResult showDDL(int? EmplID = null)
{
ViewBag.EmplID = EmplID;
if (EmplID == null)
{
IEnumerable<GetAtdRecord_SpResult> EmployeeAtd_2 = DataContext.GetAtdRecord_Sp(0).ToList();
return View(EmployeeAtd_2);
}
else if (EmplID != null)
{
IEnumerable<GetAtdRecord_SpResult> EmployeeAtd_2 = DataContext.GetAtdRecord_Sp(EmplID).ToList();
return View(EmployeeAtd_2);
}
return View();
}
View:
@{
var grid = new WebGrid(ViewData.Model, defaultSort: "EmplID", rowsPerPage: 20);
}
@if (Model.Count > 0)
{
<div id="AllEmpGrid_ByName">
@grid.GetHtml(columns: grid.Columns(
grid.Column("EmplID", "Employee ID"),
grid.Column("EmplName", "Employee Name"),
grid.Column("ShiftID", "Shift ID"),
grid.Column("DateVisited", "Date of Visit"),
grid.Column("InTime", "In Time"),
grid.Column("TimeOut", "Time Out"),
grid.Column("OverTime", "Over Time"),
grid.Column("TotalWorkingTime", "Total Working Time")
))
</div>
using (Html.BeginForm("ToExcel", "Home", FormMethod.Get))
{
<button type="submit" class="button_form button_download" >Download in Excel</button>
}
}
else
{
<h2 class="error" >No Data Found</h2>
}
In same View you can see, button DOWNLOAD IN EXCEL, i want to pass this emplID to ToExcel method
public ActionResult ToExcel(int? empid )
{
var DataContext = new EmployeeRecordDataContext();
var grid = new GridView();
grid.DataSource = DataContext.GetAtdRecord_Sp(null).ToList();
grid.DataBind();
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment; filename=AttendanceSheet.xls");
Response.ContentType = "application/ms-excel";
Response.Charset = "";
StringWriter sw = new StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
grid.RenderControl(htw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
return RedirectToAction("index");
}
i can't figure out that how to pass EmplID recieved in Action 'showDDL' to EmpID when i click Button "Download in Excel" ?
|
|
|
|
|
And what has this got to do with databases?
You'll stand more chance of getting an answer if you post your question in the correct forum[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This query shows emplName,emplID, totalworking time, InTime, OutTime, DateVisited, Overtime for an employee based on his InTime and Outime, that's OK. Now i am trying to modify it to show only emplID, EmplName, Total Working hours(Per month), total overtime (per month).
e.g.
Empid EmplName TotalWorkingHours TotalOvertime Month
00001 John 77:00 05:55 2013-02
00002 Masn 57:00 04:56 2013-02
Query:
with times as (
SELECT t1.EmplID
, t3.EmplName
, min(t1.RecTime) AS InTime
, max(t2.RecTime) AS [TimeOut]
, t4.ShiftId as ShiftID
, t4.StAtdTime as ShStartTime
, t4.EndAtdTime as ShEndTime
, cast(min(t1.RecTime) as datetime) AS InTimeSub
, cast(max(t2.RecTime) as datetime) AS TimeOutSub
, t1.RecDate AS [DateVisited]
FROM AtdRecord t1
INNER JOIN
AtdRecord t2
ON t1.EmplID = t2.EmplID
AND t1.RecDate = t2.RecDate
AND t1.RecTime < t2.RecTime
inner join
HrEmployee t3
ON t3.EmplID = t1.EmplID
inner join AtdShiftSect t4
ON t3.ShiftId = t4.ShiftId
group by
t1.EmplID
, t3.EmplName
, t1.RecDate
, t4.ShiftId
, t4.StAtdTime
, t4.EndAtdTime
)
SELECT
EmplID
,EmplName
,ShiftId As ShiftID
,InTime
,[TimeOut]
,convert(char(5),cast([TimeOutSub] - InTimeSub as time), 108) TotalWorkingTime
,[DateVisited]
,CASE WHEN [InTime] IS NOT NULL AND [TimeOut] IS NOT NULL THEN
CONVERT(char(5),CASE WHEN CAST([TimeOutSub] AS DATETIME) >= ShEndTime And ShiftID = 'S002' Then LEFT(CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, CAST(ShEndTime AS DATETIME),CAST([TimeOutSub] AS DATETIME)),0), 108),5)
WHEN CAST([TimeOutSub] AS DATETIME) >= ShEndTime And ShiftID = 'S001' Then LEFT(CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, CAST(ShEndTime AS DATETIME), CAST([TimeOutSub] AS DATETIME)),0), 108),5)
ELSE '00:00' END, 108)
ELSE 'ABSENT' END AS OverTime
FROM times order by EmplID, ShiftID, DateVisited
|
|
|
|
|
Just remove the columns you don't need and you should be good to go. Are you facing any issues?
|
|
|
|
|
sorry what ? i need sum of time per month sir
|
|
|
|
|
|
i have written this query to show total working time and overtime of an employee on particular date (if he has came) otherwise it doesn't show record for a person if his INTIME and TIMEOUT are empty but i don't want this now, i want if for a particular date person's INtime and OutTime are empty then put 00:00 in his intime, outtime, totalworkingtime, overtime.
e.g.
EmplID EmplName ShiftID intime Outtime totalworking overtime dateVisited
0000001 John S001 00:00 00:00 00:00: 00:00 2013-12-01
Query:
with times as (
SELECT t1.EmplID
, t3.EmplName
, min(t1.RecTime) AS InTime
, max(t2.RecTime) AS [TimeOut]
, t4.ShiftId as ShiftID
, t4.StAtdTime as ShStartTime
, t4.EndAtdTime as ShEndTime
, cast(min(t1.RecTime) as datetime) AS InTimeSub
, cast(max(t2.RecTime) as datetime) AS TimeOutSub
, t1.RecDate AS [DateVisited]
FROM AtdRecord t1
INNER JOIN
AtdRecord t2
ON t1.EmplID = t2.EmplID
AND t1.RecDate = t2.RecDate
AND t1.RecTime < t2.RecTime
inner join
HrEmployee t3
ON t3.EmplID = t1.EmplID
inner join AtdShiftSect t4
ON t3.ShiftId = t4.ShiftId
group by
t1.EmplID
, t3.EmplName
, t1.RecDate
, t4.ShiftId
, t4.StAtdTime
, t4.EndAtdTime
)
SELECT
EmplID
,EmplName
,ShiftId As ShiftID
,InTime
,[TimeOut]
,convert(char(5),cast([TimeOutSub] - InTimeSub as time), 108) TotalWorkingTime
,[DateVisited]
,CASE WHEN [InTime] IS NOT NULL AND [TimeOut] IS NOT NULL THEN
CONVERT(char(5),CASE WHEN CAST([TimeOutSub] AS DATETIME) >= ShEndTime And ShiftID = 'S002' Then LEFT(CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, CAST(ShEndTime AS DATETIME),CAST([TimeOutSub] AS DATETIME)),0), 108),5)
WHEN CAST([TimeOutSub] AS DATETIME) >= ShEndTime And ShiftID = 'S001' Then LEFT(CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, CAST(ShEndTime AS DATETIME), CAST([TimeOutSub] AS DATETIME)),0), 108),5)
ELSE '00:00' END, 108)
ELSE 'ABSENT' END AS OverTime
FROM times order by EmplID, ShiftID, DateVisited
|
|
|
|
|
Change your inner joins to outer joins
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
When building these type of query I break it down to getting the primary list (employees) and getting the data you are reporting (timesheet information) then I use a left outer join between the primary and data queries and use ISNULL to display the default values (00:00).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey guys
I have two tables
1- Holds the cars passed (CarId, DeviceId, PassDate)
2- Holds the List of Cameras capturing each car (DeviceID, DeviceName)
I want to check on a specific Date the maximum number of car passed in period(every 60 minutes, 2 hours …)
So I have to use a double loop the first for each device and the second for the period.
For(everydevice)
{
For(every period in the time)
}
The should look like this List
Device Name --------- Max Passed Cars
Since I’m new to oracle SQL Programming I dunno how to implement this, I appreciate it if you can help me out
|
|
|
|
|
You can do this in a single select query, grouping by deviceID, calculating Count(carId) with a where clause on the passdate between period start and period end
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
If i'm not mistaken this works when I want to get the maximum number, but here I want to see for example what is the maximum passed number of cars in every 60 minutes.
|
|
|
|
|
You can also add a grouping on the DatePassed column, formatted in such a way as to just display the date and hour
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Chris Quinn wrote: I'm an optoholic
Actually, you mean optiholic because optimist is spelled with an 'i', not an 'o'.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
... but alcoholic is spelt with an o, not an i!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Touche!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I wish everyone was as clear in what they want.
WITH CTE AS (
SELECT CarId
,TO_CHAR(PassDate, 'YYYY-MM-DD HH24') AS hours
,TRUNC(PassDate, 'HH24') AS hours
,DeviceName
FROM cars c,devices d
WHERE c.DeviceID = d.DeviceID
)
SELECT Count(carID) Cars_passed
,hours
,devicename
FROM CTE
GROUP BY hourly
,devicename
<edit>Revisited and fixed so that hours remains the correct type</edit>
modified 5-Feb-14 1:44am.
|
|
|
|
|
Thanx. 
|
|
|
|
|