Field Constraint For Days Of Week Using Single Letter Representation
Jul 6, 2013
I know I can add a check constraint for m,t,w,r,f,s,u How can I add a constraint that will allow any combination of the above. For example it would allow m or mf, or mwf Someone said it could be done with trim but I can not figure it out.
View 1 Replies
ADVERTISEMENT
Oct 25, 2011
how can create function or sql statement to show week of days without Friday and Saturday
View 13 Replies
View Related
Apr 12, 2010
I need to schedule a procedure on SUN, MON,TUE, WED and THU at 6:30 AM. make sure the folloiwng code is o.k.
begin
dbms_scheduler.create_job
(job_name => 'Load-Data_Calc',
job_type => 'STORED_PROCEDURE',
[code]...
View 5 Replies
View Related
Sep 25, 2012
how to caluclate days between two dates of single timestamp filed and with this
query
Select * from m_activity_transaction where actn_opp_id in (
Select actn_opp_id from m_activity_transaction where ACTN_ACTV_ID = 218
Group by actn_opp_id
[code]...
and i nedd to caluclate no.of days between two dates like 27-JAN-12 11.06.20.000000 AM and 08-FEB-12 05.32.54.000000 PM where actn_id is unique AND ACTN_OPP_ID IS NOT UNIQUE.
View 6 Replies
View Related
Mar 6, 2013
I've successfully created the below two tables (disregard my use of "char" variable type; beyond the scope of my question):
create table Test_req (
Req_ID varchar2(4) not null,
Req_Comment varchar2(50) null
);
create table Test_n_cycle (
Req_ID varchar2(4) not null,
[code].....
Then I successfully performed the two alter statements:
Alter table test_n_cycle
add constraint test_n_cycle_pk primary key (req_id, test_id);
Alter table test_req
add constraint test_req_pk primary key (req_id);
Then tried this freign key reference statement
Alter table test_n_cycle
add constraint
foreign key (req_id) references test_req (req_id)
Error report:
SQL Error: ORA-00902: invalid datatype
00902. 00000 - "invalid datatype"
Is this because req_id is also defined in the Primary key definitions on these two tables, thus making the field not valid for referential constraint definition?
View 3 Replies
View Related
Jan 26, 2012
I have a table containing records with a field representing a png image that is encoded as base64 text. The procedure responsible for creating the record receives the base64 information in a parameter of type CLOB. It then inserts it in a field of same type on the record. I want to transform the CLOB data into an image and display it back on the form.
View 1 Replies
View Related
Sep 2, 2011
I have installed Oracle Database 11g.2 by database configuration assistant on windows XP as and adminstrator on my laptop(no connection to network),but when I want to create database I face this warning: error securing database control ,Datatbase control has been brought up in non-secure mode . to secure the database conntrol execute following command....(error is attached).
View 7 Replies
View Related
Dec 6, 2010
We are using 10G Forms and Reports against a 8I database (DB1) which has a link into another 8i Database (DB2).
DB2 has been upgraded to 10G. The application works fine but when I try to compile the forms in form builder I get an "ORA-03115, unsupported network datatype or representation." error.
The error occurs where the code in the form references the link directly. Other code where we created views to hide the link name works fine. BTW Same code works fine in SQL Plus 10G & Toad.
I have tried changing the type of variables & different columns but that did not work.
View 1 Replies
View Related
Sep 10, 2012
CREATE TABLE prim_tbl
(id NUMBER,--- id is not primary key here
description VARCHAR2(30));
INSERT ALL
INTO prim_tbl VALUES (1,'aad')
INTO prim_tbl VALUES (1,'aads')
INTO prim_tbl VALUES (2,'bb')
INTO prim_tbl VALUES (2,'cc')
INTO prim_tbl VALUES (2,'dd')
SELECT * FROM dual;
I want to select the ids only one time, i.e my output will have only two rows: one row with id as 1 and other row with id 2 whatever be the description.
desired output sample:
Quote:1, aad
2, bb
I used:
select distinct(id),description from prim_tbl;
but it did not give the required result.How can I get it??
View 6 Replies
View Related
Feb 19, 2011
In literal terms, I'm interested in two fields, I'll call them Field A and Field B. I want to find all situations where a single unique value of Field A has both values Z AND X in Field B (not either or, but both together).
To go into some detail -
I need to make a query that finds ONLY occurrences where one employee id has a certain set of values together (without going into specifics, I'll say PermissionA, PermissionB, PermissionC). I can easily make a query that returns all user id's and all permissions belonging to them, and I can use criteria to filter the results to Permission A B and C only so as to exclude other permissions from getting returned (since there are hundreds),
however my objective is to get ONLY results where the same employee ID has all of those permissions (not just any one or two of the three). However, I don't want to have any criteria that limits the employee ID (I want to search all employee id's, and get a list of those with permissions a and b and c, not just any combination thereof, but all of them). I'm currently able to organize the output using a pivot table by employee id > role,
so that I can easily look at each employee and the roles they have, but I want to undertake a project that will involve searching a much larger number of employees (a # that makes it impractical for me to look through the list, I need to have a query that limits the results to the combinations that I'm looking for, as in this example - permission a b and c together).
View 1 Replies
View Related
Nov 3, 2010
Consider below is a multi record block rows, i want to hide "23". Is it possible using Set_Item_Instance_Property or any other built-in is there in oracle forms to hide a single row field in a multi record block.
11 12 13
21 22 23
31 32 33
. . .
View 3 Replies
View Related
Oct 20, 2010
I have developed one report but need one formatting suggestion. There is one field called "DESCRIPTION", I want the value of this field to be displayed in a single line. Now the big values are wrapped into multiple line.
Now,
DISPLAY
----------------
This is a Oracle
Report.
I want,
DISPLAY
------------------------
This is a Oracle Report.
Maximum size of "DISPLAY" field is VARCHAR2(240).
View 3 Replies
View Related
Jul 8, 2012
I have a table in schema with a BLOB field. I store employee's picture in this field. Fields in this table are emp_id (number) emp_name (varchar2) and emp_photo (BLOB). I want to ask if there is a way in pl / sql that i could empty this BLOB field to null or reset this field so that user can change the saved photo graph and save another one.
what i am looking for is something like
alter table employee set emp_photo = empty_blob() or alter table employee set emp_photo = null
View 3 Replies
View Related
Jul 2, 2012
i need to write to word doc from pl/sql . these are letters which needs to printed . Can i use the same UTL_FILE and will i be able to control the font etc from pl/sql
View 6 Replies
View Related
Apr 5, 2011
want to write Procedure to return weeks and days from given set of days.
let suppose we have 72 days to return weeks and days then return should be 7 weeks and 2 days.Can i use date function Or ?
View 5 Replies
View Related
Jul 30, 2010
how to select the name that starts with first letter caps.
Eg:
Emp_Name Emp_id
Raga 101
Purnima 102
Vicky 103
ragu 104
raman 105
Santhosh 106
output should like as following:
Emp_Name
Raga
Purnima
Vicky
Santhosh
4 row(s) affected.
View 39 Replies
View Related
Oct 4, 2013
I want to retrieve first letter of every word from the string.
For ex. if string is "Computer Science Engineering (New)" then I want "CSE" or if string is "Mechanical Engineering" then "ME".
how to do this..
View 18 Replies
View Related
Jun 22, 2010
I need a sql/function that formats employee names in Initcap including names with internal capital letters.For example:
Mark VanTassel should be Mark VanTassel and not Mark Vantassel
McGowen should be McGowen
O'Neil should be O'Neil.
found this on the web but didn't quiet understand and didn't work for me.
CREATE OR REPLACE FUNCTION cul_initcap(input_val text) RETURNS text AS
BEGIN
SELECT
REPLACE(
REPLACE(
REPLACE(
REPLACE(
[code]....
View 11 Replies
View Related
Dec 25, 2007
i want to get table name, constraint name, constraint type with join processes in string type. this is what i want: alter table tablename add constraint constraintname constrainttype(columnname)
View 1 Replies
View Related
Feb 19, 2013
I have a table of records with a date_modified column. I would like to simply report the count of updates made each week. For example, given:
Record Date_Modified
155291141/23/2013
157277201/24/2013
152619321/25/2013
142263211/28/2013
140043421/28/2013
150050431/28/2013
148315761/29/2013
154364281/31/2013
148066382/1/2013
[Code]...
I would like to return:
Week Updates
43
57
69
77
84
Although in place of the week number, providing either the value for the last day of the week or the first day of the week would be just as good.
how to go about this task.
View 7 Replies
View Related
May 26, 2013
As my requirement is that to find week for particular date according to Arabic calender.As per Arabic calender first day for year starts from saturday.
so when i execute query :
select to_char(to_date('05/26/2013','MM/DD/RRRR'),'WW')
from dual;
Then it gives 21,but as per arabic calender it should show 22nd week.
getting result according to Arabic calender as it should return 22,because weak starts from saturday according to Arabic calender.
View 6 Replies
View Related
Jun 29, 2012
I had to get a query to give me all the Mondays of a IW week in a year. I think as per the IW weeks there are around 52.1 weeks in a year. So basically, I want the starting Monday of every week. I would then store those values in a variable and use them in APEX as column headers. Online I saw some samples not related with this, but where looping was done using the all_objects. Not sure if that is the right approach.
The problem is since this is not stored in any table, how can I loop like 52/53 times such that the output shows all the Mondays (date format) for a given year. Basically, the output would be 52/53 rows with a date(Monday of the week).
View 10 Replies
View Related
Oct 18, 2012
I need to change Monday like first day of week and not Sunday.
select to_char(to_date('01-01-2012'),'w') from dual
Result: 1
select to_char(to_date('02-01-2012'),'w') from dual
Result:1
and the idea is that 02-01-2012 must be the second week
View 3 Replies
View Related
Dec 31, 2012
I am running 10g on Linux, and last week someone messed up a database and it needs to be restored to 27 December. I am not a DBA, out regular DBA is on vacation till mid January,
I know we have archivelog on (I can see .arc files for the database), and I also have a backup of the actual data files and control files from when the database was first created. So in other words, I have all archive files and the initial data files. What i do not know is how to set the restore till December 27.
View 8 Replies
View Related
Nov 2, 2011
I have a create a report for our dept with certain criteria. So far what I need is a report that shows last weeks numbers or sign ups. I can't get the date search or between to work.
What I need is one for month end and one for last 7 days.
here's what I have so far.
select ap.name
to_char(ap.opendate,'MM-DD-YY') "Open Date"
from [databasname]
where ap.opendate between databasename-7 and databasename-1
I really don't want to change the date myself I want the system to know when the 7 days or month is.
View 4 Replies
View Related
Feb 5, 2011
I am creating report for this i want to make one query..
Query like this
My input is YEAR, MONTH AND WEEK and i want to find out start date and end date for this week...
Scenario like this
-----------------
I/P - Year = 2011, WEEK = 2 , Month - FEB
i will get o/p like this '06-feb-2010' and '12-feb-2010'...
View 10 Replies
View Related
Apr 5, 2011
How to get a date using Year (say 2009), Week (35) and Weekday (5). I have read only permission to database, so I can not create a function.
View 8 Replies
View Related
Jul 14, 2010
How to display date every monday within date range
DEsc start date end date
XXXX 1/2/2010 31/10/2010
output
date every monday
View 25 Replies
View Related
Nov 9, 2012
I want to get the week of the year.
Conditions are:
1. Year's first week starts with first Sunday of the year. (6th Jan 2013 will be the starting week (week 1) in Year 2013)
2. 2nd Jan 2013 will be the last week of the previous year i.e. 2012 (either 52th or 53rd week)
At many place I found the below solution:
select to_char(to_date('01-JAN-2008','DD-MON-YYYY')+1,'IW') week_number from dual;
But its not working for the given dates (2nd Jan 2013, which should fall in the last week of 2012, and 6th Jan 2013, which should be the starting week of 2013).
View 6 Replies
View Related
Mar 7, 2010
I have two columns in table
sales_date
sales_amount
I need to find total sales for the whole last week.
Today is current week i.e. 1 (March 1, 2010 and March 7, 2010)
I need to find total_sales for the last week (i.e. Feb 22, 2010 to Feb 28, 2010)
I am unable to create logic for the same.
View 4 Replies
View Related