Filter Table data on Query Result
Dear All
When I execute the following query (in Query Generator) I got 6411 records. But when I want to filer this table, in the drop down list in 'ITEM' column I found only 500 records (i.e. up to the recods starting with 'K' though there are records starting with 'W' in 'ITEM' field).
I am using SAP B1, PL 14.
Can any one suggest how to get all the records in the drop down list of filter window?
My query is as follows:
SELECT distinct D.ITEMCODE + ' - ' + D.DSCRIPTION 'ITEM',
DATENAME(M,H.DOCDATE) + ' - ' + DATENAME(YYYY,H.DOCDATE) 'MONTH',
D.PRICE
FROM PCH1 D INNER JOIN OPCH H ON H.DOCENTRY= D.DOCENTRY
WHERE H.DOCTYPE='I' AND D.ITEMCODE + ' - ' + D.DSCRIPTION IS NOT NULL
ORDER BY 1, 2
Thnaks & with regards
Aloke
Edited by: ALOKE BANDYOPADHYAY on Jul 15, 2011 4:51 PM
Dear Gordon
I have placed the following problem also in forum since one month without receiving any positive answer. So I am requesting you personally can you help me to solve the problem:
Following is the code I am using for revaluation of items which is giveing "Internal Error 5002':
Dim lMaterialRevaluation As SAPbobsCOM.MaterialRevaluation
lMaterialRevaluation = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation)
For li As Integer = 0 To ls_Lines.Length - 1
If ls_Lines(li).Split(vbTab).Length 5 Then
My.Computer.FileSystem.WriteAllText(ls_OutFileName, lnl_SrlNo & "--> Can't Read in the data in Line " & li + 1, True)
My.Computer.FileSystem.WriteAllText(ls_OutFileName, vbNewLine, True)
lnl_SrlNo += 1
Continue For
End If
ls_ItemCode = ls_Lines(li).Split(vbTab)(0).Trim
ls_WareHouseCode = ls_Lines(li).Split(vbTab)(1).Trim
ld_Price = ls_Lines(li).Split(vbTab)(2).Trim
li_IncAccount = ls_Lines(li).Split(vbTab)(3).Trim
li_DecAccount = ls_Lines(li).Split(vbTab)(4).Trim
lMaterialRevaluation.Lines.SetCurrentLine(li)
lMaterialRevaluation.Lines.ItemCode = ls_ItemCode
lMaterialRevaluation.Lines.WarehouseCode = ls_WareHouseCode
lMaterialRevaluation.Lines.Price = ld_Price
lMaterialRevaluation.Lines.RevaluationIncrementAccount = li_IncAccount
lMaterialRevaluation.Lines.RevaluationDecrementAccount = li_DecAccount
lMaterialRevaluation.Lines.Add()
Next
Dim li_Ret As Integer
li_Ret = lMaterialRevaluation.Add
If li_Ret = 0 Then
MsgBox("Material Revaluation Completed")
System.Runtime.InteropServices.Marshal.ReleaseComObject(lMaterialRevaluation)
Else
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(sErrMsg & ", Material Revaluation failed")
End If
Thanks & with regards
Aloke
Similar Messages
-
Filter tables based on query results
Hello,
I have a report from multiple data providers.The first page of it is a summary page for the data providers and it has a small table per data provider.
My question is- is it possible to not show a table if the data provider has not results ?
If so - then how can this be done ?Follow this steps:
1. Select Table. Do right click
2. Choose Table Format. Select Appeareance Tab.
3.Check "Hide Block" checkbox.
4.Press Edit Button and place this formula:
=NumberOfRows("YOUR PROVIDER NAME HERE") = 0
5.Press Ok. The formula will be displayed under the "Hide block" checkbox. Press Ok.
Apply this to every table you one to hide if its data provider has not results.
If one of your tables hides and you still want to do some additional modifications press "Structure button" to be able to see it.
Edited by: PadawanGirl on Feb 16, 2011 6:01 PM -
Table Data Source Search Result gives ClassCastException
I set up a table data source and queried it using the following URL:
http://machine_name:port/ultrasearch/query/search.jsp?usearch.p_mode=Advanced
and specified my table data source. The result URLs
came up with the right primary key id. However when I
click the URL, I get:
java.lang.ClassCastException: com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].sql.OrclCallableStatement
at oracle.ultrasearch.query.DisplayUtil.displayTableUrl(DisplayUtil.java:131)
at display.jspService(_display.java:1568) [SRC:/display.jsp:81]
at com.orionserver[Oracle9iAS (9.0.2.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
I have specified NUMBER as the data type for my primary key column and it is of type NUMBER in my table DDL. Is that OK or could this be causing the problem?
DineshDinesh,
Can you provide the following information for creating the table data source:
- Is the table data source based on a table or a view?
- Is the table/view in the local or remote database?
- If the table is in the local database, is the table in the instance owner schema or another schema?
- Do you login to Ultra Search Admin Tool as the instance owner or other users?
- Does the instance owner schema have privileges to read the contents in the table/view? -
Filter table data without calling BAPI
Hi all,
How I can filter VC table without calling BAPI or other backend? The objective is to bring a large data only once and allow to user filtering of this data.
The problem is that the filter options are dynamic so I can't use "hidden tables" workarownd.
Any ideas?
Thanks,
OlaHi,
I think this is not possible, because you can only filter the data once with the filter element. If you use a BI query you can use filters. Maybe you can bring the data to a hidden table and get the data again from this table with different filter elements resp. dynamic filter values, but I think this is very tricky and not a good solution.
Best Regards,
Marcel -
How can I export a Oracle DB table or a Query Result to an mdb (MS Access) File ?
Hi,
I would like to export a particular table or a particular data subset (result from a SQL query) to a MDB file, I tried with Oracle SQL Developer but I cannot see mdb as a possible export option.
How can I do to export data to a mdb file ? I'm currently using SQL Developer on GNU/Linux, can you suggest me a link or a tool to do such things ?
I consider an acceptable solution also to use SQL Developer to export data in a certain format and then use another software to open that format and create an mdb. What do you suggest ?Open the (an) MS Access database and:
1) Click on File -> Link tables -> Select ODBC Database(s)
2) On popup window select (or create new) "Machine Data Source" -> Oracle Driver -> Select the TNS alias (service name)
Good luck! -
External Table to Internal table Data update query
Hi all ,
I have Follwoing 2 tables one is external oracle and 2nd is internal and both table have the same data as following this is sample data while actual table contains millions of record.
External Table name SE2_EXT
GL_REF_NO GL_CUST_ID GL_TRAN_AMT_LCY GL_REVERSAL_MARKER GL_GL_ID GL_LOCAL
1 5 513557 100 136340003678088.020001
2 5 513557 -100 R 136340003678088.020002
3 1 26 -685.12 136340003674772.030001
4 1 26 685.12 R 136340003674772.030002
5 4 500539 100 136340003477900.000001
6 4 500539 -100 R 136340003477900.000002
7 23 604612 182.15 136340003578165.170001
8 23 604612 -182.15 R 136340003578165.170002
9 76 232033 -230.7 136340003576922.100001
10 76 232033 235.7 R 136340003576957.010001 I want to update GL_LOCAL column with 'R' with conditions that if
WHERE GL2.GL_GL_ID=GL2_EXT.GL_GL_ID
AND GL2.GL_REF_NO=GL2_EXT.GL_REF_NO
AND GL2.GL_CUST_ID=GL2_EXT.GL_CUST_ID
AND GL2.GL_REVERSAL_MARKER IN ('R',NULL)
AND GL2.GL_TRAN_AMT_LCY=GL2_EXT.GL_TRAN_AMT_LCYbut the tricky thing is GL_TRAN_AMT is one time - (minus) and one time +(plus). I only want to update those record who have same TRAN_AMT_LCY with same other condition mentioned above.
I tried merj statement but it did'nt work.If any body help me i would be appriciated.
MERGE INTO SE2 A
USING ( SELECT GL_REF_NO,GL_CUST_ID,GL_TRAN_AMT_LCY,GL_REVERSAL_MARKER,GL_GL_ID FROM GL2_EXT) B
ON (A.GL_GL_ID=B.GL_GL_ID AND A.GL_CUST_ID=B.GL_CUST_ID)
WHEN MATCHED THEN
UPDATE
SET A.GL_LOCAL_A1=B.SE_LOCALWhy is it tricky? You did not say.
Making a guess as to the problem why not use TO_NUMBER to cast the string? -
Data declaration for result of dynamic query
Good day,
can you help me with declaration of data for query result that can be from any columns of any tables.
For example (this is from SAP documentation):
DATA: wa TYPE spfli,
ftab TYPE TABLE OF STRING.
APPEND 'CITYFROM' TO ftab.
APPEND 'CITYTO' TO ftab.
SELECT DISTINCT (ftab)
FROM spfli
INTO CORRESPONDING FIELDS OF wa
WHERE
carrid = 'LH'.
WRITE: / wa-cityfrom, wa-cityto.
ENDSELECT.
This is clear to me, but I don't know how to do in case FROM clause is generated dynamically too.
SELECT DISTINCT (ftab)
FROM (tab1)
ThanksCheck out this sample program....
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: alv_fldcat type slis_t_fieldcat_alv,
it_fldcat type lvc_t_fcat.
type-pools : abap.
data : it_details type abap_compdescr_tab,
wa_details type abap_compdescr.
data : ref_descr type ref to cl_abap_structdescr.
data: new_table type ref to data,
new_line type ref to data,
wa_it_fldcat type lvc_s_fcat.
selection-screen begin of block b1 with frame title text .
parameters: p_table(30) type c.
selection-screen end of block b1.
* Get the structure of the table.
ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
it_details[] = ref_descr->components[].
loop at it_details into wa_details.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = wa_details-name .
wa_it_fldcat-datatype = wa_details-type_kind.
wa_it_fldcat-intlen = wa_details-length.
wa_it_fldcat-decimals = wa_details-decimals.
append wa_it_fldcat to it_fldcat .
endloop.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
* Select Data from table.
select * into table <dyn_table>
from (p_table).
* Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Regards,
Rich Heilman -
InfoSet query results confusion...
HI All,
We have 2 ODS. One is Billing and the other is Project Sales. In the billing ODS we have billing documents that have the billing date (calmonth) and employee. The projected sales is an ODS that has for each employee for each month, their Projected Sales.
We have created an InfoSet and linked in the billing ODS the calmonth (in billing) to period field (in Projected Sales) and 0SALESEMPLOYEE (in billing) to PERNR (in Projected) ODS.
The Projected Sales ODS has exactly 1 entry for each employee for each month. i.e. employee '12345' for 200501 a projected sales of 10,000. With the above mapping the query results for projected sales is about 50X more. In other words, it shows 30 million when it should be 150,000. I think this has to do with it somehow including results from the billing ODS??
We've read help about interpreting infoset query results and it's quite confusing. It speaks of some filter option to exclude query result set, but can't figure it out.
In addition to the monthly projected sales we want to see for each employee, we want to include all the net sales they had for the same month. So you can see the mapping we did above.
Query would look like this:
Calmonth Employee NetSales ProjSales
200501 123456 220,000 10,000
The projected sales is entirely off by millions of dollars and also the net value isn't calculating correctly. I'm sure out setup is incorrect.
Can someone help us out please.
Thanks
MikeHi Ashish,
What you explained is exactly what is the case.
The billing ODS has many, many entries for the for the employee + calmonth combination while the projected sales only has 1. I've figured out that this is what is happening...multiplying the number of entries in the billing X the Projected Sales.
Is there a way to avoid this with a particular join in InfoSet?
The key for billing ODS has billing number, billing item and fiscal year variant, while the key for projected sales is start period and pernr. So I don't see how a multiprovider would work because the fields are different...am I incorrect?
Thanks for your quick reply,
Mike -
Filter in query result table not populated by criteria previously selected.
Hi Experts,
I'm currently working on the the Upgrade of our BW production line from
release 3.0b to 7.0:
Configuration of target system
BW system : Release 7.0
BEx Analyser : Release 2004s, Support Package9, Patch 1, Revision 321
Sap Gui 6.4
We're especially trying to check the non-regression of the non-converted queries in the new system (release 7.0).
And we get the following issue: After having selected the selection criteria in the selection window, the reminder of selected criteria is not done in the filter part of the target query result. Is it a normal behavior or not ?
Indeed, in the previous system configuration (BW 3.0b), the user is accustomed to seeing just above his result table the selection criteria that he had previously filled in in the selection window.
Please find herewith an example describing the problem.
Thanks in advance for your help.In order to be more clear, hereunder an example:
- I have a field untitled "Business Division"in the selection window.*
- I fill in this field with the value "OND"
- I execute the query with this value for this field.
- The query result correclty appears.
- I click on the "Filter" button to display the Filter table with the columns "Navigation pane" and "Filter criteria".
- In the "Navigation pane", there is the field "Business Division".
- For me, the corresponding "Filter criteria" should be the value "OND", but nothing is displayed...
Thanks in advance foryour help.
Regards,
Steph -
RUN Time error while use filter table in query generator
Hai..
I have 2 Functions under "Scalar valued functions" in SQL Server,i try to call this functions in Query generator its working fine,result also display correctly, but i click filter table system showing Error Message " Run Time Error,Abnormal program termination" then SAP is get closed,i tested this scenario in 3 Database am getting same error , Is this BUG in SAP B1?There is no error number in error messageThis is my function
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER function [dbo].[Get_TransObjName](@Obj_type NUMERIC(20,5))
returns varchar(500) as
BEGIN
DECLARE @Obj_type_Name varchar(100)
select @Obj_type_Name =
case @Obj_type
when -2 then 'Opening Balance'
when -3 then 'Closing Balance'
when 1 then 'oChartOfAccounts'
when 2 then 'oBusinessPartners'
when 3 then 'oBanks'
when 4 then 'oItems'
when 5 then 'oVatGroups'
when 6 then 'oPriceLists'
when 7 then 'oSpecialPrices'
when 8 then 'oItemProperties'
when 12 then 'oUsers'
when 13 then 'A/R Invoices'
when 14 then 'A/R Credit Memo'
when 15 then 'A/R DeliveryNotes'
when 16 then 'A/R Returns'
when 17 then 'oOrders'
when 18 then 'A/P Invoice'
when 19 then 'A/P Credit Memo'
when 20 then 'Goods Receipt PO'
when 21 then 'Goods Returns'
when 22 then 'PurchaseOrders'
when 23 then 'Quotations'
when 24 then 'IncomingPayments'
when 25 then 'Deposit'
when 28 then 'oJournalVouchers'
when 30 then 'JournalEntries'
when 31 then 'oStockTakings'
when 33 then 'oContacts'
when 36 then 'oCreditCards'
when 37 then 'oCurrencyCodes'
when 40 then 'oPaymentTermsTypes'
when 42 then 'oBankPages'
when 43 then 'oManufacturers'
when 46 then 'VendorPayments'
when 48 then 'oLandedCostsCodes'
when 49 then 'oShippingTypes'
when 50 then 'oLengthMeasures'
when 51 then 'oWeightMeasures'
when 52 then 'oItemGroups'
when 53 then 'oSalesPersons'
when 56 then 'oCustomsGroups'
when 57 then 'ChecksforPayment'
when 58 then 'Stock List'
when 59 then 'Goods Receipt'
when 60 then 'Goods Issue'
when 64 then 'oWarehouses'
when 65 then 'oCommissionGroups'
when 66 then 'oProductTrees'
when 67 then 'Inventory Transfers'
when 68 then 'oWorkOrders'
when 69 then 'Landed Costs'
when 70 then 'oCreditPaymentMethods'
when 71 then 'oCreditCardPayments'
when 73 then 'oAlternateCatNum'
when 76 then 'Postdated Deposit'
when 77 then 'oBudget'
when 78 then 'oBudgetDistribution'
when 81 then 'oMessages'
when 91 then 'oBudgetScenarios'
when 97 then 'oSalesOpportunities'
when 93 then 'oUserDefaultGroups'
when 101 then 'oSalesStages'
when 103 then 'oActivityTypes'
when 104 then 'oActivityLocations'
when 112 then 'oDrafts'
when 116 then 'oDeductionTaxHierarchies'
when 117 then 'oDeductionTaxGroups'
when 125 then 'oAdditionalExpenses'
when 126 then 'oSalesTaxAuthorities'
when 127 then 'oSalesTaxAuthoritiesTypes'
when 128 then 'oSalesTaxCodes'
when 134 then 'oQueryCategories'
when 138 then 'oFactoringIndicators'
when 140 then 'oPaymentsDrafts'
when 142 then 'oAccountSegmentations'
when 143 then 'oAccountSegmentationCategories'
when 144 then 'oWarehouseLocations'
when 145 then 'oForms1099'
when 146 then 'oInventoryCycles'
when 147 then 'oWizardPaymentMethods'
when 150 then 'oBPPriorities'
when 151 then 'oDunningLetters'
when 152 then 'oUserFields'
when 153 then 'oUserTables'
when 156 then 'oPickLists'
when 158 then 'oPaymentRunExport'
when 160 then 'oUserQueries'
when 162 then 'Inventory Valuation'
when 163 then 'oCorrectionPurchaseInvoice'
when 164 then 'oCorrectionPurchaseInvoiceReversal'
when 165 then 'oCorrectionInvoice'
when 166 then 'oCorrectionInvoiceReversal'
when 170 then 'oContractTemplates'
when 171 then 'oEmployeesInfo'
when 176 then 'oCustomerEquipmentCards'
when 178 then 'oWithholdingTaxCodes'
when 182 then 'oBillOfExchangeTransactions'
when 189 then 'oKnowledgeBaseSolutions'
when 190 then 'oServiceContracts'
when 191 then 'oServiceCalls'
when 193 then 'oUserKeys'
when 194 then 'oQueue'
when 198 then 'oSalesForecast'
when 200 then 'oTerritories'
when 201 then 'oIndustries'
when 202 then 'oProductionOrders'
when 203 then 'A/R Down Payment'
when 204 then 'A/P Down Payment'
when 205 then 'oPackagesTypes'
when 206 then 'oUserObjectsMD'
when 211 then 'oTeams'
when 212 then 'oRelationships'
when 214 then 'oUserPermissionTree'
when 217 then 'oActivityStatus'
when 218 then 'oChooseFromList'
when 219 then 'oFormattedSearches'
when 221 then 'oAttachments2'
when 223 then 'oUserLanguages'
when 224 then 'oMultiLanguageTranslations'
when 229 then 'oDynamicSystemStrings'
when 231 then 'oHouseBankAccounts'
when 247 then 'oBusinessPlaces'
when 250 then 'oLocalEra'
when 280 then 'oSalesTaxInvoice'
when 281 then 'oPurchaseTaxInvoice'
when 300 then 'BoRecordset'
when 305 then 'BoBridge'
when 260 then 'oNotaFiscalUsage'
when 258 then 'oNotaFiscalCFOP'
when 259 then 'oNotaFiscalCST'
when 261 then 'oClosingDateProcedure'
when 10 then 'oBusinessPartnerGroups'
when 278 then 'oBPFiscalRegistryID'
else cast(@Obj_type as char(20)) end
return @Obj_type_Name
END -
Can't do anything to table- data tab after cancelling initial query
When I select a table and go to "Data" tab, sqldeveloper executes initial query to fetch first 50 rows. While it does so, "refresh", "add" etc. icons, and "Sort..." button are blocked. The problem is, if I cancel that initial query, icons and buttons STAY grayed-out, so I can't refresh the table. Pressing enter on "filter:" field also doesn't work. The only way to restore functionality is close the tab and open it again.
Steps to reproduce:
1) Open a large table
2) Filter it with some query
3) Sort results
4) Close the tab
5) Open the table again. "Sort" settings persist, so SQLDeveloper starts running a very long query
6) Press "Cancel Query" in the appearing box
Canceling the query somehow resets persisted Sort settings, so it works fine next time I open the table.Can't reproduce it,Is there any setting
Umm, I'm not exactly sure what do you mean by that. I don't remember modifying anything in the preferences for persisted settings (like sorting order or hidden columns). In fact, I'm pretty sure there is no such settings in preferences.
As for reproducing the bug, may I ask you which step fails, exactly? Do sort settings reset when you open the table again? Or does the query executes instantly? Oracle sorts table too fast if it's under 1 000 000 rows, and it becomes visible on 8 000 000+ rows table. -
How to fetch the data from query to internal table ?
Dear all ,
I would like to fetch the query data(sq01) into my internal table ? is it possible to do that ?
Best Regards,
CarlosHi
Try this <b>RRW3_GET_QUERY_VIEW_DATA</b>
Also, you can have a look at this...
<a href="/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii Query results into Internal table</a>
Regards
Raj -
Querying wide (multi-record case) table data in oracle 10g
I've got a set of "wide" (multi-record case data format) tables similar to the format described in Oracle's "Oracle Data Mining Concepts" book in chapter 2 (http://download-west.oracle.com/docs/cd/B14117_01/datamine.101/b10698/2data.htm#1010394).
I like the flexibility of this format, especially since it can handle thousands of attributes. But the main problem I have with this format is in determining how to write efficient, complex queries against the data.
I've included some sample data below to demonstrate my problem. I've got two tables, one with people and the other with the attributes and values of age, income, height and weight. If I try to generate a complex query against this data, I seem to either have to rely on multisets and functions, or on a large number of self joins. Neither of which seems to scale well or perform well for large amounts of data. I know I could also add a pipelined TABLE function to filter the data more, but none of these options seem like great solutions. Does anyone have any ideas for a better way to form complex well performing queries against this type of data layout?
For example, with my sample data below I'd like to select everyone whose (income = 2000) or (income = 50000 and weight = 210), but the only way I see of doing this is with a query like the following (which won't take advantage of any indexes on the data):
select * from people_attributes_view
where find_eq_attr(AttributeValue('income',2000),attribute_values) is not null
or (find_eq_attr(AttributeValue('income',50000),attribute_values) is not null
and
find_eq_attr(AttributeValue('weight',210),attribute_values) is not null);
Any help is greatly appreciated.
Thanks.
-- My full example starts here ----------------
-- Create the sample tables and data
create table people (id int, name varchar(30));
create table attributes (id int, attribute varchar(10), value NUMBER);
insert into people values (1,'tom');
insert into people values (2,'jerry');
insert into people values (3,'spike');
commit;
insert into attributes values (1,'age',23);
insert into attributes values (1,'income',1000);
insert into attributes values (1,'height',5);
insert into attributes values (1,'weight',120);
insert into attributes values (2,'age',20);
insert into attributes values (2,'income',2000);
insert into attributes values (3,'age',30);
insert into attributes values (3,'income',50000);
insert into attributes values (3,'weight',210);
commit;
-- Create some types, functions and views for the search
CREATE OR REPLACE TYPE AttributeValue AS OBJECT
(attribute varchar(30),
value NUMBER);
CREATE OR REPLACE TYPE AttributeValues AS TABLE OF AttributeValue;
create or replace function find_eq_attr (val AttributeValue, vals AttributeValues) RETURN AttributeValue IS
begin
for i in vals.FIRST .. vals.LAST
LOOP
if ((val.attribute = vals(i).attribute) and
(val.value = vals(i).value)) then
return vals(i);
end if;
END LOOP;
return null;
end;
create or replace view people_attributes_view as
select p.name, p.id,
cast(multiset(select attribute,value from attributes a where a.id = p.id)
as AttributeValues) attribute_values
from people p;
-- Search for everyone whose (income = 2000) or (income = 50000 and weight = 210)
select * from people_attributes_view
where find_eq_attr(AttributeValue('income',2000),attribute_values) is not null
or (find_eq_attr(AttributeValue('income',50000),attribute_values) is not null
and
find_eq_attr(AttributeValue('weight',210),attribute_values) is not null);I like the flexibility of this format, especially
since it can handle thousands of attributes. But the
main problem I have with this format is in
determining how to write efficient, complex queries
against the data. Can't be done. The flexibility is achieved at the cost of simplicity and performance, it is a trade off.
See this thread for a full discussion on the subject.
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:10678084117056 -
How to filter parent and child tables data in impdp?
Hi Friends,
i hope everyone doing good..
I have two tables in my schema like below.
STUDENT_DTLS:-
SID Sname CID
1 venkat 001
2 uppy 002
3 deepu 003
4 trinath 003
5 naveen 004
6 ramesh 005
COURSE_DTLS:-
CID CNAME Fee
001 Oracle 2000
002 java 6000
003 sieble 4000
004 informatica 3000
005 obiee 4000
if I load only few Student details say sid=1,2,3 into another environment using impdp,corresponding to those students course details from COURSE_DTLS table only need to be loaded.Not all course details.
Iam Expecting Result in new schema as below:-
SID Sname CID
1 venkat 001
2 uppy 002
3 deepu 003
CID CNAME Fee
001 Oracle 2000
002 java 6000
003 sieble 4000
But when i am using the below import scrit,The COURSE_DTLS is loading first and its query option(select cid from STUDENT_DTLS) is returning no rows.Because at that time no data is insertred into STUDENT_DTLS yet.
secondly it is importing data into STUDENT_DTLS with query option where sid=in (1,2,3) which is loaded propelry.
Thirdly it is trying to enable primary key and Foreign key constraints which is also failing because of no data in COURSE_DTLS table.
i have changed the order of tables in TABLES clause like tables=COURSE_DTLS ,STUDENT_DTLS.But still COURSE_DTLS table is loading first.
impdp pa_data_sub/******* NETWORK_LINK=qdssih30 tables=STUDENT_DTLS,COURSE_DTLS query='STUDENT_DTLS:"where SID IN(1,2,3)"','COURSE_DTLS:"where cid in(select cid from STUDENT_DTLS)"', CONTENT=all table_exists_action=replace directory=DATA_PUMP_DIR logfile=exp_join.log
output:
Total estimation using BLOCKS method: 128 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . imported "PA_DATA_SUB"."COURSE_DTLS" 0 rows
. . imported "PA_DATA_SUB"."STUDENT_DTLS" 3 rows
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-39083: Object type REF_CONSTRAINT failed to create with error:
ORA-02298: cannot validate (PA_DATA_SUB.SYS_C0040905) - parent keys not found
Failing sql is:
ALTER TABLE "PA_DATA_SUB"."STUDENT_DTLS" ADD FOREIGN KEY ("CID") REFERENCES "PA_DATA_SUB"."COURSE_DTLS" ("CID") ENABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "PA_DATA_SUB"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at 17:28:13
Please suggest me how to achieve this task in a single import command?
Is there any option in impdp to prioritize the table to be loaded first?
Thanks,
Venkat VadlamudiYou can't be guaranteed which order the data will be loaded in, so using a query that examines a table that is being imported is not going to always work the way you want it. The failing constraints makes sense because there is no data.
So, in your case, course_dtls gets imported first and the table student-dtls exists, but it not populated yet, so the select cid from student_dtls comes back with 0 rows. The second query works fine.
You might be able to change the query to be:
'COURSE_DTLS:"where cid in(select cid from STUDENT_DTLS@qdssih30 where SID IN(1,2,3)"'
This way, you query the source table pointed to by the network link and you use the same subquery from the first table.
This should work for you... I think anyway.
Dean -
BEx analyzer 7.x: How to determine first data column in result table?
Hi,
we are upgrading to 2004s where the SAPBEXqueries Sheet is not used anymore. Instead there is BExRepositorySheet. Is there a way to determine first data column in result table?
Regards, Josko.hi dinesh......
please use 'INTO TABLE' instead of ' INTO CORRESPONDING FIELDS OF TABLE '. and use ' FOR ALL ENTRIES '............based on relavence ....coz when I set break point over the select queries it took me long time to execute .......
becoz u didnt used the for all entries in select query ............ u r read statement
READ TABLE I_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_KNVV-KUNNR. .....
it is reading wrong kunnr value .............even it took long time to execute ......
use sort where ever required...
use for all entries .......and check weather the table initial or not......
use sy-subrc check where ever reqired ..............
Maybe you are looking for
-
ITunes Won't Recognize Optical Drive / Can't Burn Discs.
Hi. I’m having some problems w/ an installation of iTunes on a Windows 64 bit PC. Specifically, when iTunes is installed, Windows 7 no longer recognizes the optical drive, and I can't burn discs via iTunes. I’ve attempted to implement all the solut
-
USB Harddisk will not format using DU under 10.2.8
This is a very very strange problem ( and might be a bug of Jaguar ) which I am not able to solve on my own : First - my Powermac is working and behaving like it should, no Hardware or Software issues at all. I have upgraded it with a Belkin USB PCI-
-
When I send attachments - for example graphic file (.mi extension from CoCreate's Designer drafting program) Thunderbird "opens" it (while sending it) as it is text file and thus makes teh message long (thousands of rows). I'm now solving this so tha
-
Iphone 4s - New 2nd replacement
Hello Everyone. After the 2nd replacement collected today, I connected it to my IMAC as recommended by the Orange Manager to restore my back-up, and then it froze in a cycle again after the "Choose a Network". Going back to the Apple Icon. Booked an
-
How can I combine advanced actions with the branching view?
I am creating a branching scenario in Captivate 7. It's fairly involved and I'd like to keep track of it with the branching view. But, I understand that if I use an Advanced Action, it won't show up in the view. My slides track a conversation that go