Hashing and buckets?
Can anybody explain what hashing and buckets are about?
A hashtable is a table in which you store data so that you'll be able to retrieve them quickly at a later time.
A hashtable contains many smaller buckets that the data gets distributed among.
With a hastable, you're basically creating lots of smaller groupings instead of one large one. If you have a way of telling quickly which bucket something got put into it makes your look up much quicker.
Similar Messages
-
Hi,
I have enabled FIPS compliant algorithms,including encryption, hashing and signing algorithms in (Windows server 2012 R2 ), after enabling. My SSIS package is not working and i am not able open my SSRS also.
So can any one assist in this.
Surendran.G
Regards, Surendran.GHi,
in latest security recommendation guides it is no longer recommended to use this setting (because it breaks a lot of stuff...).
http://blogs.technet.com/b/secguide/archive/2014/04/07/why-we-re-not-recommending-fips-mode-anymore.aspx
Consider turning it off if you do not have strict resuirements for it.
otherwise, You will have to investigate you code. SQL server forums would be the appropirate place to get help in troublesooting your code.
MCP/MCSA/MCTS/MCITP -
Unable to found Bucket start date and bucket end date in OFSAA 6
Hi,
How to find the Bucket start date and bucket end date in OFSAA 6.
I found following tables to mapped to Dim_Result_Bucket but unable to found columns pointing to Bucket Start Date and Bucket End Date.
Tables:
fsi_income_simulation_buckets
fsi_process_run_history
fsi_time_bucket_master
fsi_lr_irr_buckets_aux
fsi_m_alm_process
Kindly let me know the solution.Hi;
Please check below link which could be helpful for your issue:
https://blogs.oracle.com/ebs/entry/service_contracts_warranty_created_by
Regard
Helios -
How to Define Additional Incompatiblity Groups and Buckets
How do I define additional incompatiblity groups and buckets? I added them to the Advanced Pricing Lookups screen, but what is the next step?
The problem is that my new Incompatibility Level (4) is not working the same way as Levels 1-3. Anything I put in Level 4, acts like Level 1.
I did notice that the Lookup code I used is in a slightly different format as the seeded codes. Could this be the problem? The seeded codes are LVL 1, LVL 2, LVL 3. My new code is LVL4 (no space). -
Back flush with both Packet and Bucket
Dear all,
We produce consumer goods in our company and we maintain Finish Goods in Packet and Bucket. Can we key in Back flush in both unit Packet and Bucket?
E.g we have Finish Goods A, Qty = 10 Bucket and 23 Packet
(1 Bucket = 40 Packet)
Can we input into Backflush : 10 Bucket + 23 Packet ?
Or we can input by (10*40+23) Packet only?
Pls advise us.
Thank you very much!
CHCH,
Why do you want to backflush the finished goods.
I think you want to do auto GR for this FG on order.
If that is the case then you can do following things.
You have the base unit of measure as packet.
In the material master of that FG, in the work scheduling view enter order unit as bucket.
As soon as you enter system will give you pop up.
Manintain the relation of both the units there & save.
Henceforth whenever the production order will be created it will pick up the unit as bucket with relation given in packet in the order header.
Put auto GR control key in one of the operation in the order.
So it will suggest the GR with confirmation.
In MMBE you can see the stock with any of the unit.
Hope this helps you.
SmanS -
Hi,
I have an application that needs to maintain user accounts , it needs to store their usernames and passwords somewhere securely, i looked for ways to accomplish that and found that i need to hash and add a salt to the passwords before storing them ..all this is fine, the problem i have now is how and where to store them because my application can't use a database, i thought i might store them in simple text files but this would be very simple to crack, i don't wanna use the Windows registery because i want to maintain the portability of my application ..I would appreciate it very much if someone can give some help on how to accomplish this..Thanks in advancefor user passwords: you don't have to store them. just create a MD5 hashcode of each password and you can store it in simple textfiles. these can't be cracked because the passwords are not stored - just their hashcodes. when a user logs in, a hash code of the user's password is created and compared to the stored hashcode. voila! this is basic user password handling as the passwords are stored nowhere but just in the user's head. (for initialization, create a default password hash code and force the users to change their default password at least on first login.)
-
SAP- AR Report by customer, account number and bucket
Hello SAP Guru's,
I am looking for a report that has Customer name, Account number and balance by bucket(30 day, 60, 90, 120). I have seen this several times but cannot find it anywhere. Can anyone tell me/ help me with this?
Will award points.
THANKS!!!To clarify-
it would look something like this:
Customer Account # Customer Name 30 day 60 day 90 day 120+
123456789 ABC Company 100.00 0.00 50.00 5,0972.00
222222222 Another Co. 0.00 125.00 150.00 0.00
Thanks!
POINTS Awarded -
Ran my profile manager to create a second user profile for work and noticed there were a ton of profiles in there. all with seemingly random hashes, they all finished in |....hat| not sure what to make of it.
Marcelo,
I've been trying to load hundreds of pictures onto an SD card for digital photo frame and have the exact same problem. This also happens with a USB flash drive.
Found a solution - stuff the files - copy the stuffed file onto card and unstuff at destination. Give it a try - would love to know if it works for you as well. -
Hash created using DBMS_CRYPTO.Hash and md5sum, sha1sum not maching.
Hi,
I have PL/SQL script MD5SH1.sql to generate md5 and sha1 hash, but hash generated by this script and
hash generated by md5sum and sha1sum utility not matching.
Pl. tell me what is wrong,
------------------MD5SH1.sql----------------
set serveroutput on
DECLARE
input_string VARCHAR2 (200) := 'Lord of the ring'';
output_str_md5 VARCHAR2 (200);
output_str_sh1 VARCHAR2 (200);
hash_raw_md5 RAW(2000);
hash_raw_sh1 RAW(2000);
hash_algo_type1 PLS_INTEGER := DBMS_CRYPTO.HASH_MD5;
hash_algo_type2 PLS_INTEGER := DBMS_CRYPTO.HASH_SH1;
BEGIN
DBMS_OUTPUT.PUT_LINE ( 'Original string: ' || input_string);
hash_raw_md5 := DBMS_CRYPTO.Hash
src => UTL_I18N.STRING_TO_RAW (input_string, NULL),
--src => input_string,
typ => hash_algo_type1
hash_raw_sh1 := DBMS_CRYPTO.Hash
src => UTL_I18N.STRING_TO_RAW (input_string, NULL),
--src => input_string,
typ => hash_algo_type2
output_str_md5 := UTL_I18N.RAW_TO_CHAR (hash_raw_md5,'US7ASCII');
output_str_sh1 := UTL_I18N.RAW_TO_CHAR (hash_raw_sh1,'US7ASCII');
--output_str_md5 := hash_raw_md5;
--output_str_sh1 := hash_raw_sh1;
--dbms_output.put_line(hash_raw_md5);
--dbms_output.put_line(rawtohex(hash_raw_sh1));
DBMS_OUTPUT.PUT_LINE ('MD5 Hash: ' || output_str_md5);
DBMS_OUTPUT.PUT_LINE ('SH1 Hash: ' || output_str_sh1);
END;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The O/p of this script is
SYS@mydb> @MD5SH1.sql
Original string: Lord of the ring
MD5 Hash: �����+.v�`�a_A
SH1 Hash:
����E�k�[�F[c�2�
PL/SQL procedure successfully completed.
SYS@mydb>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The o/p of md5sum and sha1sum is
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[san@sde4 ~]$ echo "Lord of the ring" |md5sum
f3fbb6dfd8a2d6f8f6aeabc4d6e17c57 -
[san@sde4 ~]$ echo "Lord of the ring" |sha1sum
856f6132e23c7e335ca4188bd45c7bc9515f6905 -
[san@sde4 ~]$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Why these 2 hashes are not matching?
-Santosh MhaskarYou should take in account, that echo command adds a carriage return by default.
SQL> set serveroutput on
SQL> set echo on
SQL> declare
2 input_string varchar2(200) := 'Lord of the ring'||chr(10);
3 output_str_md5 varchar2(200);
4 output_str_sh1 varchar2(200);
5 hash_raw_md5 raw(2000);
6 hash_raw_sh1 raw(2000);
7 hash_algo_type1 pls_integer := dbms_crypto.hash_md5;
8 hash_algo_type2 pls_integer := dbms_crypto.hash_sh1;
9
10 begin
11 dbms_output.put_line('Original string: ' || input_string);
12 hash_raw_md5 := dbms_crypto.hash(src => utl_raw.cast_to_raw(input_string),
13 typ => hash_algo_type1);
14 hash_raw_sh1 := dbms_crypto.hash(src => utl_raw.cast_to_raw(input_string),
15 typ => hash_algo_type2);
16 dbms_output.put_line('MD5 Hash: ' || lower(rawtohex(hash_raw_md5)));
17 dbms_output.put_line('SH1 Hash: ' || lower(rawtohex(hash_raw_sh1)));
18 end;
19 /
Original string: Lord of the ring
MD5 Hash: f3fbb6dfd8a2d6f8f6aeabc4d6e17c57
SH1 Hash: 856f6132e23c7e335ca4188bd45c7bc9515f6905
PL/SQL procedure successfully completed.
SQL> !echo "MD5 Hash:" `echo 'Lord of the ring' | md5sum`
MD5 Hash: f3fbb6dfd8a2d6f8f6aeabc4d6e17c57 -
SQL> !echo "SH1 Hash:" `echo 'Lord of the ring' | sha1sum`
SH1 Hash: 856f6132e23c7e335ca4188bd45c7bc9515f6905 -Best regards
Maxim -
Operation with Hashed and Sorted Tables
Hi,
What are all the internal table operations are possible with sorted and Hashed table.
Kindly let me know,Refer this help in case you have not done already.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/frameset.htm
Regards,
Ravi Kanth -
Hi,
Basically, I receive a hash of a pk and would like to compare that hash value a pk in SQL Server. There is no stored hash value in that table. So I have to use CF function Compare to compare while looping the whole table. As a result, it's slow down. Is there any functions in SQL server or something that I can get a quicker comparison result?
Here is basically the loop of the table and comparing.
<cfquery name="name">
SELECT id
FROM tbl
</cfquery>
<cfloop query="name">
<cfset hashID = HASH(name.id,"SHA")>
<cfif COMPARE(url.id,hashID) EQ 0>
[do something]
</cfif>
</cfloop>Not sure which version of SQL Server you are using, but take a look at the HashBytes function. You could then do:
<cfquery name="name">
SELECT id
FROM tbl
WHERE HashBytes('SHA', id) = <cfqueryparam value="url.id" cfsqltype="CF_SQL_VARCHAR">
</cfquery>
<cfif name.RecordCount>
[do something]
</cfif>
I'm not sure if "CF_SQL_VARCHAR" is the right cfsqltype, or if it needs to be "CF_SQL_BLOB" (I think hashes are still essentially text, but SQL Server returns a VARBINARY from HashBytes).
EDIT: Make sure that ColdFusion and SQL Server are producing the same results, as they use different hashing libraries. Also, if you are hashing the table id in the URL for security, SHA is a pretty weak hashing algorithm. If you are using SQL Server 2012 or above, you should consider bumping that up to at least SHA-256 (SHA2-256 on the SQL Server side).
-Carl V. -
Saved Password For Safari in iOS Setting isn't Hash and it is showing the password
Hi,
I'm Using apple iphone 6 plus and the most iportant things for me is Security
in setting>safari>Passwords & AutoFill>Saved Passwords all off the password shows to who was work with the iphone with device password but it must be show as hash to everyone who use this device.You installed a hacked app, originally from the Mac App Store. It contains the receipt for a different app, downloaded using an account that you don't control. You need to identify and remove the hacked app.
Important: The app you need to remove is not necessarily the one named in the App Store alert. For example, if the App Store says you need to update "Twitter," the hacked app may be "Angry Birds" or something else entirely. Don't make any assumptions about which app you're looking for. To find it, you have to carry out a systematic search.
Triple-click anywhere in the line of text below on this page to select it:
kMDItemAppStoreHasReceipt=1
Copy the selected text to the Clipboard by pressing the key combination command-C.
In the Finder, press command-F to open a search window, or select
File ▹ Find
from the menu bar. In the search window, select
Search: This Mac
from the row of tokens below the toolbar. Below that is a popup menu initially showing Kind. From that menu, select Other...
A sheet will drop down. In that sheet, select Raw Query and click OK or press return.
Now there will be a text box to the right of popup menu. Click in that box and paste (command-V).
The search window will show all the App Store products you've installed. Compare those search results with the list of your purchases from the App Store. To see the complete list, you may need to unhide hidden purchases. If any apps were download from the App Store using other Apple ID accounts that you control, sign in to the store under each of those ID's and check the purchases.
At least one of the items listed in the search window is not among your purchases in the App Store. Move each such item to the Trash. You may be prompted for your administrator password. Empty the Trash.
Log out and log back in. Test. -
Javascript API and Bucket objects
Hello,
In the MapViewer User Guide 10.1.3.1 various types of Buckets are described. In the 10.1.3.1 Javascript API I just see the MVNumericRangedBucket. Because I have non numeric data, I need to create for instance a CollectionBucket. Is that not implemented in Javascript?
Regards<html>
<head>
$("#PlayerHolder").html("<span id='PlayerDiv'></span>");
x = x.replace(/&/g,'%26')
var flashvars = {};
flashvars.verbose="true";
flashvars.poster="http://"+server+"/thumbnails/thumb_"+x+".png";
flashvars.plugin_watermark="swfs/WatermarkPlugin.swf";
flashvars.watermark_namespace="http://osmf.realeyes.com/plugins/watermark";
flashvars.watermark_url="ct-vector_small4.png";
flashvars.watermark_vAlign="top";
flashvars.watermark_hAlign="right";
flashvars.key="hello";
flashvars.optimizeBuffering=false;
flashvars.bufferTime=5;
flashvars.urlIncludesFMSApplicationInstance=cloudfront;
var parameters = {};
if(rtmpt){
parameters.flashvars="src=rtmpt://"+server+"/recorder/s3/vid_"+x;
}else{
parameters.flashvars="src=rtmp://"+server+"/recorder/s3/vid_"+x;
parameters.allowscriptaccess="always";
parameters.wmode="direct";
parameters.allowfullscreen="true";
var attributes = {};
attributes.name="player";
attributes.id="player";
swfobject.embedSWF("StrobeMediaPlayback.swf?ID="+Math.random()*100,"PlayerDiv","470","320 ","11.2","scripts/expressInstall.swf", flashvars, parameters, attributes);
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
function doPlay(){
thisMovie("player").play2();
</script>
</head>
<body>
<input type="button" value="doPlay" onClick="doPlay()"/>
</body>
</html>
Try something like this. -
Linked Lists, Hashing, and sore heads.
I am working with a team on a java program as part of an algorithms assignment. We have completed the program however I'm convinced its not working. The program is supposed to carry out a defined number of searches, additionions and deletions to a linked list and time it. We have been supplied with a number of ext files with random numbers for testing purposes.
The text files are different sizes. We are finding that our results are the same regardless which file we use and which arguments are passed into the program. I would be greatful if someone could cast their eye over the work and let us know what you think.
All files are at
http://students.odl.qmul.ac.uk/~dm07/algorithms/.
IntSet.java is the program we have completed from a skeleton code.
Evaluator.java is the wrapper provided. data.zip is a full file of the
different test text files although there are two on here for quick download.
Any direction or feedback would be really appreciated.
Dermot.Here is the result for the 50 random numbers text file :
D:\Coursework\Algorithms>java Evaluator size-50-random.txt 10000
Setting up, please wait ...
Finished setting up.
Start searches
It took 0.010 seconds for 10000 searches
It took 0.020 seconds for 10000 additions
It took 0.010 seconds for 10000 deletions
And here is the result for hte 50000 random numbers text file :
D:\Coursework\Algorithms>java Evaluator size-50000-random.txt 10000
Setting up, please wait ...
Finished setting up.
Start searches
It took 0.010 seconds for 10000 searches
It took 0.020 seconds for 10000 additions
It took 0.000 seconds for 10000 deletions
As you can see they are virtually identical. Even after running a number of times and working out averages they are the same. I thought that the results should be exponential but they are not. I understand that results should change from pc setup to pc setup, depending on processor etc but we are not getting this.
Dermot. -
Help with supply and demand query using monthly buckets
I'm working on a query bound for Discoverer which pulls the aggregated supply and demand for an item and buckets it into months. So for any given item, I need to show the item, onhand, cost, aggregated supply (planned orders, requisitions, pos), and aggregated demand (planned order demand, jobs) - all bucketed by months.
The code below works okay to find all of the data for July, but I also need to show August and September. I'm thinking I could use a union but am reluctant because the query already runs kind of slow and I'm not sure if I'm on the right track.
Database Server
RDBMS : 10.2.0.3.0
Oracle Applications : 11.5.9
-Tracy
select
item.inventory_item_id, item.organization_code, item.item, item.description
, item.make_buy,item.planner_code
, planned.compile_designator, planned.order_type_text, sum(planned.quantity_rate)planned_total
, planned.mrp_sugg_due_month
, sum(job.required_quantity-job.quantity_issued)job_open, job.required_month
, onhand.total_qoh
, purchase.item_revision prev, purchase.promised_month, purchase.ship_to_organization_id
, sum((purchase.quantity-purchase.quantity_cancelled)-purchase.quantity_received)po_open
, req.item_revision rrev, req.destination_organization_id, req.org_id, req.need_by_month
, sum((req.quantity-req.quantity_cancelled)-req.quantity_delivered)req_open
, cost.item_cost,cost.cost
from
--item--
(select mtl.inventory_item_id, mtl.segment1 item,mtl.description,decode(mtl.planning_make_buy_code,1,'Make',2,'Buy') make_buy
,mtl.organization_id, mtp.organization_code, mtl.planner_code
,to_char(add_months(sysdate,+1),'YYYY_MM')month1, to_char(add_months(sysdate,+2),'YYYY_MM')month2
,to_char(add_months(sysdate,+3),'YYYY_MM')month3
from inv.mtl_system_items_b mtl, inv.mtl_parameters mtp
where mtl.organization_id = mtp.organization_id
)item,
--planned orders - 3 months --
(select compile_designator,organization_id,inventory_item_id,order_type_text,nvl(quantity_rate,0)quantity_rate,new_due_date
,to_char(trunc(new_due_date,'MM'),'YYYY_MM')mrp_sugg_due_month
from apps.mrp_orders_sc_v
where order_type_text in ('Planned order','Planned order demand')
and to_char(trunc(new_due_date,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
and to_char(trunc(new_due_date,'MM'),'YYYY_MM') >= to_char(:Month,'YYYY_MM')
)planned,
--jobs - 3 months--
(select organization_id,wip_entity_name job, inventory_item_id,concatenated_segments,nvl(required_quantity,0)required_quantity
,nvl(quantity_issued,0)quantity_issued, date_required,to_char(trunc(date_required,'MM'),'YYYY_MM') required_month
,wip_entity_id,creation_date, wip_job_status
from apps.wip_requirement_ops_inq_v
where primary_item_id <>inventory_item_id
and wip_job_status not in ('Closed','Cancelled','Complete')
and to_char(trunc(date_required,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
and to_char(trunc(date_required,'MM'),'YYYY_MM') >= to_char(:Month,'YYYY_MM')
)job,
--qty onhand--
(select inventory_item_id,organization_id,sum(nvl(transaction_quantity,0))total_qoh
from inv.mtl_onhand_quantities_detail
group by inventory_item_id, organization_id
)onhand,
-- po - 3 months--
(select pol.item_id, pol.item_revision, nvl(pll.quantity,0)quantity, nvl(pll.quantity_received,0)quantity_received
, nvl(pll.quantity_rejected,0),nvl(pll.quantity_cancelled,0)quantity_cancelled,poh.segment1 po_num
,pll.promised_date, to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')promised_month
,pll.shipment_num,pll.ship_to_organization_id
from po.po_lines_all pol, po.po_headers_all poh, po.po_line_locations_all pll
where poh.po_header_id = pol.po_header_id
and pol.po_header_id = pll.po_header_id
and pol.po_line_id = pll.po_line_id
and pol.cancel_flag != 'Y'
and pol.item_id is not null
and to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')<= to_char(add_months(:Month,+2),'YYYY_MM')
and to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')>= to_char(:Month,'YYYY_MM')
)purchase,
--reqs - 3 months--
(select prh.segment1 req_number,nvl(prl.quantity,0)quantity,nvl(prl.quantity_delivered,0)quantity_delivered
,nvl(prl.quantity_cancelled,0)quantity_cancelled
,prl.destination_organization_id,prl.org_id,prl.item_id,prl.item_revision,prl.need_by_date
,to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM')need_by_month
from po.po_requisition_headers_all prh, po.po_requisition_lines_all prl
where prh.requisition_header_id = prl.requisition_header_id(+)
and nvl(prl.cancel_flag,'N') !='Y'
and prh.authorization_status != 'CANCELLED'
and to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
and to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM') >= to_char(:Month,'YYYY_MM')
)req,
--cost--
(select msib.inventory_item_id,msib.organization_id,cqm.material_cost,cic.item_cost
,(case when cqm.material_cost=0 then cic.item_cost else cqm.material_cost end) cost, cqm.cost_group_id
from inv.mtl_system_items_b msib
,(select cql.cost_group_id,cql.inventory_item_id,cql.organization_id,cql.layer_quantity,cql.material_cost,mp.organization_code
from bom.cst_quantity_layers cql, inv.mtl_parameters mp
where mp.default_cost_group_id = cql.cost_group_id) cqm
,bom.cst_item_costs cic
where msib.inventory_item_id = cqm.inventory_item_id(+)
and msib.organization_id = cqm.organization_id(+)
and msib.inventory_item_id = cic.inventory_item_id(+)
and msib.organization_id = cic.organization_id(+)
)cost
where item.inventory_item_id = job.inventory_item_id(+)
and item.organization_id = job.organization_id(+)
and item.month1 = job.required_month(+) -- 2009_07 --
and item.inventory_item_id = onhand.inventory_item_id(+)
and item.organization_id = onhand.organization_id(+)
and item.inventory_item_id = purchase.item_id(+)
and item.month1 = purchase.promised_month(+) -- 2009_07 --
and item.inventory_item_id = req.item_id(+)
and item.month1 = req.need_by_month(+) -- 2009_07 --
and item.inventory_item_id = cost.inventory_item_id(+)
and item.organization_id = cost.organization_id(+)
and item.inventory_item_id = planned.inventory_item_id(+)
and item.organization_id = planned.organization_id(+)
and item.month1 = planned.mrp_sugg_due_month(+) -- 2009_07 --
and item.make_buy = 'Buy'
and item.item in ('161309040','744L755','150-GFM') --test items --
group by item.inventory_item_id,item.organization_code,item.item,item.description,item.make_buy,item.planner_code
,job.required_month ,onhand.total_qoh , purchase.item_revision, purchase.promised_month
,purchase.ship_to_organization_id ,cost.item_cost,cost.cost
,req.item_revision, req.destination_organization_id,req.org_id,req.need_by_month
,planned.compile_designator,planned.order_type_text,planned.mrp_sugg_due_month
order by item.organization_code,item.itemHi,
Six things:
(1) Where are the one-to-many relationships between your tables? If a single row in mtl can match two (or more) rows in mrp, and can also match two (or more) rows in wip, then it looks like, when you join both of them them, you'll have a chasm trap, that is, you'll get all the matching rows from mrp paired with all matching rows from wip. Are you sure your existing query is producing the right results?
Are there one-to-many relationships with the other tables in your original query?
(2) Are your DATEs always at midnight? If not, avoid using BETWEEN and LAST_DAY for DATE comparisons: otherwise you'll miss everything between 00:00:01 and 23:59:59 on the last day.
That is, instead of
and mrp.new_due_date(+) BETWEEN :Month AND LAST_DAY(ADD_MONTHS(:Month,2))ypou should say
and mrp.new_due_date (+) >= :Month
and mrp.new_due_date (+) < ADD_MONTHS (:Month, 3)(3) The basic way to pivot the months of mrp_due_date is:
SELECT ...
, NVL ( SUM ( CASE
WHEN mrp.new_due_date >= :month
AND mrp.new_due_date < ADD_MONTHS (:month, 1)
THEN mrp.quantity_rate
END
, 0
) AS mrp_qty_0
, NVL ( SUM ( CASE
WHEN mrp.new_due_date >= ADD_MONTHS (:month, 1)
AND mrp.new_due_date < ADD_MONTHS (:month, 2)
THEN mrp.quantity_rate
END
, 0
) AS mrp_qty_1When you do this, do not GROUP BY TRUNC (mrp.new_due_date, 'MM').
The code above does two months: I'm sure you get the idea for how to do more.
To get dynamic column headings (such as Jun_2009 or "2009-06" instead of the generic mrp_qty_o) requires dynamic SQL. The best way to do dynamic SQL depends on the tool that is producing the query (e.g. SQL*Plus). What are you using? Are you willing to change, if it helps?
(4) Displaying separate columns from one row as a single column on multiple rows is called unpivoting. How badly do you want to do that? Your query would be simpler and faster if the output had only one row per group (rather than one row for mrp_qty and another row for wip_wty). That one row could have six columns (e.q. June_mrp, June_wip, July_mrp, July_wip, August_mrp and August_wip) instead of three. Depending on your front-end tool, you might even be able to wrap the single row of output so that it always appeared as two rows, each with three columns.
(5) Sorry I told you to do
and mrp.order_type_text(+) in (...)I never use the + outer-join notation any more, so I forgot about the ORA-01719 error. There's no problem having an outer-join condition like that using ANSI notation. (One more reason to switch.)
(6) As you noticed, this site doesn't like to print the <> inequality operator, even inside tags.
Use the equivalent != operator instead, when posting on this site.
Maybe you are looking for
-
Is there a way of connecting the ipad to the smart board in the classroom, so that the smartboard is the control, and the ipad is displaying what is on the smartboard? This is to help a visually impaired child see what is on the smartboard.
-
Sending from Business workplace to External mail ID
Hi, Please Some help me on this issue am getting below error when am trying to send mail from Business Workplace to External Mail Cannot process message , no route from SAPUSER TO abc123 at gmail dot com I done configuration by refereeing below. Ple
-
Problem with printing in agenda
i will print a week in agenda. when i want tot do that the print starts with 'thuesday instead of monday. (irritating). is it a bug? (it wasn't that way before updating to yosemite. )
-
Connecting yamaha psr-292 to my iMac for midi
I have never worked with midi or GarageBand and I want to start. I have an old Yamaha PSR-292 keyboard with a 6-pin MIDI-IN port and a 6-pin MIDI-OUT port. My iMac has three USB ports. I'm at the beginning of this and just trying to figure out how to
-
.mac account shows multiple 'welcome' sites.. all point to same html
I was just toying with iWeb 08 and I published several different welcome.html files, however when I log into the web .mac manager it shows 4 different ones under 'my sites', even though they are identical. How do I remove them so I only see the one/