Multiple sequences on one table?
I have a simple table with 3 columns: ID, DML_ID and VALUE. The table was designed to be a metadata table with values for certain DML_IDs. The table has been maintained by IT. However, now the users wants to have control over some of the values. Let's call it User_Maintained values. IT does DML on this table and migrate the change to acceptance and production. At the same time users do DML in production. This causes ID conflict between dev, acc and prod.
My solution is to use 2 sequences, one for IT_maintained IDs the other for User_maintained IDs. One of the sequences starts with a much bigger number like 1000000 to avoid the conflict. Create a before insert trigger on the table to pick the right sequence number depends on if the DML is IT or user maintained.
My question here is, is it ok to use 2 sequences on one table? Is it against best practice of Oracle?
Another idea from my co-worker is, use single sequence instead of 2. The sequence will reside in production database and all the 3 databases (dev, acc and prod) will get ID from the same sequence through dblink. Personally I don't like the idea because I don't think getting sequence from production to be used in development is the "best pratice" of Oracle. Although I don't know where I can find the document to support my opinion.
Any idea is appreciated!!
Sharon
I've discussed with the DBAs and some developers, we all have concern about the idea of one sequence on production being used by all 3 databases (dev, acc and prod). Database clone is one issue. Also making one database (dev or acc) relies on another (production) is not a good approach. Each database should be as independent as possible - only create the linkage when it's necessary. In this case I don't think it's necessary.
I will go with one sequence for user maintained values (in prod), and a manual increase number (max(id) of IT maintained value plus 1) for IT list.
I do all these because the table was a bad design from the first begining so I can't really come up with a correct solution to work around this.
Thanks for everybody who gave input here. Very appreciated!
Similar Messages
-
Display Data from multiple models in one table
Hi Experts,
Is it possible to display data from multiple models in one table smltnsly.
I have created a table dynamically.Now I would like to display data from multiple models... If this possible,can anyone give me a lead as to how to do it..
Regards
SUHi
Your Model Nodes be
Model1
---Output_Model1
Attrib1
Attrib2
Model2
---Output_model2
Attrib1
Attrib2
and the value node is
ValueNode
---Attrib1
---Attrib2
Now the coding.
int size;
IPrivate<ViewName>.IOutput_mode1Node node1 = wdContext.nodeOuptut_Model1();
IPrivate<ViewName>.IValueNodeElement elem;
size = node1.size();
for(int i=0; i<size; i++)
elem = wdContext.createValueNodeElement();
elem.setAttrib1( node1.getOutput_Model1ElementAt(i).getAttrib1() );
elem.setAttrib2( node1.getOutput_Model1ElementAt(i).getAttrib2();
wdContext.nodeValueNode().addElement( elem );
similar code for Model Node 2
Regards
Abhimanyu L -
How to get the data from multiple nodes to one table
Hi All,
How to get the data from multiple nodes to one table.examples nodes are like A B C D E relation also maintained
Regards,
IndraHI Indra,
From Node A, get the values of the attributes as
lo_NodeA->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = ls_attributesA ).
Similarily get all the node values from B, C, D and E.
Finally append all your ls records to the table.
Hope you are clear.
BR,
RAM. -
How to CREATE SEQUENCE in one table
dear all
the one thing i want to know when i use CREATE SEQUENCE in one table like this and then at that table
CREATE SEQUENCE oproduct_sequence
START WITH 1 INCREMENT BY 1
nocache
create table oproduct(
tname varchar2(20) not null,
tid int default oproduct_sequence.nextval
the system indicat that i cannot use this way to create table , so i really want to know how can i achieve this method
becuase when i want to insert inot table oproduct only use
insert into oproduct valuse('aaaa');
and the result like
aaaaa 1
bbbb 2Actual name is before insert trigger. Some examples are listed below:
Example Number 1 ...
create sequence product_seq start with 1 increment 1
create or replace trigger product_insert before insert for each row begin
select productseq.nextval
into :new.product_id
from dual;
end;
Example Number 2 ...
How to create an autoincrement field in a table with a sequence ...
SQLWKS> create table bob(a number , b varchar2(21));
Statement processed.
First create a sequence
SQLWKS> create sequence x ;
Statement processed.
Then create the trigger.
create trigger y before insert on bob
for each row
when (new.a is null)
begin
select x.nextval into :new.a from dual;
end;
Example Number 3 ...
First create a sequence:
create sequence emp_no_seq;By default it increments by 1 starting at 0.
Use its values when inserting data into the table:
insert into t_emp values (emp_no_seq.nexval, 'Joe Black');~ Madrid. -
Using DATA_CELL and multiple queries into one table
Hi WAD experts,
I have been trying to work out how to combine multiple hidden query result sets in their own tables in the template, into one table displayed as if the data originated from one query.
I have been looking at using the DATA_CELL method of "modify table" class.
Has anyone had to do this before - and if so do you have any clues as to how best to do this ?
Thanks
ChrisHere is what I want:
Say I have a query that tells me about how many items were sold at a hardware store for each week. Then the output would look something like this:
Week,Item,Num_Sold
13,Hammer,15
13,Nail,594
13,Screw,398
14,Hammer,16
14,Nail,382
14,Screw,331
But I want my output to look like this:
<space>,13,14 <-- these would be the week numbers
Hammer,15,16
Nail,594,382
Screw,398,331
I asked this same question in a SQL-only forum and one person responded that they did not know how to do that. But I figure that this is done often enough that there must be some Open Source program that can transform the output data into a table. As you can see, it's not a pure transform. It's more like I take one column, make that the x-axis, another column, make that the y-axis, and "plot" the data based on the two columns. It's kinda like taking 1D data and making it 2D. There's no existing open source program which does this? I figure that I could just give the program my SQL queries, specify some rule such as "Make the first column of the resultset the row, make the second column the column and create a table with the 3rd row, using the first two rows to map the 3rd row into the table". Note that I think this only works with 3 columns.
Anyway, if there is no simple program that already does this, I can make a program to do what I just described. I just asked the question here because I figure that there are a lot of people knowledgeable about SQL and Java on this forum and that someone would know of a tool which already does what I want if one exists. -
Is it possible to export multiple sequences as one FLV?
My Premiere Pro project contains multiple sequences that I'd like to export to one FLV file. But the Adobe Media Encoder export settings for "range" only has the options of exporting entire sequence (the current sequence I'm working on) or exporting the work area. So I'm having to export each sequence to its own separate FLV file.
Is there any way to export all of the sequences together to get one FLV file? If there isn't a way to do this, is it possible to somehow join my sequences?Sequences puzzled me for a while. Just create a new sequence and then drag the sequences you already have directly from the project window (the icons look like a couple of timelines) onto your new sequence timeline - they then show there as a single video and audio tracks butted together
-
Combine Multiple Worksheets into one table
Hello Everyone!
I have 2 Excel worksheets within the same workbook. Both have identical tables with almost the same fields except for 2 or 3 different columns in one of the sheets. Currently I have a macro assigned to a button on one of the sheets and I have to click on
it to combine the 2 sheets. I also have a Pivot Table on one of the sheets which pulls data from the table on that sheet and displays it on the existing sheet.
I wish to :
1. Combine (merge) these two sheets into one table on a new worksheet when Excel file is opened rather than clicking on the button.
2. Once the Excel file is opened, i would like to have the Pivot Table to pull data off the combined sheet and display it next to the combined table. Essentially I would like the Pivot Table to be refreshed with the new data from the Combined table rather
than from one table.
Is this possible ?
I use the following code to combine the two sheets, but I don't know how to proceed further. Can someone please help me with the rest ?? Thanks in advance.
Here's the code:
Option Explicit
Sub Combine()
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined Results"
Sheets(2).Activate
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range("A1")
For J = 2 To Sheets.Count
Sheets(J).Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
Next
End Sub
The problem with being punctual is, there's nobody there to appreciate it !!!Hi,
This is the forum to discuss questions and feedback for Microsoft Excel, the issue is more related to Excel DEV. I'll move your question to the MSDN forum for Excel
http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Why are multiple slides under one table of contents button?
I'm using Captivate 8, and notice that when I preview my course, the table of contents buttons directly correspond with each slide but then after that, the remaining slides are lumped under one table of contents button. How can I fix this? In other words, when looking at the table of contents, it looks like my course only has 6 slides when in reality there's 30...many of which are lumped under the last button.
You have to scroll, they are not under one button at all.
Good practice is to group slides, then you'll see the hierarchy in the TOC and you are able to collapse all groups. That way the TOC will have a clean look, and the user can open a group to see the individual slides. -
Multiple record entry one table one form
Hello guys
I'm trying to do a baseball team site and I'm having problem
inserting multiple players data at one time.
Example:
I'm passing a variable from one game (gameID) to player's
statistic (hits, homeruns, ect). but only one record gets inserted
Here's the codeSure, it's possible
create table scott.a
as
select 1 a, 2 b from dual
union all
select 3 a, 4 b from dual
create table scott.b
(a number, b number, c number, d number)
insert into scott.b
select a1.a,a1.b,a2.a,a2.b from scott.a a1, scott.a a2
where a1.a = 1 and a2.a = 3
P.S. Sorry, at first misunderstood the task
Message was edited by:
Dmytro Dekhtyaryuk -
Multiple Queries on one table....
Hi - I am trying to query the same table multiple times and can't figure out how any help would be GREATLY appreciated!! For example - I have a PRINRPT.CALL_DATE Field and in my SQL Command Statement I have asked it to only bring over PRINRPT.CALL_DATE > 10/31/08...I then count those on my report BUT I would also like to query that same table again with PRINRPT.CALL_DATE = Today - 90 Days and then again PRINRPT.CALL_DATE from 10/31/07 to 10/31/08....I can not figure out how to do this in CR. I tried a formula based on the PRINRPT.CALL_DATE field - but it only returns TRUE or FALSE..I would like actual dates so I can count them in the report to get a total by principal by customer (see below).
Here is my SQL Query - let me know if it is possible please!!! Thanks in advance for all of your help!!
Misty
SELECT ACCT_CLASS.NAME
, ACCT_CLASS.PRIN_NAME
, PRINRPRT.PRIN_NAME, PRINRPRT.CALL_DATE, PRINRPRT.AUTHOR
, CUSTOMER.SALES_Name
, CUSTOMER.SALES_NO
, CUSTOMER.NAME
, CUSTOMER.Customer_Class
, ACCT_CLASS.CLASSIFICATION
, PROJECTS.PRIN_NAME
, PROJECTS.EST_PROF
, SALES.PRIN_NAME
, SALES.NOV_2008_GP, SALES.DEC_2008_GP, SALES.JAN_2009_GP,
SALES.FEB_2009_GP, SALES.MAR_2009_GP, SALES.APR_2009_GP,
SALES.MAY_2009_GP, SALES.JUN_2009_GP, SALES.JUL_2009_GP,
SALES.AUG_2009_GP, SALES.SEP_2009_GP, SALES.OCT_2009_GP,
SALES.NOV_2007_GP, SALES.DEC_2007_GP, SALES.JAN_2008_GP,
SALES.FEB_2008_GP, SALES.MAR_2008_GP, SALES.APR_2008_GP,
SALES.MAY_2008_GP, SALES.JUN_2008_GP, SALES.JUL_2008_GP,
SALES.AUG_2008_GP, SALES.SEP_2008_GP, SALES.OCT_2008_GP
FROM AveWorking.dbo.ACCT_CLASS
JOIN AveWorking.dbo.CUSTOMER ON ACCT_CLASS.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID
LEFT JOIN AveWorking.dbo.PRINRPRT ON ACCT_CLASS.PRIN_NAME = PRINRPRT.PRIN_NAME
AND ACCT_CLASS.CUSTOMER_ID = PRINRPRT.CUSTOMER_ID
AND ACCT_CLASS.NAME = PRINRPRT.NAME
AND PRINRPRT.CALL_DATE > 10/31/2008
LEFT JOIN AveWorking.dbo.PROJECTS ON CUSTOMER.CUSTOMER_ID = PROJECTS.CUSTOMER_ID
AND PROJECTS.NAME = PRINRPRT.NAME
AND PROJECTS.PRIN_NAME = PRINRPRT.PRIN_NAME
LEFT JOIN AveWorking.dbo.SALES ON PRINRPRT.PRIN_NAME = SALES.PRIN_NAME
AND SALES.CUSTOMER_ID = PRINRPRT.CUSTOMER_ID
ORDER BY CUSTOMER.SALES_Name, ACCT_CLASS.PRIN_NAME,PRINRPRT.PRIN_NAME,PROJECTS.PRIN_NAMEThanks so much Carl - that was it...I think I have been staring at this for far too many hours now and can't see what is right in front of me!!
I am still having more issues with it - I hate this report!!!! I am getting duplicate dates & sales populating now. So for example I want:
Principal Name Name sales 09 Sales 08 Dates 3Mo Dates 09 Date 08
So, I am getting Sales 09 & Sales 08 and Dates in 09 coming up multiple times per customer where there really is only one showing in the database for each day. I think it has something to do with the sales connection (the last Left Join on my report). I have ran it soooo many times with groups, without groups, inside out and upside down etc....but if I need an accurate count of the calls made in each column I can't have it duplicating dates...can you tell from my query as to why it might do this???
My ultimate goal is to have one line of data per data field above, then repeat for a new customer.
Any more ideas????
Principal Name Name sales 09 Sales 08 Dates 3Mo Dates 09 Date 08
XXXX XXXXX Total $ Total $ # # #
Thanks again so much, any help you can give is greatly appreciated!!
Misty
Current Query:
select ACCT_CLASS.NAME
, ACCT_CLASS.PRIN_NAME
, PRINRPRT.PRIN_NAME, PRINRPRT.AUTHOR
, CUSTOMER.SALES_Name
, CUSTOMER.SALES_NO
, CUSTOMER.NAME
, CUSTOMER.Customer_Class
, ACCT_CLASS.CLASSIFICATION
, PROJECTS.PRIN_NAME
, PROJECTS.EST_PROF
, SALES.PRIN_NAME
, SALES.NOV_2008_GP, SALES.DEC_2008_GP, SALES.JAN_2009_GP,
SALES.FEB_2009_GP, SALES.MAR_2009_GP, SALES.APR_2009_GP,
SALES.MAY_2009_GP, SALES.JUN_2009_GP, SALES.JUL_2009_GP,
SALES.AUG_2009_GP, SALES.SEP_2009_GP, SALES.OCT_2009_GP,
SALES.NOV_2007_GP, SALES.DEC_2007_GP, SALES.JAN_2008_GP,
SALES.FEB_2008_GP, SALES.MAR_2008_GP, SALES.APR_2008_GP,
SALES.MAY_2008_GP, SALES.JUN_2008_GP, SALES.JUL_2008_GP,
SALES.AUG_2008_GP, SALES.SEP_2008_GP, SALES.OCT_2008_GP,
PRINRPRT.CALL_DATE,
case when PRINRPRT.CALL_DATE BETWEEN '11/01/2008' AND '10/31/2009' then PRINRPRT.CALL_DATE ELSE NULL end as "Call_Dates09",
case when PRINRPRT.CALL_DATE > getdate() - 90 then PRINRPRT.CALL_DATE ELSE NULL end as "3MOCall_Dates09",
case when PRINRPRT.CALL_DATE BETWEEN '11/01/2007' AND '10/31/2008' THEN PRINRPRT.CALL_DATE ELSE NULL END "CALL_DATES08"
FROM AveWorking.dbo.ACCT_CLASS
JOIN AveWorking.dbo.CUSTOMER ON ACCT_CLASS.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID
LEFT JOIN AveWorking.dbo.PRINRPRT ON ACCT_CLASS.PRIN_NAME = PRINRPRT.PRIN_NAME
AND ACCT_CLASS.CUSTOMER_ID = PRINRPRT.CUSTOMER_ID
AND ACCT_CLASS.NAME = PRINRPRT.NAME
LEFT JOIN AveWorking.dbo.PROJECTS ON CUSTOMER.CUSTOMER_ID = PROJECTS.CUSTOMER_ID
AND PROJECTS.NAME = PRINRPRT.NAME
AND PROJECTS.PRIN_NAME = PRINRPRT.PRIN_NAME
LEFT JOIN AveWorking.dbo.SALES ON CUSTOMER.CUSTOMER_ID = SALES.CUSTOMER_ID
AND ACCT_CLASS.PRIN_NAME = SALES.PRIN_NAME
AND ACCT_CLASS.NAME = SALES.NAME
ORDER BY CUSTOMER.SALES_Name, ACCT_CLASS.PRIN_NAME,PRINRPRT.PRIN_NAME,PROJECTS.PRIN_NAME
Edited by: Misty Whitney on Jul 28, 2009 3:07 PM -
Hi
I have a table that stores delivery notes for multiple sales locations on a company.
Each sales location must have a different sequence numbering for the delivery notes.
If a create a different sequence for each sales location everything works perfect.
The only problem I have is maintenance of the application in the future when I need to add a new sales location.
Of course I create the sequence for the new sales location but I need to touch every time the form code to include the new sequence in a case statement for the insert.
Is there any sugestion from your side?
Is it possible to create an array or table of sequences that can be referenced through an index when inserting?
Any idea would be appreciated.
CecilioHi,
You could write a function to generate sequence for the given location by using dynamic SQL.
For this :
1. The naming convention must be standardized
ie. For the 2 locations Loc1 and Loc2 the sequence
names could be SQ_Loc1 and SQ_Loc2
i.e SQ_Followed by Location code.
2. The Database function will then use the following
dynamic sql :
FUNCTION fn_generate_sequence (pLocn In Varchar2)
RETURN Number Is
lSeq Number;
Begin
Execute Immediate 'Select SQ_' || pLocn
|| '.NextVal From dual'
INTO lSeq;
RETURN lSeq;
End;
-- Shailender Mehta -- -
Multiple Users sharing one Table
Hi Folks,
I'm a newbie with Apex so please treat gently ;-)
Simple "order entry" application: a table for Orders and another table for Order Items. All pretty run of the mill so far,
but instead of one end user (say the vendor company's telephone operator) typing in orders over the telephone for
several customers, consider opening the application to the several customers so that they can type their own orders
themselves.
The collection of Customers isn't that large (say about 12 or so), hence I'm thinking of just giving them distinct Apex logins
to the application.
I can pickup the login name from APP_USER, but how to copy this in behind the scenes to "customerID" in the Orders
table - the "customerID" field does represent a column in a database table, but I want to force it to the Apex login name
for whatever customer that is attempting to insert a new order.
All the Apex demo stuff shows simple order-items solutions; I'm trying to have a single Orders table with a column in it that tells
me which customer sent in this order, and for the customers using this table to only see their own orders from the same table.
If I was implementing this on the database I would use some sort of View such as "select * from orders where customer = user",
therefore every user would only see their bit of the orders table.
But how to implement this in Apex?
Suggestions and comments gratefully welcomed,
Thanks in advance
Mungo Henninguser515989 wrote:
I'm a Forms developer, and Apex looks intriguing yet formidably intractable. Where are the triggers for
pushbuttons - I can easily create a button but there's no obvious "create trigger" bit to accompany it.
I guess I'm lacking understanding the gut essence of Apex; I've had a look at a few tutorial and the stuff
I've read so far falls far short of acceptability - the manuals have one or two sentences of "aims" at
the start of a section followed by fifty-point lists of "do this, do that" instructions then they round it
off with an audaciously arrogant section at the end along the lines of "Now you know how to do XYZ".
What this lacks is the "essence" of the task - I have to reverse engineer each blooming step to try and
understand what it is meant to achieve.
Have I missed any damn good tutorials out there - there must be some (except those boring Youtube
videos where we watch someone perform the fifty-step routines again without explaining the essence).
Can you tell that I'm frustrated by a lack of documentation; I risk losing your kind support in my early
foray into Apex (help a drowning man please :-)
Thanks again in advance
Mungo :-)Its important to remember that Apex is nothing other than a framework for creating HTML and running web pages. So what used to be triggers are now standard javascript events. Although you will find help on the forum for javascript and maybe some in the documentation, javascript events are standard and not proprietary like Forms triggers were. Its frustrating, but there are a TON of resources (google) on the basics of javascript. For instance instead of when-validate-trigger, you'll probably look at the onblur event to trigger a piece of javascript code to run your validation. You can use onfocus which would be sort of like when-new-item-instance in Forms-speak. -
Multiple buttons in one table column
Hi,
I was wondering if it is possible to create more than one button in a column?
If so, how can I do that? (staticlly and dynamically)
Thanks a lot.
Cheers,
Michael.Hi Armin,
I want a table with a column containing many buttons.
These buttons will be dynamically generated.
Something like this
Table
Col1 | Col2
ABC |Button1, Button2, Button3.. Button n
XYZ |Button4, Button5... Button n
All buttons are unique and contains images.
There could be many buttons in this column/row. This depends on the data.
Hope this makes it clearer.
Thanks
Michael -
Multiple BI Query Results into one Table
Hi All
Can I embed Multiple queries into one table using VC?
I have data in different BI sources(Info Areas) like sales and distribution,Shipments etc. Can I write any universal query to retrive data from multiple sources?(If any???)Hi Jan Pasha,
My model contains two BW queries which uses UNION and sent result to one table.
I tried using UNION also but when I use it I am able to see no records to select in result table.
I donot have any coloums in common. Is it pre-requisite for using UNION? -
How to update one table from another
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?Comet wrote:
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?I am not convinced you have what you think you have
>
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
When you want to produce a DATE datatype when starting with a string,
you must use TO_DATE() on the SET line!
(TO_CHAR(received_date,'RRRR') + 2000)since when do you do add characters (from TO_CHAR) with a constant number (2000)?
You should NEVER EVER rely on implicit datatype conversion
Edited by: sb92075 on Jul 27, 2011 7:09 PM
Maybe you are looking for
-
Itunes 10 wont show my iphone 7.02
Hi, Yesterday I upgraded my iphone software to 7.02 Now when I try and plug it into the computer it says my itunes need to be upgraded to 11.1 or later...but I can't upgrade as my computer is operating system is 10.5.8 and therefore cannot support th
-
What is the best wifi printer for mac ?
i want to buy a new wifi printer / scanner / fax. i had problems with my former one , it was HP Officejet 4500 and all of the setting was wrong for mac. it was a dissaster . before i will buy a new i wanted to ask if anyone has a proposition . thanx
-
Adobe Acrobat PDF erstellen aus Datei = keine Leserechte
Hallo, Acrobat meldet mir (Win7 + Office 2010) & einem Kollegen (Win XP +Office 2010 pro) seit neustem beim Erstellen (Acrobat öffnen und dann von PDF erstellen aus Datei) den Fehler, dass ich keine Leserechte habe, um die Datei zu öffnen. Egal ob di
-
Cintiq 24 HD and dual display turning files black?
I have a brand new Cintiq 24 HD and a secondary monitor, a 24 inch Gateway. Any files I open in Photoshop show up fine on my Cintiq, but as soon as I try and drag them onto the other monitor, they mysteriously turn black. If I drag it back to the Cin
-
I ordered a MBP with the Apple Care. They already processed and charged me for the Apple Care (nothing mailed to me yet), but have not yet shipped my order. Is it too late to cancel the entire order? ill they be able to refund my money for the Apple