New Column Still Defaulting To Value From Deleted Column With Same Name
This is strange. I had a managed metadata column called "Document Category" attached to multiple content types and set to a default value (different in each library). Then I deleted the column (all instances from libraries and references from
content types as well), and created a new site column with the same name, but a Choice field instead. The libraries that had a default value for the original column, are still populating new documents using the original default value, and it's showing up as
something like 88;#Hospital Correspondence|4b1e8da6-8653-492a-3e45e6c56c38 . The column is still a choice field, so I don't even know why it allows this value. Does anyone know why this is happening or how to fix it?
Hi Vince,
Thank you very much for sharing your solution here. It would be helpful for others who encounter similar issue.
Thanks again,
Eric
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
contact [email protected]
Eric Tao
TechNet Community Support
Similar Messages
-
While saving multiple attachments from mail, files with same name are added and not replaced
While saving Multiple Attachments from Mail, existing file with same name are not overwritted but new files are added in the folder.
Bjørn Larsen a écrit:
Hi all
Hope to get some help with Elements Organizer.
I have 12-15 years of digital photos that I now want to import into my newly aquirede Adobe Elements Organizer / Photoshop. Since my Nikon names the files with continous numbers from 0001 to 9999 I have multiple files with the same name although they are not alike at all. My previous software had no problems with that since I keep the photos in separate file folders based on import date. I generally import photos after each event and so name the folder with the date and some event info (e.g. 2014.12.24 - Christmas at grandparents).
That is a common situation, I have the same limitation for files not going over 9999 on my Canons...
Now - when I import my photos into Elements Organizer I get a lot of error messages with "same name exist .....) Hmmmmmmm
Please sate the exact wording of the error message, I have never seen a message stating 'same name exist...' or equivalent; only messages about files already in the catalog. Files already in the catalog mean that some files have the same 'date taken' and file size in Kb.
Any suggestions. I'm using a mac and tried to rename files based on date taken. The mac can do that but it takes ages to go into each folder and run the renaming script there.
I also use a similar folder creation scheme (such a date naming is the default for the downloader). That way I never get a message about duplicates for the same file names.
However - I can't be the first or only person with this problem so I figure that some workaround must be known out there. Maybe the import action can recognize date taken or - well. Thank you very much in advance if you can help me out here.
You can alsways set the downloader to rename the imported files with a unique new name, there are many options in the 'advanced' dialog of the downloader. I don't know about Macs, but I don't thing there is a difference. -
Hello All.
I have read loads of forums and tried numerous fixes and configurations, but nothing seems to work and I am extremely frustrated at this point.
I have a client where I setup Server 2012 Standard with Exchange 2013. After reading best practice documentation for DNS naming and reasons not to use ".LOCAL" I opted to use ".com.na" in which case the Internal Domain Name and Internet
Website now has the same name.
When attempting to open the extarnal website eg. "www.company.com.na" from a client PC within the internal "company.com.na" Domain, I keep getting error "403 - Forbidden: Access is denied. You do not have permission to view this
directory or page using the credentials that you supplied."
I should also mention, the website is hosted by an ISP and not locally.
I added a "www" Host record in the Forward Lookup Zone, I have added the url and ip address to the Hosts file on a client pc (Windows 7) and even tried setting up Split-Brains DNS. Nothing seems to work.
Running a Tracert takes me to the correct public ip address of the website, but I keep getting this 403 error.
I am so sick and tired of this issue that iI am at the point of backing up the Exchange and re-rolling the entire server with the ".local" DNS domain name. I have a mirror setup in a VMWare environment and simply using "rendom" to rename
the domain seems to cause new issues with Exchange connectivity.
Any pointers and help will be greatly appreciated.
Thanks in advance.
Hentie LootsI opted to use ".com.na" in which case the Internal Domain Name and Internet Website
now has the same name.
This ends up with a split-DNS stup for internal and external resolution which requires extra administration tasks and attention from the administrators.
When attempting to open the extarnal website eg. "www.company.com.na" from a client PC within the internal "company.com.na" Domain, I keep getting error "403 - Forbidden: Access is denied. You do not have permission to view
this directory or page using the credentials that you supplied."
I should also mention, the website is hosted by an ISP and not locally.
I added a "www" Host record in the Forward Lookup Zone, I have added the url and ip address to the Hosts file on a client pc (Windows 7) and even tried setting up Split-Brains DNS. Nothing seems to work.
Running a Tracert takes me to the correct public ip address of the website, but I keep getting this 403 error.
This means that you are able to reach the Website but it is responding with the access denied error message. That should be checked on the middleware level so if this is IIS running then I would recommend asking them in IIS forum: http://forums.iis.net/
If this is a Website that is completely managed by your ISP then I would recommend checking with them.
This posting is provided AS IS with no warranties or guarantees , and confers no rights.
Ahmed MALEK
My Website Link
My Linkedin Profile
My MVP Profile -
Making a new column out of the values from another column
I am trying to query the transaction table and the promotion table to get the following output..
select t.no, t.date,p.groupid,p.promocode,sum(t.salesamt)
from trans t, promo p
where t.id=p.tid
group by t.no,p.groupid,p.promocode,t.date
order by t.date
no
date
groupid
promocode
promodesc
sum(t.salesamt)
m12
01-jun-2012
09
p12
Promotion1
7890.00
m12
01-jun-2012
09
p13
Promotion2
345.56
m12
01-jun-2012
09
p14
Promotion3
2345.90
m12
01-jun-2012
09
p12
Promotion1
345.12
m12
01-jun-2012
09
p13
Promotion2
23678.00
m12
01-jun-2012
09
p14
Promotion3
3456.78
I want to remove the promodesc and the sum(t.salesamt) and add Promotion1,Promotion2,Promotion3 as three new columns and their respective sum(t.salesamt) as their data value.
I am thinking about using three separate case statements to achieve this...
sum( case when promocode='p12' then t.salesamt end) Promotion 1
Please let me know if there is any other optimal way to achieve this.
Thank you!Hi,
What you want is called a Pivot. Using CASE expressions (like you described) is one common way to do pivots. If you're using Oracle 11.1 (or higher) then you'd probably want to use the SELECT ... PIVOT feature instead. See the SQL Language manual
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#sthref6809
and the forum FAQ
https://forums.oracle.com/message/9362005
for details and examples.
If you get stuck, post your best attempt, along with CREATE TABLE and INSERT statements for a little sample data, and the results you want from that data (if different from what you've already posted).
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Retrieving multiple values from one column in SELECT statement
Hi,
I have a slight dilemma in that I'm trying to pull down all the values from a column from a select statement that includes some JOINS in it.
If I run the query at the SQL Plus prompt, it pulls back all the values/rows.
When I run the select (and prepared ) statement in my JSP, it only pulls back one of the 4 values I'm trying to retrieve.
e.g.
at the DB level :
SELECT role_name, CC_ID FROM votetbl a
INNER JOIN APPROVERS b ON
a.BUSVP = b.BUSVP AND
a.BRANCH = b.BRANCH
WHERE CC_ID = 1688this will return:
ROLE_NAME CC_ID
ops 1688
ops 1688
comply 1688
legal 1688
comply 1688
When run in my JSP, like so:
String primID3a = request.getParameter("primID");
Statement stmtovoter = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
String prepvotSQL = "SELECT role_name, CC_ID FROM votetbl a INNER JOIN APPROVERS b ON a.BUSVP = b.BUSVP AND " +
"a.BRANCH = b.BRANCH WHERE CC_ID = ?";
PreparedStatement prepvotstmt = connection.prepareStatement(prepvotSQL);
prepvotstmt.setString(1, primID3a);
ResultSet rest3 = prepvotstmt.executeQuery();
rest3.next();
String votecat = rest3.getString(1);
out.println("Vote category: "+votecat);I only get ops returned.
Do I need to run an enumerator? Or reqest.getParameterValues or use a while statement around the results set?
Any feedback and direction here is welcomed!
Thanks!Actually, I tried looping and still only get 1, but returned several times.
i.e.
PreparedStatement prepvotstmt = connection.prepareStatement(prepvotSQL);
prepvotstmt.setString(1, primID3a);
ResultSet rest3 = prepvotstmt.executeQuery();
rest3.next();
String votecat = rest3.getString(1);
while (rest3.next()) {
out.print("category roles "+votecat);
}then I get returned the following:
admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admin
like so.
Where as at the DB level I get
ROLE_NAME CC_ID
admin 1688
ops 1688
ops 1688
ops 1688
ops 1688
ops 1688
ops 1688
ops 1688
risk 1688
comply 1688
legal 1688
legal 1688
ops 1688
comply 1688
Maybe the while should go around the getString(1) designation? But I was thinking I'd tried that and gotten invalid cursor error
Something is definitely amiss, between the prepared statement in the servlet and the SELECT statement at the DB level.
I can totally hardcode the statement in the servlet or JSP and it will return one value potentially several times, but only one.
Other times, it will not return a value at all, even though one resides in the db.
Yet go to the DB/SQL Plus prompt and it returns perfectly. I can simply copy and paste the SELECT statement from the out.print line I made and it works like a champ in SQL Plus. Any ideas why the same exact thing cannot return the proper values within the servlet/JSP?
Yeeeeeeesh!!! : (
Message was edited by:
bpropes20 -
Hi,
I am new to OAF, I am trying to get the value from the table in order to make validation. I have the following PG:
SearchResultsTableRN
itemRow
DetailsCell
DetailsTableLayout
ShortDescRow
ShortDescCell
ShortDesc
LongDescRow
LongDescCell
LongDesc
AttributesRow
AttributesCell
AttributesTableLayout
Attributes1Row
Attribute11Cell
ect...
Can anyone help me please in how to go into the table --> row --> column to retrieve the value from a specific column?
If their is a document or example that can help I will appreciate it. Since I tried searching in devguide and didn't find any results.
Note: I am extending the controller and reached till the following code:
public void processFormRequest(OAPageContext oapageContext, OAWebBean webBean){
super.processFormRequest(oapageContext, webBean);
String event = oapageContext.getParameter("ShortDescRow");
OATableBean advtable = (OATableBean)webBean.findChildRecursive("SearchResultsTableRN");
OARowBean rowtbl = (OARowBean)advtable.findChildRecursive("DetailsCell");
String message = "test:"+event+"|"+advtable+"|"+"|"+"|"+"|";
throw new OAException(message, OAException.INFORMATION);
Thanks and Regards
PatrickPatrick,
My first advice would be go through OAF guide and do tutorial examples, for such basic details.
If ur talking about tablelayout region
u can use pageContext.getParameter(<Item id of UIX bean whose value u want>);
If you are talking about table
You can Iterate through the VO based on primary key ...on which the table is based, and retrive the corresponding Vo attribute value.
--Mukul -
From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?
Hi,
Use NVL or COALESCE:
NVL (col_a, col_b)
Returns col_a if col_a is not NULL; otherwise, it returns col_b.
Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Get millisecond values from timestamp column in v$logmnr_contents
Hello
How do we get millisecond values from timestamp column in v$logmnr_contents.
I tried with following query.
select scn,To_Char(timestamp,'DD-MON-YYYY HH24:MI:SS:FF') from v$logmnr_contents WHERE OPERATION NOT IN('START') and username ='SCOTT' and sql_redo is not null and (seg_owner is null or seg_owner not in('SYS'));
it says ORA-01821: date format not recognized. I want to find the relation of scn with timestamp. In forums i found, scn is derived from timestamp value. I dont know its correct or not.
if i query with out FF in time format i get like
scn timestamp
808743 27-NOV-2007 00:12:53
808743 27-NOV-2007 00:12:53
808743 27-NOV-2007 00:12:53
808744 27-NOV-2007 00:12:53
808744 27-NOV-2007 00:12:53
808744 27-NOV-2007 00:12:53
if scn is derived from timestamp with milliseconds, each scn should be different right?More help pleaseMay be there's an easy way solving your problem, I did it like that:
CREATE TABLE quota_test (test VARCHAR2(50))
INSERT INTO quota_test
VALUES ('update "SCOTT"."NEWTAB1" set a="34" and b="45"')
SELECT test normal, REPLACE(SUBSTR(test,INSTR(test,'"',1),INSTR(test,'.',1)+2),'"','') changed
FROM quota_test
Result is :
NORMAL
update "SCOTT"."NEWTAB1" set a="34" and b="45"
CHANGED
SCOTT.NEWTAB1
If you didn't understand, I can explain what I wrote -
Reading values from lookup columns through custom workflow in SharePoint 2013
We are able to read the values of text, number columns through custom workflow (via coding) in SharePoint 2013. However, we are not able to read values from lookup columns. So, request anyone to provide help on this.
Thanks & regards,
AdityaHi,
According to your post, my understanding is that you want to read values from lookup columns through custom workflow in SharePoint 2013.
Since the workflow just doesn't get lookup fields, let's give it something static to work with instead. If we can capture the ID of the lookup field and store that as a static value in our list, the workflow can happily use that to look up our related.
For more information, you can refer to:
SharePoint 2013 Workflows and Lookup Columns
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
How find out the duplicate value from each columns.
I have below four columns,
How can i find out the duplicate value from each columns.
with All_files as (
select '1000' as INVOICE,'2000' AS DELIVERYNOTE,'3000' CANDELINVOICE,'4000' CANDELIVERYNOTE from dual union all
select '5000','6000','7000','8000' from dual union all
select '9000','1000','1100','1200' from dual union all
select '1200','3400','6700','8790' from dual union all
select '1000','2000','3000','9000' from dual union all
select '1230','2340','3450','4560' from dual
SELECT * FROM All_files
Output should be as per below.
1000 2000 3000 4000
9000 1000 1100 1200
1200 3400 6700 8790
1000 2000 3000 9000
Required to check uniqueness in cross columns.
Thanks.Try this (sorry about the formatting)...
WITH all_files AS (SELECT '1000' AS INVOICE,
'2000' AS DELIVERYNOTE,
'3000' CANDELINVOICE,
'4000' CANDELIVERYNOTE
FROM DUAL
UNION ALL
SELECT '5000',
'6000',
'7000',
'8000'
FROM DUAL
UNION ALL
SELECT '9000',
'1000',
'1100',
'1200'
FROM DUAL
UNION ALL
SELECT '1200',
'3400',
'6700',
'8790'
FROM DUAL
UNION ALL
SELECT '1000',
'2000',
'3000',
'9000'
FROM DUAL
UNION ALL
SELECT '1230',
'2340',
'3450',
'4560'
FROM DUAL),
t_base
AS (SELECT invoice
|| ','
|| deliverynote
|| ','
|| candelinvoice
|| ','
|| candeliverynote
str
FROM all_files),
t_str
AS (SELECT str || ',' AS str,
(LENGTH (str) - LENGTH (REPLACE (str, ','))) + 1
AS no_of_elements
FROM t_base),
t_n_rows
AS ( SELECT LEVEL AS i
FROM DUAL
CONNECT BY LEVEL <=
( SELECT SUM (no_of_elements) FROM t_str)),
t_build AS (SELECT t_str.str,
nt.i AS element_no,
INSTR (t_str.str,
DECODE (nt.i, 1, 0, 1),
DECODE (nt.i, 1, 1, nt.i - 1))
+ 1
AS start_pos,
INSTR (t_str.str,
1,
DECODE (nt.i, 1, 1, nt.i))
AS next_pos
FROM t_str
JOIN
t_n_rows nt
ON nt.i <= t_str.no_of_elements),
t_build2
AS (SELECT RTRIM (str, ',') AS original_string,
SUBSTR (str, start_pos, (next_pos - start_pos))
AS single_element,
element_no
FROM t_build),
t_build3
AS (SELECT single_element,
COUNT( * )
OVER (PARTITION BY single_element
ORDER BY single_element)
ele_count
FROM t_build2)
SELECT DISTINCT INVOICE,
DELIVERYNOTE,
CANDELINVOICE,
CANDELIVERYNOTE
FROM all_files, t_build3
WHERE ele_count > 1
AND ( INVOICE = single_element
OR DELIVERYNOTE = single_element
OR CANDELINVOICE = single_element
OR CANDELIVERYNOTE = single_element)I think this will be faster than the previous solution?
Cheers
Ben
Edited by: Munky on Feb 17, 2011 2:11 PM - "I think this will be faster than the previous solution?", nope - it's not :( -
Automator and applescript to copy new files in a folder with same name as parent folder
I have an iMac with a pictures folder (Finder folder) containing several subfolders with pictures. As per now, all these subfolders are imported into an iPhoto library (and the structure of the Finder pictures folder is thus maintained: The iPhoto events are named the same as the Finder subfolder). I.e. I have not created any albums in iPhoto.
I have also set up a workflow, where new iPhone photos are automatically being synced to specified Finder folders within the iMac pictures folder. So what I want to do is to make a workflow to import potential new photos from week to week into the existing iPhoto structure. I know iPhoto has this Autoimport folder, so this one is unpacked and "mapped". So, this is what I´m hoping to do:
Automator (iCal - want to do this on a weekly basis):
- Get specified Finder items -- set to target folder = iMac pictures folder
- Get folder content (with subfolders)
- Filter Finder items
- Items from the last 7 days (which then would be any new files created last week)
- Applescript/shell script loop(?)
- Get folder name for each file´s (from previous step) parent folder
- Create new folder with same name as the file´s parent folder (if not already existing) under the iPhoto Autoimport folder
- Copy the given file into the folder from above
- Run iPhoto application (Automator task), which then should just auto import the new photos according to the Finder folder structure
Whith the workflow above, I aim to maintain the existing iPhoto structure, and just import new photos into the existing structure. Creating folder names under the Autoimport, similar as the existing Finder folder names / iPhoto events should make it possible to have the new files imported under the existing event, right?Anyone?
I have now switched to Aperture (from iPhoto) due to Aperture´s capability to handle Finder folder structure, and due to the possibility of having the pictures within Aperture as referenced files to the pictures within the Finder folders (i.e. possibility to delete pictures from both library and Finder folder at the same time).
So I have a superior Finder folder called "Album". Within "Album" I have several subfolders (sub albums) containing pictures. The "Album" folder with subfolders are imported into Aperture as "Projects and albums", and the pictures are uploaded within the Aperture structure as referenced files. So for now the Aperture structure is more or less a direct mirror of the Finder folder structure, whereas "Album" is the project.
And this is my current workflow in Automator, but I´m searching help with my Applescript:
- Get specified Finder items (target folder = the superior Finder folder "Album")
- Get Folder content
- Filter Finder items (to look for potential new files to import into Aperture)
- Kind is not folder
- Date created last X days
The output files from this task enters an Applescript
on run {input, parameters}
repeat with f in input (**Loop**)
tell application "Finder"
set fileName to name of (f)
set parentFolder to name of container of (f)
tell application "Aperture"
tell library 1
tell project "Album"
if (exists album parentFolder) then
** I then would like to check if fileName already exist within the existing album**
** If not existing, I would like to import file f into the existing album as a referenced file**
else if not (exists album parentFolder) then
make new album with properties {name:parentFolder}
** I then would like to import file f into the new album as a referenced file**
end if
end tell
end tell
end tell
end tell
end repeat
end run -
How to delete one existing file before uploading a file with same name?
Hello everybody.
I am uploading a file to Tomcat server. But, the problem is:
i want to delete an existing file in the server, if i upload a fresh file with same name. In other words, "First check for the file with the same name in the server. If it exists, then delete existing file in the server and upload fresh one". If such file doesnot exist, then upload the file to server.
I have given deleteonExit()
but, for the first time when user is uploading, i want to check for the file with same name in the server.
i am pasting the code here. please help:
<!-- uploading the file -->
<%
String contentType = request.getContentType();
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength)
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
String contextRootPath = this.getServletContext().getRealPath("/");
contextRootPath=contextRootPath.concat("uploaded");
String file = new String(dataBytes);
String saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
// Create a directory; all ancestor directories must exist
File outputFile = new File(contextRootPath, saveFile);
var=outputFile.getPath();
outputFile.createNewFile();
int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
int pos;
pos = file.indexOf("filename=\"");
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
FileOutputStream fileOut = new FileOutputStream(outputFile);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush();
fileOut.close();
outputFile.deleteOnExit();
%>Please help. Thanks for taking time.
Regards,
AshviniThank you MartinHilpert,
I have one more doubt,
I am uploading the file to one folder called "uploaded". Before uploading a fresh file, i want to delete all existing files in that folder. IS that possible ?? If yes, can you please tell me how to do that ??
Regards, Thanks for your time.
Ashlvini -
if I try to add a new folder to a sub folder, the program does add the new bookmark folder, but it also renames the next folder in line in the parent of the original "subfolder" to the exact same name...
maybe I just need to reload the mozilla, maybe I was hacked and that is what they changed...
I also have a similar problem with microsoft explorer, every time I try to add a new folder it gives it a starting wierd name besides "New Folder"
I have an error when creating new folders, it renames the folder below it to the same name (super - next folder - parent's next sibling...)Do you have that problem when running in the Firefox SafeMode? <br />
[http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
''Don't select anything right now, just use "Continue in SafeMode."''
If not, see this: <br />
[http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes] -
Find duplication values from multiple columns in a big table
Hi All,
I am working on a 11gR2 database in linux. i want to display record that have duplicate values in 2 columns.
1. Table Structure :-
CREATE TABLE A
ID NUMBER(10),
F_NAME VARCHAR2(100 BYTE),
L_NAME VARCHAR2(100 BYTE)
2. Sample Data:-
Insert into A
(ID, F_NAME, L_NAME) Values (1,'TONY' ,'SUMIT');
Insert into A
(ID, F_NAME, L_NAME) Values (2,'SUMIT' ,'KEITH');
Insert into A
(ID, F_NAME, L_NAME) Values (3,'NORA','SMITH');
Insert into A
(ID, F_NAME, L_NAME) Values (4,'APRIL','TONY');
Insert into A
(ID, F_NAME, L_NAME) Values (5,'ROSS','TAM');
ID F_NAME L_NAME
1 TONY SUMIT
2 SUMIT KEITH
3 NORA SMITH
4 APRIL TONY
5 ROSS TAM
4. My requirement is i need display IDs that it's F_NAME or L_NAME has duplication in F_NAME or L_NAME columns.
The result should be
ID
1 reason: F_NAME (TONY) equals to L_NAME of record 4, L_NAME (SUMIT) equals to F_NAME of record 2
2 reason: F_NAME (SUMIT) equals to L_NAME of record 1
4 reason: L_NAME (TONY) equals to F_NAME of record 1
record 3, 5 aren't in the result because there is no duplication in F_NAME or L_NAME columns for NORA,SMITH, ROSS, TAM
The table contains 10 million records, i really need to consider the performance.
kindly suggest me the solutionNote: Forum members please suggest better approach to this -- below.. convert into SQL :)
I know I will be opposed by many people in this forum for posting such in-efficient solution.
But trying to learn along with you.. its an interesting problem which must deal with all rows vs all rows to get all combinations.
But I am still thinking how to write it in SQL, probably will learn from this post after we receive some good SQL solution for the code what I am currently doing now.
step 1: created a table B similar to table A and added a column reason
CREATE TABLE B
ID NUMBER(10),
F_NAME VARCHAR2(100 BYTE),
L_NAME VARCHAR2(100 BYTE),
REASON VARCHAR2(1000 BYTE) --- ADDED THIS
)Definetely inefficient :(
BEGIN
FOR rec_outer IN (SELECT * FROM A) LOOP
FOR rec_inner IN (SELECT * FROM A) LOOP
IF (rec_outer.f_name = rec_inner.l_name) THEN
UPDATE B
SET reason =
rec_outer.id
|| ' reason: F_NAME ('
|| rec_outer.f_name
|| ') equals to L_NAME of record '
|| rec_inner.id
WHERE b.id = rec_outer.id;
END IF;
END LOOP;
FOR rec_inner IN (SELECT * FROM A) LOOP
IF (rec_outer.l_name = rec_inner.f_name) THEN
UPDATE B
SET reason =
reason
|| CASE
WHEN reason IS NULL THEN
rec_outer.id || ' reason: '
ELSE
END
|| 'L_NAME ('
|| rec_inner.f_name
|| ') equals to F_NAME of record '
|| rec_inner.id
WHERE b.id = rec_outer.id;
END IF;
END LOOP;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
rollback;
RAISE;
END;OUTPUT:
ID F_NAME L_NAME REASON
1 TONY SUMIT 1 reason: F_NAME (TONY) equals to L_NAME of record 4,L_NAME (SUMIT) equals to F_NAME of record 2
2 SUMIT KEITH 2 reason: F_NAME (SUMIT) equals to L_NAME of record 1
3 NORA SMITH
4 APRIL TONY 4 reason: L_NAME (TONY) equals to F_NAME of record 1
5 ROSS TAM Cheers,
Manik.
Edited : Added rollback -
Hi all,
I am new to Flex/Flash Builder, actionscript, and mxml, so please be kind.
I have developed a small program that has a component that displays a datagrid fed with information out of a mysql db via a php data services connection. Within that same component (page), I have a graph that charts the dates via a plot chart. I am interested in adding a line series to the graph, but the data I want to use is a calculated field in the datagrid which I used a custom lable function to derive and display. Can someone steer me to the correct method to store such values and how to call them into a chart?
Some addition information
Custom label function:
/* Custom label function for the Delta1 column. Calculates the number of days between the planting date and 10% flower. */
private function calculateTo1stFlower(item:Object, column:GridColumn):String {
var tempDate1:Date = new Date(item.dflower10 - item.dplanting);
return Math.round((tempDate1.time / MS_PER_DAY) + 1).toString();
/* Number of milliseconds in a day. (1000 milliseconds per second * 60 seconds per minute * 60 minutes per hour * 24 hours per day) */
private const MS_PER_DAY:uint = 1000 * 60 * 60 * 24;
Within my spark datagrid
<s:GridColumn width="30" headerText="Δ1" labelFunction="calculateTo1stFlower" ></s:GridColumn>
I assume I need to store the array of values for this column and then chart the saved values as the xField within the LineSeries. Should I use a class based model?
The following link seemed like it may be an appropriate path; I am not sure though.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b51.html
Thanks in advance for any support,
MatthewThanks for trying to post DDL, but you have no idea how to do a data model. You do not know that tables have to have keys, what ISO-11179 is, etc.
You have a table that is supposed to model companies. Your singular names says that there is only one company! There is no company identifier (the industry standard is the DUNS). A customer is not a company. We do not use numeric data types for identifiers;
do you do math on them? NO! The attribute property comes after the attribute name (you never heard of ISO-11179).
Think about how silly VARCHAR(1) is.
CREATE TABLE Companies
(company_duns CHAR(9) NOT NULL PRIMARY KEY,
company_name VARCHAR(30)NOIT NULL,
margin_oil INTEGER NOT NULL,
margin_hangar INTEGER NOT NULL,
margin_cleaning INTEGER NOT NULL);
INSERT INTO Companies
VALUES (1, 'AviatKorea', 100, 125, 200),
(2, 'AXHollande', 50, 40, 30),
(3, 'BFXNorway', 60, 80, 600),
(4, 'EEEFrance', 10, 25, 60);
CREATE TABLE Company_Tariffs
(company_duns INTEGER NOT NULL
REFERENCES Companies(company_duns),
tariff_type CHAR(1) NOT NULL
CHECK (tariff_type IN ('A','B','C','D'),
PRIMARY KEY (company_duns, tariff_type));
INSERT INTO Company_Tariffs values (1, 'A'), (2, 'C'), (2, 'D'), (3, 'A'), (4, 'A'), (4, 'C'), (4, 'D')
SELECT * -- do not use * in production code
FROM Companies AS C,
Company_Tariffs AS T
WHERE C.company_duns = T.company_duns;
>> I would like something like with a computed column [ ] that retrieves the different contracts used: <<
You might but a SQL programmer would not. This violated First Normal Form. It is a display report and is done in the presentation layers.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
Empty classloader cache?
On older MacOS versions, if I needed to empty the classloader cache, I would go the the Java settings and turn on Use Java console. Then, when I loaded an applet, the Java console would pop right up in a new window next to my browser. But this doesn'
-
Inject User Attributes into SAML Credential Mapper V2 Assertions
We are using SAML CMV2 on 10.0 MP1 and we would like to add user attributes in SAML assertions '<attributestatement>'. How do we inject attribute statements in assertions? [url http://e-docs.bea.com/wls/docs100/dvspisec/credmap.html] AT: - Do You Nee
-
How to know how many carts have been ordered as "bought on behalf of"
I'm looking for a way to know how many carts have been order in the past six months as "bought on behalf of" I've looked at tables CRMD_PARTNER and BUT000 but, I'm not sure how to determine what are the key fields and the SAP queries that I'll need t
-
Can I name or merge my events in photos
After downlownding photos onto my Ipad2 how do I merge events and name them? Can this only be done on IPhoto? Thanks
-
Link image filename to text.
Hi, I am making a catalog and I have it in a basic format. Image of product first, underneath it is ProductID + Price. The image filenames are formatted with the d of the product. How can I link it so in my catalog where is says ProductID: to have a