Export query syntax
Hi,,
i want export one table with query option.
my whrere conditions is where v_Customer_code in ('3658','3640','7463','7134','7195','8318','8181')
please any one help me what is the syntax to export table..
i am using 10g databse on hp-ux box.
Regards,
Mugu
If you run exp under Windows, try:
exp <user>/<password> tables=<your table name> query='where v_Customer_code in ('3658','3640','7463','7134','7195','8318','8181')'where <user> is the Oracle account name of the table you want to export.
Example:
C:\>sqlplus test/test
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 10 13:20:11 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from t;
X Y
258 DUAL
259 DUAL
311 SYSTEM_PRIVILEGE_MAP
313 SYSTEM_PRIVILEGE_MAP
314 TABLE_PRIVILEGE_MAP
316 TABLE_PRIVILEGE_MAP
317 STMT_AUDIT_OPTION_MAP
319 STMT_AUDIT_OPTION_MAP
605 MAP_OBJECT
886 RE$NV_LIST
887 STANDARD
X Y
889 DBMS_STANDARD
890 DBMS_STANDARD
901 V$MAP_LIBRARY
903 V$MAP_FILE
905 V$MAP_FILE_EXTENT
907 V$MAP_ELEMENT
909 V$MAP_EXT_ELEMENT
911 V$MAP_COMP_LIST
913 V$MAP_SUBELEMENT
20 rows selected.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
C:\>exp test/test tables=t query='where x in (258,259)'
Export: Release 10.2.0.1.0 - Production on Fri Sep 10 13:20:33 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8MSWIN1252 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table T 2 rows exported
Export terminated successfully without warnings.
C:\>
Similar Messages
-
EXPORT 시 QUERY OPTION에 대한 사용 예(ORACLE 8I 이상)
제품 : ORACLE SERVER
작성날짜 : 2004-03-17
EXPORT 시 QUERY OPTION에 대한 사용 예(ORACLE 8I 이상)
============================================
PURPOSE
============
oracle 8i에서 export 시 query option에 대한 사용 예
8i에서 export의 query syntax 를 이용하여 table data의 한 부분만 exporting 이 가능
- 8i 에서 select 문장의 where 절을 사용하는 것처럼 export 시에 부분적으로 table data 를 받아 낼수 있는 기능을 소개 한다.
- Direct 옵션은 사용될 수 없다..
- where 절에 해당하는 export utility는 query parameter 를 사용한다.
UNIX syntax:
- Example:
1.SCOTT.Emp table의 ename 이 JAME과 비슷한 이름의 data 를 export ..
exp scott/tiger query=\"where ename like \'JAME%\'\" tables=emp file=exp.dmp log=exp.log
2. employee와 cust table에서 new york 주의 data 만 export ..
exp scott/tiger query=\"where st=\'NY\'\" tables=(employee,cust) file=exp.dmp log=exp.log
query 문장에서 UNIX reserved characters( ", ', ,< .. 등) 를 사용하는 경우에는 escape ('\') 을 반드시 사용해야 한다.
예)query=\"where JOB = \'SALESMAN\' and salary \< 1600\"
더 중요한 것은 command line에서 export option을 사용할때는 반드시 escape 이 있어야 하나
parfile을 사용할때는 eacape이 불필요하다.
예를 보면 .. p라는 이름의 file을 다음과 같이 생성
tables=emp query="where job='SALESMAN'"
parfile을 이용해서 export 를 실행해 보면
[rmtdchp6]/apac/rdbms/64bit/app/oracle/product/9.2.0> exp scott/tiger parfile=p
Export: Release 9.2.0.4.0 - Production on Wed Mar 17 00:12:34 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses KO16KSC5601 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 4 rows exported
와 같이 정상 처리 됨을 알수 있다.
만일 command line에서 위의 내용을 실행하게 되면 다음과 같이 error 를 만난다.
exp scott/tiger tables=emp query="where job='SALESMAN'"
LRM-00101: unknown parameter name 'job'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
command line에는 query 내에 single(')나 double quotes(") 를 사용한다면 반드시 double quotes(") 를 사용하여
query 문을 묶어야 한다.그러나 query 내에서 single ('')나 double quotes(") 를 사용하지 않는다면 single quotes (')을 사용하여
query 문을 수행할 수도 있다..
다음 예를 보면..
1>exp scott/tiger tables=emp query=\'where deptno=20\'
Export: Release 9.2.0.4.0 - Production on Wed Mar 17 00:22:00 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses KO16KSC5601 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 4 rows exported
2>exp scott/tiger tables=emp query=\'where job=\'SALESMAN\'\'
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
즉.. 정리를 하자면
command line에서 query 내에 '," 을사용하지 않는 다면 '나 " 으로 query option을 사용할수 있다
query=\'where deptno = 20\'
query=\"where deptno = 20\"
query=\'where deptno \< 2\'
(이 경우 single 이나 double quotes 을 둘다 사용할수 있다.)
parfile을 사용하는 경우에는 다음과 같이 단순하게 사용이 가능하다.
query='where deptno = 20'
query="where deptno = 20"
query='where deptno < 20'
WINDOWS NT / 2000 와 NETWARE syntax:
다음의 자료를 참조바란다.
Example:
EXP demo/demo tables=emp file=exp1.dmp query="""where deptno>30"""
double quotes(") 를 둘러 싸는 경우에는 space 가있으면 안된다.
parfile의 사용은 다음과 같이 하시면 됩니다.
file=exp66.dmp
query="where deptno > 20"
tables=(emp)
log=log66.txt
userid=scott/tiger
Explanation
Windows NT or Win2000의 경우 command line에서는 3 double quotes 이 필요하고
'PARFILE 을 사용하는 경우에는 double quotes(") 한번만 필요함
Reference Documents
Oracle8i Utilities guide
Note:91864.1 -
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 -
Ora-01704 string literal too long error on long query syntax
I have a query with more than 4000 characters. I can't seem to get ociparse to accept it. The bind variables are not an issue as I am not concatenating any strings to the query syntax. It is just that my query will all the columns and unions etc exceeds 4000 characters. Any way around this short of hiding it in a view ( which I have already done for other long queries ).
System:
PHP 4.3.10
OCI driver
Oracle 9i Release 2
Thanks,
BryanMisread your post, sorry. Oracle limits literal strings to 4,000 chars. According to the documentation it's required that you use bind variables where possible to shorten literal strings below 4,000. You could also try a pl/sql block.
The error you're getting is being returned by Oracle, not PHP. I've seen it pop up on bugtraq a couple of times for PHP, but the answer is always the same. I'm more of a programmer than a database expert, so forgive me for not having a better answer. You may want to try posting this to one of the more specific oracle forums where someone will probably have a better answer for you.
http://www.stanford.edu/dept/itss/docs/oracle/9i/server.920/a96525/toc.htm -
Export query results to flat file with dynamic filename
Hi
Can anybody can point me how to dynamic export query serults set to for example txt file using process flows in OWB.
Let say I have simple select query
select * from table1 where daterange >= sysdate -1 and daterange < sysdate
so query results will be different every day because daterange will be different. Also I would like to name txt file dynamicly as well
eg. results_20090601.txt, results_20090602.txt, results_20090603.txt
I cant see any activity in process editor to enter custom sql statment, like it is in MSSQL 2000 or 2005
thanks in advanceYou can call existing procedures from a process flow the procedure can create the filename with whatever name you desire. OWB maps with file as target can also create a file with a dynamic name defined by an expression (see here ).
Cheers
David -
Export query result to csv using Export Wizard
Been a decade since I last used Oracle and related tools.
I had to use Oracle server again, I have a query over multiple tables, I am to run a scheduled script that will spit out the query result as a csv file.
I started with SQL Developer Export wizard, in step "Specify Data", I am at a loss, where to specify the query itself? I see a Name,Schema,Type input, a text area below, Up,UpAll,Down,DownAll buttons etc etc. Where do I specify my query here? Can someone please help?
Is this the best way to go about to schedule a data export (query to csv) daily?To export a user query rather than a whole table, run it in a worksheet and export using the context menu on the result grid. However none can be scheduled.
Instead you can look at the SPOOL command and schedule it through SQL*Plus. Any questions can go to the iSQL*Plus and/or SQL And PL/SQL forum.
Have fun,
K. -
How can I export query results from sqlplus on the command line? Are there ways to specify the format such as CSV, TAB, XML, etc?
I've seen one approach that involves creating a shell script and piping the output to a file:
#!/bin/sh
sqlplus user/password <<__EOF__
set heading off;
set newpage none;
select f1, ',', f2, ',', f3 from some_table;
__EOF__
Then pipe the output to a file. Is there a simpler solution to this?http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:235814350980
-
XPATH Database Query Syntax in an Assign
Trying to get an XPATH Database query to work by assigning the Input variable value in a simple BPEL Process to my query condition. I keep getting invalid XPATH errors. I cannot seem to figure out how get write it out.
Here is what I have:
<from expression="orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')"/>
Here is my error:
Error(30): [Error ORABPEL-10039]: invalid xpath expression [Description]: in line 30 of "C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELws\ReadDB\ReadDB.bpel", xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" specified in <from> is not valid, because XPath query syntax error. Syntax error while parsing xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')", at position "80" the exception is Expected: ). Please verify the xpath query "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" which is defined in BPEL process. . [Potential fix]: Please make sure the expression is valid.
Any help?
Thanks!!!Ok. I have figured out how to place the condition (variable value) inside a concatentated string. So my final result is the actual XPATH Query-Database statement. But the problem is it is being returned as a String. How can I turn that final string into the XPATH expression I need? I suspect another <COPY> block could pull this off but I am not sure how to do it.
Here is my code:
<process name="QueryBuild" targetNamespace="http://xmlns.oracle.com/QueryBuild" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:client="http://xmlns.oracle.com/QueryBuild" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<partnerLinks>
<partnerLink name="client" partnerLinkType="client:QueryBuild" myRole="QueryBuildProvider"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:QueryBuildRequestMessage"/>
<variable name="outputVariable" messageType="client:QueryBuildResponseMessage"/>
<variable name="QueryText" type="ns1:string"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
<assign name="Assign_1">
<copy>
<from expression="concat("orcl:query-database('select ename from emp where empno = ", bpws:getVariableData('inputVariable','payload','/client:QueryBuildProcessRequest/client:input'), ",false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL)'")"/>
<to variable="QueryText"/>
</copy>
<copy>
<from variable="QueryText"/>
<to variable="outputVariable" part="payload" query="/client:QueryBuildProcessResponse/client:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="outputVariable"/>
</sequence>
</process> -
Export Query SQL multi-linee in XML format and Import XML in SAP
Good morning
Someone know if is possible after Export Query SQL on OITT and ITT1 with thousands rows in XML with values already change thru the query.
Then import the XML without using loop in SAP with the above code vb.net
oDistinta = DirectCast(m_oCompany.GetBusinessObjectFromXML(xmlFile, 0), SAPbobsCOM.ProductTrees)
Dim errCode As Integer = 0
Dim strErrore As String = ""
Dim iErrore As Integer = 0
oDistinta.Browser.ReadXml(xmlFile, 0)
errCode = oDistinta.Update
m_oCompany.GetLastError(iErrore, strErrore)
'on error
If iErrore <> 0 Then
To make easy the program i post with 2 ProductTrees item. The 2 item already exist in OITT e ITT1.
When i update the 1st item is modify but the 2nd not change.
Here is the XML
<?xml version="1.0" encoding="UTF-16"?>
<BOM>
<BO>
<AdmInfo>
<Object>66</Object>
<Version>2</Version>
</AdmInfo>
<ProductTrees>
<row>
<TreeCode>V9998</TreeCode>
<TreeType>iProductionTree</TreeType>
<Quantity>1000.000000</Quantity>
<U_SHI_MZDA>0</U_SHI_MZDA>
<U_SHI_PUMA>0</U_SHI_PUMA>
<U_SHI_PUUO>0</U_SHI_PUUO>
</row>
</ProductTrees>
<ProductTrees_Lines>
<row>
<ItemCode>1047</ItemCode>
<Quantity>5.000000</Quantity>
<Warehouse>Mc</Warehouse>
<Price>0.000000</Price>
<Currency>
</Currency>
<IssueMethod>im_Backflush</IssueMethod>
<Comment>
</Comment>
<ParentItem>V9998</ParentItem>
<PriceList>2</PriceList>
<DistributionRule>
</DistributionRule>
<U_IDE_POS>10</U_IDE_POS>
<U_IDE_FASE>0</U_IDE_FASE>
<U_IDE_OPER>10</U_IDE_OPER>
<U_SHI_UndInv>N</U_SHI_UndInv>
<U_SHI_Pri1>
</U_SHI_Pri1>
<U_SHI_Pri2>
</U_SHI_Pri2>
<U_SHI_Pri3>
</U_SHI_Pri3>
<U_SHI_Prgm>
</U_SHI_Prgm>
<U_SHI_Tim2>0.000000</U_SHI_Tim2>
<U_SHI_Tim3>0.000000</U_SHI_Tim3>
<U_SHI_DexNACQ>
</U_SHI_DexNACQ>
<U_SHI_BP>
</U_SHI_BP>
<U_SHI_PrcKit>0.000000</U_SHI_PrcKit>
<U_SHI_ItmNACQ>
</U_SHI_ItmNACQ>
<U_SHI_LineOk>N</U_SHI_LineOk>
</row>
</ProductTrees_Lines>
<ProductTrees>
<row>
<TreeCode>V9999</TreeCode>
<TreeType>iProductionTree</TreeType>
<Quantity>1000.000000</Quantity>
<U_SHI_MZDA>0</U_SHI_MZDA>
<U_SHI_PUMA>0</U_SHI_PUMA>
<U_SHI_PUUO>0</U_SHI_PUUO>
</row>
</ProductTrees>
<ProductTrees_Lines>
<row>
<ItemCode>1015</ItemCode>
<Quantity>1000.000000</Quantity>
<Warehouse>Mc</Warehouse>
<Price>0.000000</Price>
<Currency>
</Currency>
<IssueMethod>im_Backflush</IssueMethod>
<Comment>
</Comment>
<ParentItem>V9999</ParentItem>
<PriceList>5</PriceList>
<DistributionRule>
</DistributionRule>
<U_IDE_POS>30</U_IDE_POS>
<U_IDE_FASE>0</U_IDE_FASE>
<U_IDE_OPER>30</U_IDE_OPER>
<U_SHI_UndInv>N</U_SHI_UndInv>
<U_SHI_Pri1>
</U_SHI_Pri1>
<U_SHI_Pri2>
</U_SHI_Pri2>
<U_SHI_Pri3>
</U_SHI_Pri3>
<U_SHI_Prgm>
</U_SHI_Prgm>
<U_SHI_Tim2>0.000000</U_SHI_Tim2>
<U_SHI_Tim3>0.000000</U_SHI_Tim3>
<U_SHI_DexNACQ>
</U_SHI_DexNACQ>
<U_SHI_BP>
</U_SHI_BP>
<U_SHI_PrcKit>0.000000</U_SHI_PrcKit>
<U_SHI_ItmNACQ>
</U_SHI_ItmNACQ>
<U_SHI_LineOk>N</U_SHI_LineOk>
</row>
</ProductTrees_Lines>
</BO>
</BOM>
Someone know the reason ?
Thanks in advance.
RegardsHi Gabriele,
The issue is that the ReadXml method takes an index parameter which is the number of the object that you want to read from the XML data. In your code you are specifying index 0 which is the first product tree in your file so when you call the Update method this is the only record that will be updated. It is not possible to do a mass update using the DI API in this way, you must always load each object separately. You can use the GetXMLelementCount method of the Company object to find out how many product tree objects are in your file and then use the ReadXML method to load each one by incrementing the index parameter in a loop.
Kind Regards,
Owen -
ORACLE 8I EXPORT의 QUERY OPTION 기능
제품 : ORACLE SERVER
작성날짜 : 2000-09-19
Oracle 8i EXPORT의 Query Option 기능
====================================
Oracle 8i에서는 export 작업 수행 시 Query Option을 이용하여 테이블의
부분적인 추출이 가능하다.
SQL> select empno, ename, job, sal from emp order by job;
EMPNO ENAME JOB SAL
7788 SCOTT ANALYST 3000
7902 FORD ANALYST 3000
9999 홍길동 ANALYST 2000
7369 SMITH CLERK 800
7876 ADAMS CLERK 1100
7934 MILLER CLERK 1300
7900 JAMES CLERK 950
7566 JONES MANAGER 2975
7782 CLARK MANAGER 2450
7698 BLAKE MANAGER 2850
7839 KING PRESIDENT 5000
7499 ALLEN SALESMAN 1600
7654 MARTIN SALESMAN 1250
7844 TURNER SALESMAN 1500
7521 WARD SALESMAN 1250
위와 같이 구성된 EMP 테이블에서 만일 'MANAGER'로 JOB을 가진 사원중 SAL
컬럼이 2500이상인 레코드를 export하고 싶다면, 다음과 같이 수행하면 된다.
% exp scott/tiger tables=emp query=\"where job=\'MANAGER\' and sal\>=2500\"
Export: Release 8.1.5.0.1 - Production on Tue Sep 19 16:14:15 2000
About to export specified tables via Conventional Path ...
. . exporting table EMP 2 rows
exported
Export terminated successfully without warnings.
한글 컬럼에 대해서도 동일한 where 조건에 지정이 가능하다.
% exp scott/tiger tables=emp query=\"where ename like \'홍%\'\"
V8.1.5 버젼에서 제공되는 Query 옵션의 특징:
1. 테이블 레벨의 export 명령어에서만 가능하다.
2. Direct 옵션과 함께 사용될 수 없다.
3. Nested 테이블을 갖는 테이블에는 적용할 수 없다.
4. Partition 테이블에 대한 export에도 적용가능하다.
5. Import 명령에는 적용되지 않는다.Thanks Guys,
I am still a bit lost though...
It may be simply a matter of me finding Oracle 8i so I can do what I need to do.
Where can I get Orcale 8i from? Does anybody have it? The oracle site only has a version back to 9.2 I queried with a employee from Oracle University here in Australia, and he suggested asking in the forums.
Just so you know what I'm trying to do:
Data Server:
Running Aix with Oracle 7.14... actually could be 7.41 - I'll check today.
This system will not be upgraded to any later version of Orcale, because systems are in place, and core systems at our other sites have to be the same. (my project is a local one)
Web Server:
Running XP profession with IIS and using ASP (active server pages)
Currently running Oracle 10g, and ASP code connects to the local database on this machine via an ODBC connection.
At the moment, I have scripts on the Aix server that dumps data from Oracle 7.x into a .csv file.
Then, I have scripts that copy those csv files to the XP server, and they are imported to the local Oracle 10g database.
To display this data on the website, I use ASP via the odbc connection to query the local database on the XP server.
As said in my previous post, there must be an easier way to do this.
I need a local database on the XP server too, and am thinking the best way is to downgrade to 8i.
Can anybody tell me where I can get 8i to try this out? I have been trying to reasearch this for a while now without luck. Any help would be appreciated, and thanks for those who have replied so far.
-Tom -
Exporting Query Result to OpenOffice
Hello,
We would like to export Query Result from Web Application to a file which could be opened in OpenOffice.
Exporting data in XLS format doesn't work because XLS file is created with MS VML Markup with couln't be read by OpenOffice.
Does someone already deals with this kind of issue ?
How do you overcome this problem ?
Thanks in advance for your answer
LaurentHi Laurent,
Can you try saving the file in .csv.
ad try opening it in openoffice.
Hope this helps
PV -
Hi experts.
Is there any FM/BAPI/RFC that export query data based on cube to table.
i'm looking for solution with no use in mdx.
Thanks.Hi Gil.
You could use APD to extract the data from a query and then use the open hub to get the data out of SAP BW.
Bryn -
Question about WebLogic query syntax
Hello,
I am using WebLogic Server 6.0, which came as part of the WebGain
Studio SE 4.5 development kit. My question regards the Web Logic query
syntax, which I have not yet mastered.
I am trying to create a finder method that takes a single argument
of type "char" and finds all matching fields of the column "keyword" in
which the argument is the first letter of keyword. That is, if I were
only looking for fields beginning with the letter "M", I'd use:
(like keyword 'M%')
However, I'm looking for all fields beginning with the first letter
defined by the first argument. Sadly, this syntax:
(like keyword '$0%')
doesn't seem to be working. Any suggestions on the correct syntax?
If this is not the right forum for this question, could someone
suggest an appropriate newsgroup?
Thanks, Dave962466 wrote:
Hi all,
I have an issue I need help with. I have created a script for an automated partition create on a monthly basis. It creates a monthly partition containing all dates within the respective month. The script is essentially this:
ALTER TABLE SCHEMA.TABLE
ADD PARTITION &&1
VALUES LESS THAN (to_number(to_char(to_date('&&2', 'DD-MON-YY'), 'YYYYMMDD')))
TABLESPACE LARGE_DATA94 COMPRESS;
I continually get this error message "ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE"
The variable &&2 is passing in character data for the first of the month (E.G. '01-SEP-12'). &&1 passes character data for the month in MONYY (AUG12) I can run this query:
select
(to_number(to_char(to_date('&&2', 'DD-MON-YY'), 'YYYYMMDD')))
from dual;
With the output of 20120801. I cannot understand why I am able to run this partition create statement by hardcoding 20120901 but passing it in as a variable I receive the error. Note that I am not having problems with the &&1 variable. If anyone has any ideas please let me know. Thanks!I don't understand why you are taking a string, converting it to a date, then converting the date BACK TO a string ... then trying to convert that string to a number.
What is the data type of the partitioning key? It appears that it is a NUMBER, but actually represents a DATE. If so, that is a fundamentally flawed design. -
Greetings,
I am hoping to get some assistance with what I am thinking should be a simple content export. I am running UCM 11g with Folders_g. I have some root folder named rootfolder which has 30 or so content items directly in it and then 100 or so sub-folders. I have already migrated all the subfolders with their content successfully. Now I only need to export the remaining 30 or so items directly in the rootfolder. This sounds simple, but when I select that root folder using Folder Structure Archive, even though I do not place a check mark in any of the subfolders, the resultant export took 4 hours had over 160,000 items. I am only expecting these 30 or so items. How can I form a query to get only these? Idea i am thinking of is maybe to query for content which has parent folder id of rootfolder?
Thank you in advance for any help,
-KayceeThank you Jonathan - I wasn't receiving email notifications for this thread, so i wasn't aware that you had replied.
After "playing" around, I did end up with a successful export of the source folder's 30 items by using this query: xCollectionID = valueforfolder and dReleaseState = 'Y'
This did work, but there still remains for me some confusion around the use of Folder Structure Archive. I guess I was expecting that when using Folder Archive Configuration only, by checking the box of my intended parent folder and no other sub-folders under that box, that it should have exported it's 30 content items. And not the content items of the +/-100 sub-folders. I did not expect to have to add a content export query to refine/achieve the result. Simply, when using folder structure archive, shouldn't the export of content only pertain to the folder's checkbox you have marked?
Thanks again,
Kaycee -
Export query results to excel from forms
Are there any ways to export query results to MS Excel format files from a form.
Thanks.Here's my working code out of one of my forms that does this:
PROCEDURE export_transactions_to_excel IS
-- Declare the ole objects
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_Type;
worksheet ole2.obj_type;
cell ole2.obj_type;
-- my variables
rowCounter Number := 1;
local_cursor_Record number := :System.Cursor_Record;
old_cursor_Style varchar2(100);
errors_occurred boolean := false;
Ole_Error Exception;
pragma exception_init( Ole_Error, -305500 );
my_alert_id ALERT;
alert_response NUMBER;
procedure place_value_in_cell( rownum_in in number
, colnum_in in number
, value_in in varchar2 )
is
-- Declare handles to OLE argument lists
args ole2.list_Type;
begin
args := ole2.create_arglist;
ole2.add_arg(args, rownum_in); /* row number */
ole2.add_arg(args, colnum_in); /* column number */
-- the next line is for excel97
-- cell := ole2.invoke_obj( worksheet, 'Cells', args );
cell := ole2.get_obj_property( worksheet, 'Cells', args );
ole2.Destroy_arglist( args );
ole2.set_property( cell, 'Value', value_in );
ole2.release_obj (cell);
end place_value_in_cell;
procedure SaveSpreadsheet
is
args ole2.List_Type;
vDateStamp varchar2(20);
begin
vDateStamp := to_char(sysdate,'mmddyyyy') | | '_' | | to_char(sysdate,'hh24miss');
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:\PAPRETCC_' | | vDateStamp | | '.XLS');
OLE2.INVOKE(worksheet, 'SaveAs', args);
OLE2.DESTROY_ARGLIST(args);
--args := Ole2.Create_ARgList;
ole2.invoke( application, 'Quit' );
end SaveSpreadSheet;
procedure Open_EXCEL_Workbook is
Begin
application := ole2.create_obj('Excel.Application');
--ole2.set_property( application, 'Visible', 'True' );
-- Return object handle to the Workbooks collection
workbooks := ole2.get_obj_property( application, 'Workbooks' ); -- invoke_obj w/ excel 97
-- Add a new Workbook object to the Workbooks collection
workbook := ole2.invoke_obj( workbooks, 'Add' );
-- return object handle to the Worksheets collection for the
-- Workbook
worksheets := ole2.get_obj_property( workbook, 'Worksheets' ); -- invoke_obj w/ Excel97
-- Add a new Worksheet to the Worksheets collection
worksheet := ole2.invoke_obj( worksheets, 'Add');
end open_EXCEL_workbook;
PROCEDURE Write_Column_Headers IS
BEGIN
place_value_in_cell(rowCounter,1, 'Payer Name');
place_Value_in_cell(rowCounter,2, 'Payer Address');
place_value_in_cell(rowCounter,3, 'SSN');
place_value_in_cell(rowCounter,4, 'Account');
place_value_in_cell(rowCounter,5, 'Refund Receipt');
place_value_in_cell(rowCounter,6, 'Pretax Allocation');
place_value_in_cell(rowCounter,7, 'Tax Allocation');
place_value_in_cell(rowCounter,8, 'Total Amount');
place_value_in_cell(rowCounter,9, 'Orig Receipt');
place_value_in_cell(rowCounter,10,'Orig Date');
place_value_in_cell(rowCounter,11,'TR Number');
place_value_in_Cell(rowCounter,12,'Date');
place_Value_in_cell(rowCounter,13,'Status');
place_value_in_cell(rowCounter,14,'Vt Number');
rowCounter := rowCounter + 1;
END Write_Column_Headers;
PROCEDURE Export_The_Data IS
original_receipt number;
original_date DATE;
original_transmittal_number number;
BEGIN
-- Return object handle to cell A1 on the Worksheet
Go_block('Transactions');
First_Record;
LOOP
IF alert_response = ALERT_BUTTON2 or
(alert_response = ALERT_BUTTON1 and nvl(:transactions.rg_approval,'N') <> 'N' )
-- :system.record_status = 'CHANGED')
then
place_value_in_cell( rowCounter, 1, :TRANSACTIONS.NDB_PAYEE_NAME );
place_value_in_cell( rowCounter, 2, nvl(:TRANSACTIONS.NDB_PAYEE_ADDRESS,'unknown') );
place_value_in_cell( rowCounter, 3, nvl(:TRANSACTIONS.NDB_SSN,'unknown') );
place_value_in_cell( rowCounter, 4, :transactions.NDB_DESCRIPTION );
place_value_in_cell( rowCounter, 5, to_char(:Transactions.transaction_group_EID) );
place_Value_in_cell( rowCounter, 6, to_char(:transactions.ndb_pretax_amount) ); -- chg
place_ value_in_Cell( rowCounter, 7, to_char(:transactions.ndb_tax_amount) );
place_value_in_cell( rowCounter, 8, to_char(:transactions.amount_including_taxes) );
original_receipt := revenue_pkg.original_receipt_number(
:transactions.transaction_group_eid,
:transactions.allocation_eid,
:transactions.allocation_table );
original_date := revenue_pkg.original_receipt_date(
:transactions.transaction_group_eid,
:transactions.allocation_eid,
:transactions.allocation_table );
original_transmittal_number := revenue_pkg.transmittal_number_for_receipt(original_receipt);
place_value_in_cell( rowCounter, 9, nvl(to_char(original_receipt),'unknown') );
place_value_in_cell( rowCounter, 10, nvl(to_char(original_date,'mm/dd/yyyy hh24:mi:ss'),'unknown') );
place_value_in_cell( rowCounter, 11, nvl(to_char(original_transmittal_number),'unknown') );
-- COMPTROLLER COLUMNS
IF ( alert_response = ALERT_BUTTON1 and nvl(:transactions.rg_approval,'N') <> 'N' )
THEN
place_value_in_cell( rowCounter, 12, to_Char(sysdate,'mm/dd/yyyy') );
place_value_in_cell( rowCounter, 13, nvl(:transactions.rg_approval,'N') );
place_value_in_cell( rowCounter, 14, nvl(to_char(:location.vt_number),'NULL') );
END IF;
End If;
exit when :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
rowCounter := rowCounter + 1;
END LOOP;
END Export_The_Data;
/* ----------------------------------- main procedure --------------------------------------*/
BEGIN
Begin
my_alert_id := Find_Alert('THREE_BUTTON_ALERT');
IF NOT ID_NULL( my_alert_id ) then
alert_Response := SHOW_ALERT( my_alert_id );
If (alert_response = ALERT_BUTTON1) OR
(alert_response = ALERT_BUTTON2) then
old_Cursor_style := get_application_property( CURSOR_STYLE );
set_application_property( CURSOR_STYLE, 'BUSY' );
Open_EXCEL_WorkBook;
Write_Column_Headers;
Export_The_Data;
Else
Raise Form_Trigger_Failure;
End If;
Else
Raise Form_Trigger_Failure;
End If;
exception
when Form_Trigger_Failure then
RAISE;
when Ole_Error then
AlertSend( 'There was an error exporting the data to Microsoft Excel (receipt# ' | |
to_Char(:transactions.transaction_Group_eid) | | ')', false );
errors_occurred := TRUE;
when others then
AlertSend( SQLERRM, false );
errors_occurred := TRUE;
End;
Ideally, I'd like to call SaveSpreadsheet in Export_The_Data, and just ExitExcel here,
but it prompts for whether to save the changes and I don't know how to get around that
right now. SO, we just save and exit, regardless.
SaveSpreadSheet;
-- Release the OLE objects
ole2.release_obj (worksheet);
ole2.release_obj (worksheets);
ole2.release_obj (workbook);
ole2.release_obj (workbooks);
ole2.release_obj (application);
IF NOT errors_occurred then -- stay on the record that caused the error
Go_Record( local_cursor_Record );
End If;
Set_Application_Property ( CURSOR_STYLE, old_cursor_style );
EXCEPTION
When Form_Trigger_Failure then
null;
When Others then
AlertSend( SQLERRM );
END export_transactions_to_excel;
Maybe you are looking for
-
Can you swap out the logicboard of an older model mac for a newer one?
So i just bought a mac on ebay, its in good working condition, however i was wondering if i was able to swap out an older model logicboard for a new one. The mac i currently have is a unibody mac, MB466LL/A, and the logic board i was looking to poss
-
Possible to have video playlists NOT show up in the music playlists tab?
I like how when I go to videos > video playlists, my iPod will show only the playlists that contain only movies and music videos inside. Is it possible to have it so that the video-only playlists are parsed from the music > playlists tab? That sectio
-
UI Elements Attributes not corresponds to the implicit config. settings
Hello, I have a WebDynpro component with 2 applications. I created a Component configuration and for one application, a application configuration. in the first application I want all will be exactly like in design time, but in the second one, I want
-
How to use FilePermission class to change the file permission in Linux
Hi all, I'm running in a issue related to changing the file permission under Linux environment. I'm using Suse 10.0 Linux and run jdk 1.5 java runtime. I want to create a file during execution time and change the permission of the same. I use File.cr
-
Lost my email on my iPad after iPad was restored???
Yesterday, an Apple tech. helped me restore my Apple iPad. It had stopped working. We went through iTunes and restored it. It seems fine other than I do not have Email any longer. I don't know what to do to get it back. The settings look ok but