Export using a QUERY parameter
I am trying to export a subset of data using the following parms:
FILE=C:\EXPORT\ADM_ACCESS_LOG.DMP
GRANTS=Y
INDEXES=Y
DIRECT=N
ROWS=Y
CONSISTENT=N
TRIGGERS=Y
CONSTRAINTS=Y
FEEDBACK=1000
TABLES=(THRESHER.ADM_ACCESS_LOG)
QUERY=\"WHERE LOGIN_DT='31-JUL-2005'\"
The table exists as does the column, however, I get the following error:
LRM-00101: unknown parameter name 'LOGIN_DT'
I have everything spelled correctly and I am logging into export as thresher.
What am I doing wrong?
Thanks
use the query parameter like this
QUERY="WHERE to_char(dte,'mm/dd/yyyy')='07/31/2005'"
or
QUERY="WHERE to_char(dte,'dd-mon-yyyy')='31-JUL-2005'"
--thedba
Similar Messages
-
Below expression works fine with text box but gives error in dataset expression.
="SET FMTONLY OFF select "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
& "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
"," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
& join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
"')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
"," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
Pls. guide...Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
Hope this helps.........
Ione -
Oracle Export Error on QUERY Parameter
Hi All,
I would like to ask for assistance.
Here's my environment:
OS: Linux 5.4 32bit
DB: Oracle 10.2.0.4
Here's what I would like to do:
Export selected rows from SH.SALES table using the query:
SQL> select * from sh.sales
where to_date(time_id,'DD-MON-RR:HH24:MI:SS') = to_date('28-DEC-01:00:00:00','DD-MON-RR:HH24:MI:SS');
My parfile is:
userid="sys/oracle as sysdba"
buffer=10000000
file=mysales148.dmp
log=mysales148.log
TABLES=sh.mysales
query="where to_date(time_id,\'DD\-MON\-RR:HH24:MI:SS\')=\to_date(\'28\-DEC\-01:00:00:00\',\'DD\-MON\-RR:HH24:MI:SS\')"
recordlength=65535
statistics=none
When I run the script, I am getting this error:
[oracle@shaoran selective_export]$ exp parfile=exp_mysale.par
Export: Release 10.2.0.1.0 - Production on Thu Feb 3 16:57:08 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
Current user changed to SH
. . exporting table MYSALES
EXP-00056: ORACLE error 911 encountered
ORA-00911: invalid character
Export terminated successfully with warnings.
Hope to hear your feedback soon.
Thanks a lot!Hi Guys,
Thanks for the feedback.
I edited my parfile as shown here:
[oracle@shaoran selective_export]$ cat exp_mysale.par
userid="sys/oracle as sysdba"
buffer=10000000
file=mysales148.dmp
query="where time_id=\to_date(\'28\-DEC\-01:00:00:00\',\'DD\-MON\-RR:HH24:MI:SS\')"
log=mysales148.log
TABLES=sh.mysales
recordlength=65535
statistics=none
[oracle@shaoran selective_export]$
and I did the following steps:
[oracle@shaoran selective_export]$ export NSL_LANG=AMERICAN_AMERICA.UTF8
[oracle@shaoran selective_export]$ exp parfile=exp_mysale.par
Export: Release 10.2.0.1.0 - Production on Fri Feb 4 11:34:03 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
Current user changed to SH
. . exporting table MYSALES
EXP-00056: ORACLE error 911 encountered
ORA-00911: invalid character
Export terminated successfully with warnings.
[oracle@shaoran selective_export]$
I still get the same error. :( -
Problem with Export using single table with query
I have a need to export rows from a specified table using the query parameter to filter the rows I need. The example I have is this:
EXP user/pwd@id tables=(tableA) query=\"where tableA.id = tableB.id and table B.id2 = tableC.id2 and tableC.id3 = 10\"
When export runs, I get this: ". . exporting table tableA
EXP-00056: ORACLE error 904 encountered
ORA-00904: "TABLEC"."ID3": invalid identifier
Export terminated successfully with warnings."
When I viewed the contents of the resulting dmp file through IMP, it only has table column information and no rows exported.
Could somebody tell me what is wrong?
I have a feeling it is with the QUERY parameter. The doco on the QUERY parameter only shows a very simple example that filters data by only the columns in the specified table (assumed). Are joins to other tables allowed inside the QUERY?? The doco doesn't say that its not allowed.<<
EXP user/pwd@id tables=(tableA) query=\"where tableA.id = tableB.id and table B.id2 = tableC.id2 and tableC.id3 = 10\"
>>
table B.id2 = tableC.id2 -- isn't there one blank too much ? -
Using IN Operator in Query Parameter querying an Oracle dataset
I have created a main data set querying from Oracle in which I have two query parameters that are multi-valued lists. I created a data set for each of those multi-valued lists. These two parameters are configured to be multi-valued and selected
from the query. On the main data set, the parameters are set to an expression: = Join(Parameter.Field.Value, ","). If I sent just one value as a default in each of those parameters, works great. If I select "Select All"
in my drop down and rerun the report then I get "Query execution failed for dataset" and "rsErrorExecutingCommand". I am using Report Builder 3.0. I have seen some older posts saying you have to use a stored procedure to generate
a string from the selects to be passed to the parameter? I don't get this. Obviously I want to stick with using a query parameter for the performance gain. Is there an easy way to make this work?
Grateful for any help! LaurieLaurie, you are right that the execution time is too long. Your instinct is correct to put the burden on the database to return the correct resultset, rather than filtering it in the report.
I think I wasn't clear about my explanation and you may have made this more complicated than it needs to be. The functionality that you want is already in ReportBuilder. Please check out this example from MS:
http://technet.microsoft.com/en-us/library/aa337396(v=sql.105).aspx
This is the correct syntax:
AND soh.SalesPersonID IN (@BusinessPersonID)
Is this how you have your query configured? If not, could you supply an example.
Hope that helps,
Mark -
Oracle 10g exp error with query parameter
Hi all,
I am trying to perform an export but getting this error when using the query parameter. I think it's a syntax problem but not sure where.
I'm in a dos prompt
E:\>exp file=xxxxx.dmp log=xxxx.log tables=xxxxx query='where responseid not in (select responseid from aaaa_bbbbb)';
LRM-00112: multiple values not allowed for parameter 'query'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
ThxThis is why I love this forum so much.
I've probably done thousands of exports and never used the query parameter.
Here's something that will help you. Please read and note the requirement to escape, or protect, special characters and such.
http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm
exp scott/tiger TABLES=emp QUERY=\"WHERE job=\'SALESMAN\' and sal \<1600\"ji li -
UCM archiver Export query parameter
I would like to use IdcCommand to run archive service to export some documents in UCM.
I noticed there seems a parameter "aExportQuery" (by searching internet) can be used to create query but I'm not sure what the syntax is for this parameter
also, I don't see this parameter mentioned in the official document of archiver services:
http://docs.oracle.com/cd/E21043_01/doc.1111/e11011/c07_archive002.htm#i3246938
on another hand, this document says :
dataSource: Must be set to RevisionIDs. This is the query stub which, along with the export query, will be used to create the list of revisions to export.
sounds like this is where query should be created in.
Could someone clarify how to specify query for UCM export using IdcCommand ?
ThanksHi ,
I would suggest to set the following trace sections on UCM to get the details :
requestaudit,socketrequest and enable Full verbose tracing .
Then create a new archive export collection - once it is done go to view server output and check Socketrequest output , it will give the exact set of parameters and how the values are set for each of them .
Thanks,
Srinath -
Hello Experts,
i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource.
by using Following method
Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.
Here is my existing CAML query.
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>Employees</ListName>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="FirstName" />
<FieldRef Name="LastName" />
<FieldRef Name="FullName" />
<FieldRef Name="UserName" />
<FieldRef Name="Company" />
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name="Title" />
<Value Type="Text">
<Parameter Name="EmployeeId"/>
</Value>
</Eq>
</Where>
</Query>
</RSSharePointList>
The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.
Please suggest
Thank you
saroj
sarojYour problem follows the well-established pattern of using an "All" parameter filter in SSRS. There are a few approaches depending on the size of your data. The easiest one is to return all data from CAML and then filter it within SSRS, the following thread
provides some examples,
http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value.
Other options include passing all of the possible values within the CAML query when "All" is selected, using multiple Report Files to distinguish between both CAML queries, or to use multiple datasets with some logic to show/hide the correct one.
Dimitri Ayrapetov (MCSE: SharePoint) -
Hi,
I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
http://server/pages/Default.aspx?Title=Arup&Title=Ratan
But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
I have followed the
http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
Please suggest me.
Thanks | Arup
THanks! Arup R(MCTS)
SucCeSS DoEs NOT MatTer.Hi DH, sorry for not being clear.
It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
(or a Performance Point Dashboard etc.) and you insert it into your page and add
a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
with multiple values for one parameter. If you have any more questions let me know. See you, Ingo -
Problem in using query parameter in exp(9.2)
Hi Folks,
I'm not able to take export from a table with query option on a Solaris machine. here is my parameter file which has query parameter in it. I'm also posting error message.
file=utf_exp_raw_citation.dmp
log=utf_exp_raw_citation.log
owner=utf8admin
statistics=none
tables=raw_citation
query=\"where nvl(source,'AAA') in ('EMC','HMD','HSR','KIE','NASA','PIP','AAA')"\
rows=y
Error:-*
$ exp utf8admin/[email protected] parfile=exp_raw_citation_07_01_2011_new.dat
LRM-00116: syntax error at ')' following 'AAA'
LRM-00113: error when processing file 'exp_raw_citation_07_01_2011_new.dat'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
Please help me in this.
regards
Krishna Prasad DonepudiI suggest you utilize a parameter file to avoid the shell messing with metacharacters on command line
-
Use of QUERY option in 9iRel2 Export utility
Hi All,
Is it possible to use a query option to the export utility of the form below assuming I am exporting a table called test1:
query="(test1.col1,test1/col2) not in (select test2.col1,test2.col2 from test2)"
I am not sure if it is allowed to reference another table in the query clause, test2 in the example above....?
ThanksI don't have a 9iR2 environment with me right now but this works on 10gR2. And I have no reason to believe that it would not work in 9iR2.
SQL> select * from a;
ID
1
2
SQL> select * from b;
ID
2
SQL> $
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>exp sysadm/itbagain@qo810 tables=(A) query='where id not in (select id from b)'
Export: Release 10.2.0.4.0 - Production on Wed Sep 8 14:17:49 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.4.0 - Production
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table A 1 rows exported
Export terminated successfully without warnings.
C:\> -
Good morning everyone,
I am currently trying to an export on a table with a where clause of value1= 1 or value1 = 2. When I do this I find the export to be extremely slow. But if I do two exports ie. one export with value1=1 and another export with value1=2 they are quite fast. Now when I do this it is done in two dmp files. Is there a way of doing two exports on the same table into one dmp file without losing any data?? Thank you in advance.
TroyHi;
Please see:
Issue with data pump "Query" parameter
Export/Import DataPump Parameter QUERY Specification
http://arjudba.blogspot.com/2008/04/exportimport-datapump-parameter-query.html
Also see:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_export.htm#i1006293
Regard
Helios -
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 am trying to perform a data pump export on a table using a query within a parfile and I am getting some odd behaviour. The database version is 10.2.0.4.3 and the OS is AIX 5.3. The query looks like this.
QUERY="POSDECLARATIONQUEUE:where SESSIONID in (select 'B.SESSIONID' from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where 'B.SESSIONID' = 'C.ID' and 'C.ACCOUNTID' = 'A.ID' and 'A.SITE' = '10252')"
This works but gets 0 rows. If I run the query against the instance in an SQLPlus session as below then I get 0 rows returned.
select * from POSDECLARATIONQUEUE where SESSIONID in (select 'B.SESSIONID' from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where 'B.SESSIONID' = 'C.ID' AND 'C.ACCOUNTID' = 'A.ID' and 'A.SITE' = '10252');
If I take out the single quotes from around the columns within the query against the instance within SQLPlus, I get over 2000 rows returned.
SQL> select count(*) from POSDECLARATIONQUEUE where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and A.SITE = 10252);
COUNT(*)
2098
If I remove the single quotes from the parfile query then I get the following error within the data pump export.
UDE-00014: invalid value for parameter, 'schemas'.
The SCHEMAS option is not specified within the parfile and the TABLES option only specifies the table POSDECLARATIONQUEUE.
Can someone assist with this, I just can't seem to be able to get the syntax right for it to work within data pump.
Kind Regards.
Graeme.
Edited by: user12219844 on Apr 14, 2010 3:34 AMIt looks like your query might be a little wrong:
This is what you have:
QUERY="POSDECLARATIONQUEUE:where SESSIONID in (select 'B.SESSIONID' from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where 'B.SESSIONID' = 'C.ID' and 'C.ACCOUNTID' = 'A.ID' and 'A.SITE' = '10252')"
This is what I would have thought it should look like:
QUERY=POSDECLARATIONQUEUE:"where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and A.SITE = 10252)"
You want double " arount the complete query, and you don't need the single ' around all of the =. The single ' are treating those values as strings and it says
'B.SESSIONID' = 'C.ID'
is the string B.SESSIONID equal to the string C.ID
In your query that you used in sql was
B.SESSIONID = C.ID
which says is the value stored B.SESSIONID equal to the value stored at C.ID
Which is what you want.
Dean -
What is the use of 'keep' parameter in BDC
Hi
In BDC while transfering data, what is the use of 'keep' parameter in BDC.Hi Jyothsna,
In the function module <b>BDC_OPEN_GROUP</b>, the <i>EXPORTING</i> parameter<i><b> KEEP</b></i> acts as a <b>deletion indicator for session</b> in which the batch data executed.
<i><b>CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = FILLER12
HOLDDATE = FILLER8
KEEP = FILLER1
---</b></i>
<i><b>KEEP</b></i> retains the session after successful processing if its value is set to <i><b>'X'</b></i>. A session that is kept remains in the input/output queue until an administrator deletes it in <i><b>SM35</b></i> transaction.
Sessions that contain errors in transactions are kept even if KEEP is not set.
Default: If not set, then sessions that are successfully processed are deleted. Only the batch input log is kept in SM35 transaction.
Hope this sort out your query.
PS If the answer solves your query, plz close the thread by rewarding points to each reply.
Regards
Maybe you are looking for
-
Hi, I am using Oracle EBS 12.0.6. Is there a report/utility program that will provide costed inventory as of a particular date in the past? Thanks in advance
-
i have instaled the creative cloud but premiere pro still not installed [Thread title changed for clarity.] Message was edited by: Jim Simon
-
Reinstalling a licensed version of Photoshop CS3. It's an upgrade from 7.0 and it's asking for the full key for 7.0. Where can I find that?
-
Need info from essbase experts.We have a financial planning application for one Lease/Loan financing company. This application is based on Essbase. All the complex planning(budgeting) process which was done using excel sheet has to be incorporated in
-
Materialized Views refresh Problems
When Materialized Views are refreshed by another user who is not the object owner of the Mat View then there is a Problem in refresh. we face this when we are giving OS Authentication to a OS Oper user who is not the object owner ,this we are doing t