EXPDP update in Query
hello,
RDBMS : Oracle 10g
I am using expdp to dump my data.I want to know that is it possible to use update in query clause?
I want to update a column value while exporting. e.g.
table =tab1
column=passwd
I want that when I export the table data, column passwd's value may change to some default value given by me.
Regards,
tanveer
tanveerhaider wrote:
hello,
RDBMS : Oracle 10g
I am using expdp to dump my data.I want to know that is it possible to use update in query clause?
I want to update a column value while exporting. e.g.
table =tab1
column=passwd
I want that when I export the table data, column passwd's value may change to some default value given by me.
Regards,
tanveerIn Oracle, you can only read consistent data so you can't read anything which is inconsistennt. Why can't you change the value and than do the export?
HTH
Aman....
Similar Messages
-
Conditionally disabling record updation after query
Dear members
I've a single record block and I wanna conditionaly disable records updation after query has fetched data. Problem is that if I disable the record updation in Post-Query trigger then it checks the condition for the very first fetched record and it the condition is true, then Updation is disabled for all the fetched records, even if the next records dont meet the condition. I'm using forms-10g. Can u give a better solution??? thanx.you have to use SET_ITEM_INSTANCE_PROPERTY to modify only one record:
BEGIN
IF ... <your_condition> THEN
SET_ITEM_INSTANCE_PROPERTY('YOUR_BLOCK.YOUR_ITEM1', UPDATE_ALLOWED, PROPERTY_FALSE);
ELSE
SET_ITEM_INSTANCE_PROPERTY('YOUR_BLOCK.YOUR_ITEM1', UPDATE_ALLOWED, PROPERTY_TRUE);
END IF;
END; -
UPDATING the query in materialized view
Hi,
i have a little doubt in Materialized view. i created a materialized view and log with the following query,
create table test_mv (a number ,b number )
alter table test_mv add constraint t_pk primary key ( a );
insert into test_mv values (1,2);
insert into test_mv values(2,2);
insert into test_mv values(3,2);
insert into test_mv values(4,2);
insert into test_mv values(5,2);
commit;
CREATE MATERIALIZED VIEW LOG ON test_mv
WITH SEQUENCE, ROWID
*(a,b)*
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW product_sales_mv
ENABLE QUERY REWRITE
AS SELECT b from test_mv;
Now i want to update the query in the MV as 'Select a from test_mv' . for that i tried with
*'ALTER MATERIALIZED VIEW product_sales_mv AS SELECT a from test_mv;'*
But it throwing error,
Error starting at line 5 in command:
alter MATERIALIZED VIEW product_sales_mv AS SELECT b from test_mv
Error report:
SQL Error: ORA-00933: SQL command not properly ended
+00933. 00000 - "SQL command not properly ended"+
*Cause:+
*Action:+
i guess i am doing wrong. kindly help me here. i want to update it without drop and recreate.
thanks,
Jeevanand.KeHi Jeeva,
No. you cannot add or drop columns to the materialized view using the ALTER Statement.
To Change the Structure of the view , drop and re-create the materialized view.
To Alter a materialized view log, You can use the ALTER MATERIALIZED VIEW LOG. By this,
You can add new columns to a materialized view log.
ALTER MATERIALIZED VIEW LOG ON sggi_mrps.emp ADD(deptno);Thanks,
Shankar
Edited by: Shankar Viji on Aug 24, 2012 2:11 AM -
Is it possible to update a query with another query?
I'm trying to update a query with another query (see attached
code). Here's my setup: I've got a table in an Access database in
which I enter a string into a form and update. This string
corresponds to a single record in another table of the same
datasource. The first table has only one record to provide the
second, which has many and will have more. Basically what I'm
wondering is: Is this a valid thing to do in coldfusion? If not
please help with an alterate method. I'm still a novice at
coldfusion.
The overall effect I'm going for is to display the one record
as a featured truck profile on the web site:
www.truckerstoystore.net.
I currently get an error when I try to display the page with the
current query setup.
Check this page to see the error:
www.truckerstoystore.net/currentTOW2.cfm
Help on this issue is very much appreciated.
------------------------------------------------------------------------------------------ -----------------------------------------------------------------------I think this is what you are after
<!--- this query will get all the records from the DB
--->
<cfquery name="cTOW" datasource="tow">
SELECT *
FROM currentTOW
<!--- Do you need to find a particular record in the
database --->
<!--- If so, then you need a 'where' clause in here
--->
</cfquery>
<!-- Loop the cTOW query for each record returned -->
<cfloop query="cTOW">
<!--- For the record returned from the cTOW query you now
need to update the table --->
<!-- Update the table -->
<cfquery name="currentTOW" datasource="tow">
UPDATE Your tblName
SET
Dataname = cTOW.DataValue
</cfquery>
</cfloop>
thats it
PS: I think your original query needs modifying. To return
the exact records that you want to update from the original table.
ie: Primary and foreign key relationship -
ERROR: Updatable SQL Query already exists on page 20.
Hello,
I created a tabular form, then added a where clause and started getting the following error:
Error in mru internal routine: ORA-20001: no data found in tabular form
So I deleted all components of the tabular form (region, buttons, branches and process) and started building it again from scratch. This is a strategy that has worked for me a number of times in HTML DB. Unfortunately now I get the following error when trying to build a new tabular form:
Updatable SQL Query already exists on page 20.You can only add one updatable SQL query per page. Select a different page.
What is the logic that throws this error. I'm 99% convinced I've cleared the page of any updatable SQL, is there something on the application level I should also clear out?
Thanks!Ignore this, problem solved. It seems I do have SQL reports that are marked as updatable even though they are just plain reports.
Sorry. -
Hey, I'm trying to get an xml query to work which when you click a button will load the next items on the xml structure.
so like
private var currentQueryNumber : uint = 0;
private function updateQuery(no:uint){
{currentQueryNumber + 1};}
isn't right...
Anyone able to help me in what I should be putting.I think we need more details, and simplified yet "complete" code.
How is currentQueryNumber used to update the query?
Need more details. -
Hi,
I am trying to update the Query of an existing WEBI document's dataprovider, through the RESTful Web service SDK.
For this, first i will get the Dataprovider information,
Example:
URI: http://localhost:6405/biprws/raylight/v1/documents/11111/dataproviders/DP0
Expected result;
<dataprovider>
<id>DP0</id>
<name>Query 1</name>
<dataSourceId>1234</dataSourceId>
<updated>2014-04-18T11:55:21.000-08:00</updated>
<duration>1</duration>
<isPartial>false</isPartial>
<rowCount>113</rowCount>
<flowCount>11</flowCount>
<dictionary>
<expression qualification="Dimension" dataType="String">
<id>DP0.DO1</id>
<name>EmpID</name>
<description>Employee ID.</description>
<dataSourceObjectId>DS0.DO1</dataSourceObjectId>
</expression>
<expression qualification="Dimension" dataType="String">
<id>DP0.DO2</id>
<name>EmpName</name>
<description>Employee Name.</description>
<dataSourceObjectId>DS0.DO2</dataSourceObjectId>
</expression>
</dictionary>
<query>SELECT Employee.EmpID, Employee.EmpName FROM Employee</query>
</dataprovider>
Then Changing the above dataprovider's Query to some thing like below,
<query>SELECT Employee.EmpID, Employee.EmpName FROM Employee where Upper(Employee.EmpName)='RAJ'</query>
Please let me know the RESTful Call required to do this.
Thanks in advance.
Thanks,
Mahendra.FYI, the output of this call returns something like:
<?xml version="1.0" encoding="UTF-8"?>
<queryplan>
<union>
<fullOuterJoin>
<statement index="1">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), count( distinct SALES.inv_id) FROM SALES GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
<statement index="2">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), sum(INVOICE_LINE.nb_guests) FROM SALES, INVOICE_LINE, SERVICE_LINE, SERVICE WHERE ( SALES.INV_ID=INVOICE_LINE.INV_ID ) AND ( INVOICE_LINE.SERVICE_ID=SERVICE.SERVICE_ID ) AND ( SERVICE.SL_ID=SERVICE_LINE.SL_ID ) AND ( SERVICE_LINE.service_line = 'Accommodation' ) GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
</fullOuterJoin>
<fullOuterJoin>
<statement index="3">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), count( distinct SALES.inv_id) FROM SALES GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
<statement index="4">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), sum(INVOICE_LINE.days * INVOICE_LINE.nb_guests * SERVICE.price) FROM SALES, INVOICE_LINE, SERVICE WHERE ( SALES.INV_ID=INVOICE_LINE.INV_ID ) AND ( INVOICE_LINE.SERVICE_ID=SERVICE.SERVICE_ID ) GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
</fullOuterJoin>
</union>
</queryplan> -
Update an query using a loop valuee
here is what i am doing?
getting the result from the query: showing the form as:
thereafter the updation is performed as:
<cfquery datasource="#DSN#">
UPDATE answer SET
answer = '#Form.ans1[idx]#'
where ID = #Form.G_Q#
</cfquery>
on new page, use of array or structure will be role playing
here, but i am confused how this is achieved..In the example code you posted, you would have wound up with
4 form fields, all named "ans1". This would have resulted in a
comma-delimited list of your answers on the form's action page.
this is probably not a great solution, especially since you are
dealing with text that may contain commas. By creating a new
numbered field for each answer, you can separate out the answer
text and process it on the next page.
For the update, you can loop over the fields you created
using CF's scope structure notation: Form["MyVar"]. Using
<cfqueryparam> will speed up your query also give you some
protection against SQL injection.
In the future, its very helpful to use <cfdump
var="#Form#"> on the form processing page to see what form data
is being passed and what fields are available. -
Exhange Rate updation at query Level
Dear Experts,
While running SAP query choosing currency translation option "Conversion type on posting date", all the data takes effect with latest exchange rates.
Ex. Data for the period May-08 takes effect of exchange rate of the month of Jan-09 i.e. USD =48.90000 instead of exchange rate 40.50000 which is for May-08.
We want figures takes effect with respective months' exchange rate. We are updating exchange rate on periodic basis in BI. Pls suggest.
Thanks,
MMSlHi,
check this link
http://space.itpub.net/15232446/viewspace-521037
Thanks
Hema -
Need suggestion for Column update in query results
While generating reports using Oracle 10g SQL Query, we need to update the few of columns data with business calculations. We are processing large amount of data. Kindly suggest us, for the best method to achieve this.
i don't know about Oracle 10 SQL Query but i wouldn't mix reporting with data calcuations which is stored persistent in the database. I would separate them, e.g. you could create a database-job to execute your updates at a specific time each day.
hope this helps -
HI, Some super_id is wrong or null in my #cred table and I want to update with the correct super_id.
The best way is to COUNT max 'super_id' on the basis of column-'b_id' and 'bid_code'.
Query condition should be based on 'b_id' and 'bid_code'. Please help for the logic of this update query.
I want also add the column of 'Correct super_id is:' in the result with the correct super_id.
Tip. 'b_id' column data must exist in 'bid_code' column. Can we use like command to avoid any hard code in the update and create generic script for update.
Example of new column of 'Correct super_id is:
The record of b_id-'SLEP' and bid_code-'SLEP_LEN' has super_id-'2' three times, one time is '1' and one time is 'null'.
So max super_id is 2 for these and this is correct super_id.
drop table #cred
create table #cred (unique_id numeric,b_id char(10), bid_code char(10), super_id numeric)
insert into #cred values (10012,'SLEP','SLEP_LEN',2)
insert into #cred values (10013,'SLEP','SLEP_LEN',1)
insert into #cred values (10014,'SLEP','SLEP_LEN',2)
insert into #cred values (10015,'SLEP','SLEP_LEN',2)
insert into #cred values (10016,'SLEP','SLEP_LEN',null)
insert into #cred values (10017,'GHEP','GHEP_RET',44)
insert into #cred values (10018,'GHEP','GHEP_RET',44)
insert into #cred values (10019,'GHEP','GHEP_RET',44)
insert into #cred values (10020,'GHEP','GHEP_RET',22)
insert into #cred values (10021,'GHEP','GHEP_RET',null)
insert into #cred values (10022,'SDEP','SDEP_Full',77)
insert into #cred values (10023,'SDEP','SDEP_Full',77)
insert into #cred values (10024,'SDEP','SDEP_Full',55)
insert into #cred values (10025,'SDEP','SDEP_Full',77)
insert into #cred values (10026,'SDEP','SDEP_Full',null)
Select * from #cred order by unique_id
--Desired Results
unique_id b_id bid_code super_id Correct super_id is:
10012 SLEP SLEP_LEN 2
10013 SLEP SLEP_LEN 1 2
10014 SLEP SLEP_LEN 2
10015 SLEP SLEP_LEN 2
10016 SLEP SLEP_LEN NULL 2
10017 GHEP GHEP_RET 44
10018 GHEP GHEP_RET 44
10019 GHEP GHEP_RET 44
10020 GHEP GHEP_RET 22 44
10021 GHEP GHEP_RET NULL 44
10022 SDEP SDEP_Full 77
10023 SDEP SDEP_Full 77
10024 SDEP SDEP_Full 55 77
10025 SDEP SDEP_Full 77
10026 SDEP SDEP_Full NULL 77
Kevin, try
-- code #1 v2 - list
;with
T as (
SELECT unique_id, b_id, bid_code, super_id,
max(super_id) over(partition by b_id, bid_code) as super_id2
from #cred
where b_id = Left(bid_code, CharIndex('_', bid_code)-1)
SELECT unique_id, b_id, bid_code, super_id,
case when super_id=super_id2 then '' else cast(super_id2 as sql_variant) end as [Correct super_id is:]
from T
order by unique_id;
and
-- code #2 v2 - update
;with
T2 as (
SELECT unique_id,
max(super_id) over(partition by b_id, bid_code) as super_id2
from #cred
where b_id = Left(bid_code, CharIndex('_', bid_code)-1)
UPDATE T1
set T1.super_id= T2.super_id2
output inserted.unique_id, inserted.b_id, inserted.bid_code,
deleted.super_id as [old super_id], inserted.super_id as [new super_id]
from T2 inner join
#cred as T1 on T1.unique_id=T2.unique_id
where (T1.super_id <> T2.super_id2) or T1.super_id is null;
José Diz Belo Horizonte, MG - Brasil -
Not able to save / update SQL Query in Query manager
Hi,
I am using SBO 2005 B PL 25, facing unique problem in Query Manager.
There are various queries saved in Query manager, tried updating & creating / saving new query but not able to do so.
System displays messaged as operation completed successfully, but the query is not updated.
Kindly let me know is there any setting which blocks the updation.
Regards,
Yogesh Jadav
Edited by: YOGESH JADAV on Aug 11, 2008 3:07 PMHi
You cannot Modify or Update query in the 'System' Category.
If you are trying to create/ modify/ update query in some other category, check for the authorizations in
'Administration -> System Initialization -> Authorizations Window' -> Reports ->Query Generator'.
Check if you have authorizations for the following
New Queries
Create/Edit Categories
Saved Queries - Group No. 1
Saved Queries - Group No. 20 -
I have a peculiar problem related to update statement.
In a table "table1" I have the following values for the column Name.
John
Doe
Adam
Teela
I need to do the following updates
John -> Adam
Doe -> Teela
Adam -> Doe
Teela -> John
One way of doing it would be to use the ROWID.
Update table1 set value=Adam where ROWID=1
Update table1 set value=Teela where ROWID=2
and so on and so forth.
But I don't want to use the ROWID.
Therefore the logical query that one would write is
Update table1 set value=Adam where value=John
Update table1 set value=Teela where value=Doe
Update table1 set value=Doe where value=Adam
Update table1 set value=John where value=Teela
But immediately the problem becomes apparent.
The converted table would now look like this
Doe
John
Doe
John
How do I make sure that the updation happens as I intend? Is there a way to work around it without ROWID?
Message was edited by:
user574608Much too late, but I don't want to have made it in vain ;) :
michaels> CREATE TABLE table1 (ID INTEGER,VALUE VARCHAR2(10))
Table created.
michaels> INSERT INTO table1
VALUES (1, 'John')
1 row created.
michaels> INSERT INTO table1
VALUES (2, 'Doe')
1 row created.
michaels> INSERT INTO table1
VALUES (3, 'Adam')
1 row created.
michaels> INSERT INTO table1
VALUES (4, 'Teela')
1 row created.
michaels> UPDATE table1
SET VALUE =
CASE VALUE
WHEN 'John'
THEN 'Adam'
WHEN 'Doe'
THEN 'Teela'
WHEN 'Adam'
THEN 'Doe'
WHEN 'Teela'
THEN 'John'
END
4 rows updated.
michaels> SELECT *
FROM table1
ID VALUE
1 Adam
2 Teela
3 Doe
4 John
4 rows selected. -
Expdp error with query parameter
i am trying to use datapump and using query parameter in there as below...
but when i use the below, its exporting some system "repcat$" tables and
nothing realted to scott.audit table or anything realted to my query where
clause...what am i doing wrong ??
expdp system
DUMPFILE=test.dmp
LOGFILE=test.log
DIRECTORY=DATA_PUMP_DIR
TABLES=SCOTT.AUDIT
QUERY=SCOTT.AUDIT:'"WHERE TRUNC (audit.audit_timestamp)
BETWEEN TO_DATE ('01012008','DDMMYYYY') AND TO_DATE ('13012008','DDMMYYYY')"'
also when i use scott instead of system user i get below error
Export: Release 10.2.0.3.0 - 64bit Production on Wednesday, 22 July, 2009 12:53:45
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-nulli treid again, but creating a new datapump dir as follows...create or replace dir dpdump as '/backup/dpdump/orcl';
then gave grant read,write on directory dpdump to system
and now why is oracle looking at a differnt location ?? even when i changed the
direcotry ???
$ expdp SYSTEM
DUMPFILE=test.dmp
LOGFILE=test.log
DIRECTORY=DPDUMP
QUERY=SCOTT.AUDIT:'"WHERE TRUNC (audit.audit_timestamp)
BETWEEN TO_DATE ('01012008','DDMMYYYY') AND TO_DATE ('13012008','DDMMYYYY')"'
Export: Release 10.2.0.3.0 - 64bit Production on Wednesday, 22 July, 2009 13:27:18
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/oracle/app/oracle/product/10.2.0/admin/orcl/dpdump/expdat.dmp"
ORA-27038: created file already exists
Additional information: 1
$>
Seems little weird but can you:--
1. Drop the dpdump directory.
SQL> drop directory dpdump;
2. recreate it and then grant the permissions.
SQL> create directory dpdump as '/backup/dpdump/orcl';
The folders must exists in the location.
SQL> grant read,write on directory dpdump to system;
3. SELECT directory_name, grantee, privilege
FROM user_tab_privs t, all_directories d
WHERE t.table_name(+)=d.directory_name
ORDER BY 1,2,3;
Anand -
I'm using the LabView Database Connectivity Toolset and am using the following query...
UPDATE IndexStation
SET Signal_Size=200
WHERE 'StartTime=12:05:23'
Now the problem is that this command seems to update all rows in the table IndexStation... Not just specifically the row where StartTime=12:05:23
I have tries all sorts of {} [] / ' " around certain characters and column names but it always seems to update all rows...
I've begun to use the SQL query tab in Access to try and narrow down as to why this happens, but no luck!
Any ideas!?
Thanks,
Chris.Chris Walter wrote:
I completely agree about the Microsoft issue.
But it seems no SQL based manual states that { } will provide a Date/Time constant.
Is this an NI only implementation? Because I can't seem to get it to function correctly within LabView or in any SQL query.
Chris.
There is nothing about the database toolkit in terms of SQL syntax that would be NI specific. The database Toolkit simply interfaces to MS ADO/DAO and the actual SQL syntax is usually implemented in the database driver or database itself although I wouldn't be surprised if ADO/DAO does at times munch a bit with that too.
The Database Toolkit definitely does not. So this might be a documentation error indeed. My understanding of SQL syntax is in fact rather limited so not sure which databases might use what delimiters to format date/time values. I know that SQL Server is rather tricky thanks to MS catering for the local date/time format in all their tools and the so called universal date/time format has borked on me on several occasions.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
Maybe you are looking for
-
Oracle 9iR2 db and Hardware movement
Friends We are moving our servers (OS AIX 5.3) and installed softwares from harware IBM p670 to 570. We will move Oracle installations also. We plan to move disk images (no new Oracle server installation) and network controls. Is there any things tha
-
Event 'AT New' how to use it....
Hi Good Afternoon! This the code: LOOP AT IT_VBAP INTO WA_VBAP. AT NEW VBELN. WRITE : / WA_VBAP-VBELN . ENDAT. WRITE : / WA_VBAP-POSNR , WA_VBAP-MATKL. ENDLOOP. output is not in oder can any 1 help me.... thanks,
-
Hi I have a pdf form that has a number of fields in it that generates an email when the submit button is clicked. This is working fine and addresses the email generated correctly based on the following script.. this.mailDoc({ cTo: getField("Executive
-
Hello Folks, I have a requirement. I want to create a component and what that component should do is whenever any properties are changed or any changes are happening in the portal, it should fetch that user name and send a mail to specific users or g
-
Already purchased CS6/still trial?
Already purchased CS6 D&W premium. But why I still receiving email to remind my trial is almost expired?