Please convert this query to update.
Hi Experts,
Please convert this MERGE statment to UPDATE.
MERGE INTO CUSTOMER_DTLS CDT
USING
SELECT CDT.CDT_ID, CDT.CDT_ITEMREQ_NO, CDT_UNIT_NO, CDT.CDT_UPDATE_DT, OST.SalesName, OST.Team, OST.Team_ID
FROM CUSTOMER_DTLS CDT
INNER JOIN REVEN_MAP RMP ON CDT.CDT_ID = RMP.ORG_ID
INNER JOIN SALES_DTLS OST ON RMP.WB_IBU = OST.IBU AND OST.Rep_Code = CDT.CDT_SECSALESREP
WHERE CDT.PRODUCT_SEC = 'M'
AND CDT.CDT_ID = 600
) SALES_QUERY
ON(
CDT.CDT_ID = SALES_QUERY.CDT_ID
AND CDT.CDT_ITEMREQ_NO = SALES_QUERY.CDT_ITEMREQ_NO
AND CDT.CDT_UNIT_NO = SALES_QUERY.CDT_UNIT_NO
AND CDT.CDT_UPDATE_DT = SALES_QUERY.CDT_UPDATE_DT
AND CDT.PRODUCT_SEC = 'M'
WHEN MATCHED THEN
UPDATE SET CDT.CDT_SALES_REP = SALES_QUERY.SalesName,
CDT.CDT_OutSide_SALES_DTLS = SALES_QUERY.Team,
CDT.CDT_OutSide_Team_ID = SALES_QUERY.Team_ID
WHERE CDT.CDT_SALES_REP IS NULL
AND CDT.PRODUCT_SEC = 'M'
AND CDT.CDT_ID = 600;
Please help me.
Thanks.
Hi All,
The merge query first doing join and make it as a SALES_QUERY query.
SELECT CDT.CDT_ID, CDT.CDT_ITEMREQ_NO, CDT_UNIT_NO, CDT.CDT_UPDATE_DT, OST.SalesName, OST.Team, OST.Team_ID
FROM CUSTOMER_DTLS CDT
INNER JOIN REVEN_MAP RMP ON CDT.CDT_ID = RMP.ORG_ID
INNER JOIN SALES_DTLS OST ON RMP.WB_IBU = OST.IBU AND OST.Rep_Code = CDT.CDT_SECSALESREP
WHERE CDT.PRODUCT_SEC = 'M'
AND CDT.CDT_ID = 600
) SALES_QUERY
On top of it using the result of SALES_QUERY checking the following matching.
ON(
CDT.CDT_ID = SALES_QUERY.CDT_ID
AND CDT.CDT_ITEMREQ_NO = SALES_QUERY.CDT_ITEMREQ_NO
AND CDT.CDT_UNIT_NO = SALES_QUERY.CDT_UNIT_NO
AND CDT.CDT_UPDATE_DT = SALES_QUERY.CDT_UPDATE_DT
AND CDT.PRODUCT_SEC = 'M'
But in your update it's just joining and after that not used any of these values for comparison.
CDT.CDT_ID, CDT.CDT_ITEMREQ_NO, CDT_UNIT_NO, CDT.CDT_UPDATE_DT, OST.SalesName, OST.Team, OST.Team_ID
How this works.
Please explain.
Thanks.
Similar Messages
-
Please convert this query to UPDATE query.
Hi Experts,
Hello 976208
You can update the columns only in the table which is assigned to the MERGE INTO keywords. -> In this case only in the WEB_SALE_EMP Table.
There is a possibility that you can update / Insert complex codes if and only if this is created as a VIEW!
So, in this case, because you do not have any view on the two tables ( WEB_SALE_EMP and WEB_DELIVERY WD ) you can only update the WEB_SALE_EMP table.
MERGE INTO WEB_SALE_EMP WE
USING
SELECT
WBE.SHIPNT_ID SHIPNT_ID, WBE.SHIPNT_SRC SHIPNT_SRC, WBE.WB_ID WB_ID, WBE.SHIPNO SHIPNO, WBE.TAG_NO TAG_NO,
CAST(COALESCE(WD.VALUE,'0') AS NUMBER) WB_VAL,
SUM(WBE.REV * WBE.AMOUNT) AS Sum_Rev
FROM WEB_SALE_EMP WBE
INNER JOIN WEB_DELIVERY WD ON (WBE.WB_ID = WD.PG_ID AND WD.OPERATION = 'DISCOUNT')
WHERE SHIPMNT_TYPE ='AIR_DISPATCH'
AND WB_ID = p_PG_ID
AND SHIPNT_ID = 2
AND DESCP IS NOT NULL
AND SALE_CODE IS NOT NULL
AND UNIT IS NOT NULL
GROUP BY SHIPNT_ID, SHIPNT_SRC, WB_ID, SHIPNO, TAG_NO,
CAST(COALESCE(WD.VALUE,'0') AS NUMBER)
HAVING SUM(WBE.REV * WBE.AMOUNT) > CAST(COALESCE(WD.VALUE,'0') AS NUMBER)
)v
ON( we.SHIPNT_ID = v.SHIPNT_ID
AND we.SHIPNT_SRC = v.SHIPNT_SRC
AND we.WB_ID = v.WB_ID
AND we.SHIPNO = v.SHIPNO
AND we.TAG_NO = v.TAG_NO
WHEN MATCHED THEN
UPDATE SET we.DELIVERY_TYPE = 'AIR'
WHERE DESCP IS NOT NULL
AND SALE_CODE IS NOT NULL
AND UNIT IS NOT NULL
AND we.WB_ID = 9
AND we.SHIPNT_ID = 3;
Without these columns should your sql works.
I hope this helps you.
Regards,
David
IMPORTANT: Please use always QUALIFIED Column-names in a complex sql code! (Example: wb_id = ... is bad! -> Good: TABLE_ALIAS.wb_id = .... !) -
Trying to convert SELECT query to Update query with INNER JOINS
Assalam O Alaikum!
I've tried to convert this query of mine but failed.
I wish to use it for update datasource in data GridView. I'm fetching data with it but converting it to update is not helping giving multiple errors.
I tried to share the pic but they don't let me do so. Its actually a gridView with check boxes. check the item and update it..
Here is the query. Please help me with that.
<pre>
SELECT [rightsId], [saveRights], [updateRights],
[viewRights], [deleteRights], [printRights],
[processRights], [verifyRights], [unProcessRights],
[unVerifyRights], CONVERT(VARCHAR(100),tblGroup.groupId)as groupId, convert(varchar(100),tblmenu.[menuId])as menuid
FROM [tblRights] inner join tblMenu ON
tblMenu.menuId=tblRights.menuId INNER JOIN
tblGroup ON tblGroup.groupId=tblRights.rightsId
</pre>code is fine the above query works fine with the fetching(select) but when I try to write it with update it doesn't. Here is the asp code. I'm doing nothing with c# or vb.
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
DataSourceID="ratGrid" AutoGenerateColumns="False"
CssClass="GridViewStyle" Width="100%" AllowSorting="True" AutoGenerateEditButton="True" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2">
<Columns>
<asp:BoundField DataField="rightsId" HeaderText="rightsId" ItemStyle-Width="75px" SortExpression="rightsId" Visible="False">
<ItemStyle Width="75px" />
</asp:BoundField>
<asp:CheckBoxField DataField="saveRights" HeaderText="Save" SortExpression="saveRights" />
<asp:CheckBoxField DataField="updateRights" HeaderText="Update" SortExpression="updateRights" />
<asp:CheckBoxField DataField="viewRights" HeaderText="View" SortExpression="viewRights" />
<asp:CheckBoxField DataField="deleteRights" HeaderText="Delete" SortExpression="deleteRights" />
<asp:CheckBoxField DataField="printRights" HeaderText="Print" SortExpression="printRights" />
<asp:CheckBoxField DataField="processRights" HeaderText="Process" SortExpression="processRights" />
<asp:CheckBoxField DataField="verifyRights" HeaderText="Verify" SortExpression="verifyRights" />
<asp:CheckBoxField DataField="unProcessRights" HeaderText="UnProcess" SortExpression="unProcessRights" />
<asp:CheckBoxField DataField="unVerifyRights" HeaderText="UnVerify" SortExpression="unVerifyRights" />
<asp:BoundField DataField="groupId" HeaderText="groupId" ReadOnly="True" SortExpression="groupId" Visible="False" />
<asp:BoundField DataField="menuid" HeaderText="menuid" SortExpression="menuid" ReadOnly="True" Visible="False" />
</Columns>
<RowStyle CssClass="RowStyle" BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle CssClass="PagerStyle" ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle CssClass="SelectedRowStyle" BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle CssClass="HeaderStyle" BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle CssClass="AltRowStyle" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="ratGrid"
runat="server"
ConnectionString="<%$ ConnectionStrings:Conn_Str %>"
SelectCommand="SELECT [rightsId], [saveRights], [updateRights],
[viewRights], [deleteRights], [printRights],
[processRights], [verifyRights], [unProcessRights],
[unVerifyRights], CONVERT(VARCHAR(100),tblGroup.groupId)as groupId, convert(varchar(100),tblmenu.[menuId])as menuid
FROM [tblRights] inner join tblMenu ON
tblMenu.menuId=tblRights.menuId INNER JOIN
tblGroup ON tblGroup.groupId=tblRights.rightsId"
FilterExpression="menuId like '{0}%' and [groupId] like '{1}%'" >
<FilterParameters>
<asp:ControlParameter ControlID="ddlmenu" Name="menu"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddlgroup" Name="Country"
PropertyName="SelectedValue" Type="String" />
</FilterParameters>
</asp:SqlDataSource>
Your table needs key(s) and you need to assign the key as DataKeys property for the GridView to make your UpDate and Delete work without coding. -
Please convert decode query to case expression
Please convert decode query to case expression
Decode(Sign(id), 1, id, null) positive, Decode(Sign(id), -1, id, null) negative from dual;this is a serious forums that help people, if you want that we do your "homeworks" i must told you that you should pay us for that.
Edited by: Fran on 05-jun-2013 23:41
1002966
Handle: 1002966
Status Level: Newbie
Registered: Apr 28, 2013
Total Posts: 20
Total Questions: 12 (12 unresolved) -
Please show this query, data not showing why?
I created a report and write following query,it was working well since last 4 months but today automaticly not showing data I can undertstand why?
Becuase I didnt make any changes in this query.
Please help me
Urgent
SELECT ALL MERCH_ORDER.ORDERNO, MERCH_ORDER.ORDERDATE, MERCH_ORDER.SHIP_DATE, MERCH_ORDER.PONO,
MERCH_ORDER.SUBPP, MERCH_ORDER.PJNO, BUYER.B_NAME, BUYER.B_AJENT,
MERCH_ORDER.ITEM, MERCH_ORDER.FABRIC, MERCH_ORDER.QUALITY, MERCH_ORDER.COMPOSITION,
MERCH_ORDER.P_SIZE, MERCH_ORDER.QUANTITY, MERCH_ORDER.Q_UNIT,
MERCH_ORDER.NETWHT, MERCH_ORDER.WT_UNIT, MERCH_ORDER.TERM, MERCH_ORDER.COMM,
MERCH_ORDER.PRICE, MERCH_ORDER.CUR_SYMB, MERCH_ORDER.STATUS, MERCH_ORDER.REMARKS,
MERCH_ORDER.WONO, MERCH_ORDER.PRONO, MERCH_ORDER.PES_QUANTITY,
MERCH_ORDER.PES_Q_UNIT, MERCH_ORDER.PES_PRICE, MERCH_ORDER.PES_CUR_SYMB
FROM BUYER, MERCH_ORDER
WHERE MERCH_ORDER.CANCEL IS NULL
AND (MERCH_ORDER.B_CODE = BUYER.B_CODE)
and merch_order.orderno not in
(select export_order1.orderno from export_order1)
ORDER BY MERCH_ORDER.ORDERNO
there is no any error and msg header and footer print.Maybe , the query in "NOT IN" clause select export_order1.orderno from export_order1
return the same rows as the following portion return....
SELECT ALL MERCH_ORDER.ORDERNO, MERCH_ORDER.ORDERDATE, MERCH_ORDER.SHIP_DATE, MERCH_ORDER.PONO,
MERCH_ORDER.SUBPP, MERCH_ORDER.PJNO, BUYER.B_NAME, BUYER.B_AJENT,
MERCH_ORDER.ITEM, MERCH_ORDER.FABRIC, MERCH_ORDER.QUALITY, MERCH_ORDER.COMPOSITION,
MERCH_ORDER.P_SIZE, MERCH_ORDER.QUANTITY, MERCH_ORDER.Q_UNIT,
MERCH_ORDER.NETWHT, MERCH_ORDER.WT_UNIT, MERCH_ORDER.TERM, MERCH_ORDER.COMM,
MERCH_ORDER.PRICE, MERCH_ORDER.CUR_SYMB, MERCH_ORDER.STATUS, MERCH_ORDER.REMARKS,
MERCH_ORDER.WONO, MERCH_ORDER.PRONO, MERCH_ORDER.PES_QUANTITY,
MERCH_ORDER.PES_Q_UNIT, MERCH_ORDER.PES_PRICE, MERCH_ORDER.PES_CUR_SYMB
FROM BUYER, MERCH_ORDER
WHERE MERCH_ORDER.CANCEL IS NULL
AND (MERCH_ORDER.B_CODE = BUYER.B_CODE)
OR
there are no rows which conform to the joining condition between the two tables BUYER and MERCH_ORDER ....
Regards,
Simon -
Please tune this query.
Hi Experts,
My below query is taking long time.
[code]SELECT FAX_LIST.*
FROM (SELECT /*+ use_nl(fax, src) */
ROW_NUMBER () OVER (ORDER BY fax.ID ASC NULLS FIRST) RN,
fax.ACCOUNT_TYPE,
fax.BU_FILE_LOCATION,
fax.COUNT_PAGES_RECEIVED,
NVL (fax.CUSTOMER_NAME, fax.SENDER_NAME) AS CUSTOMER_NAME,
fax.FAX_SOURCE,
fax.CUSTOMER_NUMBER,
fax.CUSTOMER_OMEGA_NUMBER,
fax.GENIFAX_RECIPIENT_ID,
fax.ID AS FAX_ID,
fax.DATE_RECEIVED AS FAX_RECEIVED,
fax.IS_LOCKED,
fax.LOCKED_BY,
fax.ORIGINATOR_CSI,
fax.MARGIN,
fax.PAYMENT_TYPE,
fax.PRIORITY_CODE,
fax.PRIORITY_VALUE,
FROM_TZ (fax.DATE_RECEIVED, 'UTC')
AT TIME ZONE fax.LOCAL_TZ_NAME
AS DATE_RECEIVED,
fax.SALES_PERSON,
fax.SENDER_EMAIL,
fax.SENDER_NAME,
fax.SUBJECT,
fax.WORKGROUP_ID,
fax.LOCKED_TIME,
src.DESCRIPTION,
src.FAX_NUMBER,
src.WORKFLOW_ID,
fax.CREATED_BY,
fax.CREATED_DATE,
fax.UPDATE_DATE,
fax.UPDATED_BY,
fax.RESERVED_BY,
fax.PRICE_TO_ORDER,
fax.SKU_COUNT_TO_ORDER,
NVL (ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).CHANGED_BY,
CASE
WHEN fax.LAST_TRANSITION_ID IS NULL
AND fax.GENIFAX_RECIPIENT_ID IS NOT NULL
THEN
'ORL FEEDER'
ELSE
'Admin'
END)
AS LAST_USER,
FROM_TZ (
NVL (ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).CHANGED_DATE,
fax.DATE_RECEIVED),
'UTC')
AT TIME ZONE fax.LOCAL_TZ_NAME
AS MOVE_DATETIME,
NVL (ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).REASON,
'Reroute')
AS MOVE_REASON,
NVL (
(SELECT fw.DESCRIPTION
FROM ORL.WORKGROUP_TRANSITION wt, ORL.WORKGROUP fw
WHERE wt.ID =
ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).WORKGROUP_TRANSITION_ID
AND fw.ID = wt.CURRENT_WORKGROUP_ID),
CASE
WHEN fax.LAST_TRANSITION_ID IS NULL
AND fax.GENIFAX_RECIPIENT_ID IS NOT NULL
THEN
'ORL FEEDER STAGING'
ELSE
'N/A'
END)
AS OLD_STATUS,
(SELECT MAX (PURCHASE_ORDER_NUMBER)
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID)
AS MAXPO,
(SELECT CASE COUNT (PURCHASE_ORDER_NUMBER)
WHEN 0 THEN NULL
ELSE COUNT (PURCHASE_ORDER_NUMBER)
END
AS POCOUNT
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID)
AS POCOUNT,
(SELECT SUM (VALUE) AS ORDER_VALUE
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID)
AS ORDER_VALUE,
fax.SALESPERSON_NAME,
fax.GROUP_NAME,
fax.ROLE_NAME,
fax.EMAIL,
fax.SALES_CHANNEL
FROM (SELECT fax.*,
map.ORACLE_TZ_NAME AS LOCAL_TZ_NAME,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).SALESPERSON_NAME
AS SALESPERSON_NAME,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).GROUP_NAME
AS GROUP_NAME,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).ROLE_NAME
AS ROLE_NAME,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).EMAIL
AS EMAIL,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).SALES_CHANNEL
AS SALES_CHANNEL
FROM APPS_GLOBAL.GLOBAL_BU_MAPPING map,
(SELECT *
FROM ORL.FAX_HEADER FH
WHERE FH.WORKGROUP_ID = 262) fax
WHERE map.GEDIS = 'Y'
AND map.BU_ID = (SELECT BUID
FROM ORL.WORKGROUP
WHERE ID = fax.WORKGROUP_ID)
AND ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).SALESPERSON_NAME =
'A_CARRICK') fax,
(SELECT *
FROM ORL.FAX_SOURCE FS
WHERE FS.WORKFLOW_ID IN
(SELECT /*+ CARDINALITY(t, 1) */
TO_NUMBER (
COLUMN_VALUE)
AS COLUMN_VALUE
FROM TABLE (
SplitClob ('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98', ',')) t)) src
WHERE src.ID(+) = fax.FAX_SOURCE) FAX_LIST
WHERE RN BETWEEN 1 AND 100
ORDER BY RN ASC;[/code]
In my query the following three functions are using.
ORL.GET_FTH_WTR
ORL.GET_SALESPERSON
APPS_GLOBAL.SplitClob
[code]CREATE OR REPLACE FUNCTION ORL.GET_FTH_WTR(p_LAST_TRANSITION_ID NUMBER)
RETURN ORL.FTH_WTR_T
DETERMINISTIC
IS
v_REASON nvarchar2(1024 char);
v_WORKGROUP_TRANSITION_ID number;
v_CHANGED_BY nvarchar2(64 char);
v_CHANGED_DATE timestamp(6);
BEGIN
SELECT
WTR.REASON,
wtr.WORKGROUP_TRANSITION_ID,
fth.CHANGED_BY,
fth.CHANGED_DATE
INTO
v_REASON,
v_WORKGROUP_TRANSITION_ID,
v_CHANGED_BY,
v_CHANGED_DATE
FROM
ORL.FAX_TRANSITION_HISTORY fth,
ORL.WORKGROUP_TRANSITION_REASON wtr
WHERE
fth.ID = p_LAST_TRANSITION_ID
AND wtr.ID(+) = fth.TRANSITION_REASON_ID;
RETURN ORL.FTH_WTR_T(v_CHANGED_BY, v_CHANGED_DATE, v_REASON, v_WORKGROUP_TRANSITION_ID);
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN ORL.FTH_WTR_T(NULL, NULL, NULL, NULL);
END GET_FTH_WTR;
CREATE OR REPLACE function ORL.GET_SALESPERSON(ORG_ID number, SALESPERSON_ID number)
return ORL.SALESPERSON_T
deterministic
is
apps_bu varchar2(30);
salesperson_name varchar2(150 char);
email varchar2(70 char);
sales_channel varchar2(60 char);
role_name varchar2(60 char);
group_name varchar2(60 char);
begin
select OWNER_NAME into apps_bu
from APPS_GLOBAL.GLOBAL_BU_MAPPING
where ORG_ID = GET_SALESPERSON.ORG_ID;
execute immediate
replace('
select SALESPERSON_NAME
, EMAIL
, SALES_CHANNEL
, ROLE_NAME
, GROUP_NAME
from APPS_**.ORL_ACTIVE_SALESPERSON
where SALESPERSON_ID = :1
and rownum = 1
', 'APPS_**', apps_bu)
into salesperson_name, email, sales_channel, role_name, group_name
using SALESPERSON_ID;
return SALESPERSON_T(ORG_ID, SALESPERSON_ID, salesperson_name, email, sales_channel, role_name, group_name);
exception
when no_data_found then
return SALESPERSON_T(null, null, null, null, null, null, null);
end GET_SALESPERSON;
CREATE OR REPLACE function APPS_GLOBAL.SplitClob
p_clob clob
, p_delimiter varchar2 := ','
return StringTable
deterministic
pipelined
as
v_current_pos pls_integer := 1;
v_delimiter_pos pls_integer;
begin
if (p_clob is not NULL) and (p_delimiter is not NULL) then
while v_current_pos <= length(p_clob) loop
v_delimiter_pos := instr(p_clob, p_delimiter, v_current_pos);
if v_delimiter_pos < 1 then -- no more delimiters
v_delimiter_pos := length(p_clob) + 1;
end if;
pipe row( to_char( substr(p_clob,
v_current_pos,
v_delimiter_pos - v_current_pos) ) );
v_current_pos := v_delimiter_pos + length(p_delimiter);
end loop;
end if;
end SplitClob;
CREATE OR REPLACE TYPE SALESPERSON_T AS OBJECT
SALESPERSON_ID number(15)
, SALESPERSON_NUMBER varchar2(150 char)
, FIRST_NAME varchar2(20 char)
, LAST_NAME varchar2(40 char)
, SALES_CHANNEL varchar2(60 char)
, ORG_ID number(15)
, USER_NAME varchar2(61 char)
, EFFECTIVE_START_DATE date
, EFFECTIVE_END_DATE date
, STATUS_FLAG varchar2(1 char)
, EMAIL varchar2(70 char)
, WORK_TELEPHONE varchar2(60 char)
, MANAGERS_NAME varchar2(50 char)
, FAX_NO varchar2(60 char)
, SALESPERSON_NAME varchar2(30 char)
, TERRITORY varchar2(40 char)
, FO_LOGON varchar2(150 char)
, BO_LOGON varchar2(150 char)
, SUB_CHANNEL varchar2(25 char)
, BUSINESS_SEGMENT varchar2(3 char)
, DISCOUNT_NAME varchar2(30 char)
, RESPONSIBILITY_ID number
, RESPONSIBILITY_KEY varchar2(30 char)
CREATE OR REPLACE TYPE STRINGTABLE as table of varchar2(4000);[/code]
The total number of records in each table.
[code]SELECT COUNT(*) FROM ORL.FAX_HEADER FH --4397829
SELECT COUNT(*) FROM APPS_GLOBAL.GLOBAL_BU_MAPPING map --31
SELECT COUNT(*) FROM ORL.WORKGROUP_TRANSITION --6735
SELECT COUNT(*) FROM ORL.WORKGROUP fw --1495
SELECT COUNT(*) FROM ORL.FAX_OFFER_DETAIL --5904039
SELECT COUNT(*) FROM ORL.FAX_SOURCE--2368 --2457[/code]
Indexes on the columns.
[code]ORL.WORKGROUP_TRANSITION(ID),
ORL.WORKGROUP(ID),
ORL.FAX_OFFER_DETAIL(FAX_ID),
ORL.FAX_HEADER(WORKGROUP_ID).[/code]
Please help me to tune this query.
Thanks in advance.Hi,
Thanks for your reply.
For split the numbers into different rows , we are sending randomly.
It's not constant numbers.We have used bind variables.
For testing purpose I have hard coded the values.
How to do this split without using user defined function.
I am sending the actual query along with execution plan without any hints.
[code]SELECT FAX_LIST.*
FROM (SELECT ROW_NUMBER () OVER (ORDER BY fax.ID ASC) RN,
fax.ACCOUNT_TYPE,
fax.BU_FILE_LOCATION,
fax.COUNT_PAGES_RECEIVED,
NVL (fax.CUSTOMER_NAME, fax.SENDER_NAME) AS CUSTOMER_NAME,
fax.FAX_SOURCE,
fax.CUSTOMER_NUMBER,
fax.CUSTOMER_OMEGA_NUMBER,
fax.GENIFAX_RECIPIENT_ID,
fax.ID AS FAX_ID,
fax.DATE_RECEIVED AS FAX_RECEIVED,
fax.IS_LOCKED,
fax.LOCKED_BY,
fax.ORIGINATOR_CSI,
fax.MARGIN,
fax.PAYMENT_TYPE,
fax.PRIORITY_CODE,
fax.PRIORITY_VALUE,
FROM_TZ (fax.DATE_RECEIVED, 'UTC') AT TIME ZONE map.ORACLE_TZ_NAME AS DATE_RECEIVED,
fax.SALES_PERSON,
fax.SENDER_EMAIL,
fax.SENDER_NAME,
fax.SUBJECT,
fax.WORKGROUP_ID,
fax.LOCKED_TIME,
src.DESCRIPTION,
src.FAX_NUMBER,
src.WORKFLOW_ID,
fax.CREATED_BY,
fax.CREATED_DATE,
fax.UPDATE_DATE,
fax.UPDATED_BY,
fax.RESERVED_BY,
fax.PRICE_TO_ORDER,
fax.SKU_COUNT_TO_ORDER,
NVL (
ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).CHANGED_BY,
CASE
WHEN fax.LAST_TRANSITION_ID IS NULL
AND fax.GENIFAX_RECIPIENT_ID IS NOT NULL
THEN
'ORL FEEDER'
ELSE
'Admin'
END
AS LAST_USER,
FROM_TZ (NVL (ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).CHANGED_DATE,fax.DATE_RECEIVED),'UTC')
AT TIME ZONE map.ORACLE_TZ_NAME AS MOVE_DATETIME,
NVL (ORL.GET_FTH_WTR (fax.LAST_TRANSITION_ID).REASON,'Reroute')AS MOVE_REASON,
NVL ((SELECT fw.DESCRIPTION
FROM ORL.WORKGROUP_TRANSITION wt, ORL.WORKGROUP fw
WHERE wt.ID =
ORL.GET_FTH_WTR (
fax.LAST_TRANSITION_ID
).WORKGROUP_TRANSITION_ID
AND fw.ID = wt.CURRENT_WORKGROUP_ID),
CASE
WHEN fax.LAST_TRANSITION_ID IS NULL
AND fax.GENIFAX_RECIPIENT_ID IS NOT NULL
THEN
'ORL FEEDER STAGING'
ELSE
'N/A'
END
AS OLD_STATUS,
(SELECT MAX (PURCHASE_ORDER_NUMBER)
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID)
AS MAXPO,
(SELECT CASE COUNT (PURCHASE_ORDER_NUMBER)
WHEN 0 THEN NULL
ELSE COUNT (PURCHASE_ORDER_NUMBER)
END
AS POCOUNT
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID)
AS POCOUNT,
(SELECT SUM (VALUE) AS ORDER_VALUE
FROM ORL.FAX_OFFER_DETAIL
WHERE FAX_ID = fax.ID) AS ORDER_VALUE,
ORL.GET_SALESPERSON (map.ORG_ID,fax.SALES_PERSON).SALESPERSON_NAME AS SALESPERSON_NAME,
ORL.GET_SALESPERSON (map.ORG_ID,fax.SALES_PERSON).GROUP_NAME AS GROUP_NAME,
ORL.GET_SALESPERSON (map.ORG_ID,fax.SALES_PERSON).ROLE_NAME AS ROLE_NAME,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).EMAIL AS EMAIL,
ORL.GET_SALESPERSON (map.ORG_ID, fax.SALES_PERSON).SALES_CHANNEL AS SALES_CHANNEL
FROM ORL.FAX_HEADER fax,
APPS_GLOBAL.GLOBAL_BU_MAPPING map,
ORL.FAX_SOURCE src
WHERE fax.WORKGROUP_ID = :WORKGROUP_ID
AND map.GEDIS = 'Y'
AND map.BU_ID = (SELECT BUID
FROM ORL.WORKGROUP
WHERE ID = fax.WORKGROUP_ID)
AND ORL.GET_SALESPERSON (map.ORG_ID,fax.SALES_PERSON).GROUP_NAME =:SALES_TEAM
AND ORL.GET_SALESPERSON (map.ORG_ID,fax.SALES_PERSON
).SALESPERSON_NAME = :SALESPERSON_NAME
AND src.WORKFLOW_ID IN
(SELECT TO_NUMBER (COLUMN_VALUE) AS COLUMN_VALUE
FROM table(SplitClob (:WORKFLOW_ID,:WORKFLOW_ID_delim)) t)
AND src.ID(+) = fax.FAX_SOURCE) FAX_LIST
WHERE RN BETWEEN 1 AND 100;
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 2 | 12092 | 88923 (1)|
| 1 | NESTED LOOPS | | 1 | 38 | 3 (0)|
| 2 | TABLE ACCESS BY INDEX ROWID | WORKGROUP_TRANSITION | 1 | 9 | 2 (0)|
| 3 | INDEX UNIQUE SCAN | PK_WORKGROUP_TRANSITION | 1 | | 1 (0)|
| 4 | TABLE ACCESS BY INDEX ROWID | WORKGROUP | 1482 | 42978 | 1 (0)|
| 5 | INDEX UNIQUE SCAN | PK_WORKGROUP | 1 | | 0 (0)|
| 6 | SORT AGGREGATE | | 1 | 16 | |
| 7 | TABLE ACCESS BY INDEX ROWID | FAX_OFFER_DETAIL | 1 | 16 | 5 (0)|
| 8 | INDEX RANGE SCAN | FAX_OFFER_DETAIL_IDX1 | 1 | | 3 (0)|
| 9 | SORT AGGREGATE | | 1 | 16 | |
| 10 | TABLE ACCESS BY INDEX ROWID | FAX_OFFER_DETAIL | 1 | 16 | 5 (0)|
| 11 | INDEX RANGE SCAN | FAX_OFFER_DETAIL_IDX1 | 1 | | 3 (0)|
| 12 | SORT AGGREGATE | | 1 | 11 | |
| 13 | TABLE ACCESS BY INDEX ROWID | FAX_OFFER_DETAIL | 1 | 11 | 5 (0)|
| 14 | INDEX RANGE SCAN | FAX_OFFER_DETAIL_IDX1 | 1 | | 3 (0)|
| 15 | VIEW | | 2 | 12092 | 88923 (1)|
| 16 | WINDOW SORT PUSHED RANK | | 2 | 1378 | 88923 (1)|
| 17 | NESTED LOOPS | | | | |
| 18 | NESTED LOOPS | | 2 | 1378 | 88920 (1)|
| 19 | NESTED LOOPS | | 18420 | 11M| 70490 (1)|
| 20 | HASH JOIN RIGHT SEMI | | 69 | 3657 | 49 (3)|
| 21 | COLLECTION ITERATOR PICKLER FETCH| SPLITCLOB | 8168 | 16336 | 29 (0)|
| 22 | TABLE ACCESS FULL | FAX_SOURCE | 2409 | 119K| 19 (0)|
| 23 | TABLE ACCESS BY INDEX ROWID | FAX_HEADER | 268 | 160K| 2854 (1)|
| 24 | INDEX RANGE SCAN | FAX_HEADER_FS_IDX | 4345 | | 7 (0)|
| 25 | INDEX RANGE SCAN | GLOBAL_BU_MAPPING_BUID | 1 | | 0 (0)|
| 26 | TABLE ACCESS BY INDEX ROWID | WORKGROUP | 1 | 8 | 2 (0)|
| 27 | INDEX UNIQUE SCAN | PK_WORKGROUP | 1 | | 1 (0)|
| 28 | TABLE ACCESS BY INDEX ROWID | GLOBAL_BU_MAPPING | 1 | 24 | 1 (0)|
Note
- 'PLAN_TABLE' is old version
Statistics
894400 recursive calls
60 db block gets
7402741 consistent gets
0 physical reads
0 redo size
46309 bytes sent via SQL*Net to client
430 bytes received via SQL*Net from client
8 SQL*Net roundtrips to/from client
848304 sorts (memory)
0 sorts (disk)
100 rows processed[/code]
Please help me.
Thanks in advance. -
Please see this query, not showing data Why?
I created a report and write following query,it was working well since last 4 months but today automaticly not showing data I can undertstand why?
Becuase I didnt make any changes in this query.
Please help me
Urgent
SELECT ALL MERCH_ORDER.ORDERNO, MERCH_ORDER.ORDERDATE, MERCH_ORDER.SHIP_DATE, MERCH_ORDER.PONO,
MERCH_ORDER.SUBPP, MERCH_ORDER.PJNO, BUYER.B_NAME, BUYER.B_AJENT,
MERCH_ORDER.ITEM, MERCH_ORDER.FABRIC, MERCH_ORDER.QUALITY, MERCH_ORDER.COMPOSITION,
MERCH_ORDER.P_SIZE, MERCH_ORDER.QUANTITY, MERCH_ORDER.Q_UNIT,
MERCH_ORDER.NETWHT, MERCH_ORDER.WT_UNIT, MERCH_ORDER.TERM, MERCH_ORDER.COMM,
MERCH_ORDER.PRICE, MERCH_ORDER.CUR_SYMB, MERCH_ORDER.STATUS, MERCH_ORDER.REMARKS,
MERCH_ORDER.WONO, MERCH_ORDER.PRONO, MERCH_ORDER.PES_QUANTITY,
MERCH_ORDER.PES_Q_UNIT, MERCH_ORDER.PES_PRICE, MERCH_ORDER.PES_CUR_SYMB
FROM BUYER, MERCH_ORDER
WHERE MERCH_ORDER.CANCEL IS NULL
AND (MERCH_ORDER.B_CODE = BUYER.B_CODE)
and merch_order.orderno not in
(select export_order1.orderno from export_order1)
ORDER BY MERCH_ORDER.ORDERNOWhere "first table" is merch_order and "second table" is export_order1?
How many distinct orders are in each table?
Are there any NULL order numbers in either table?
I'd put money on the fact that if commenting out a clause causes a number of rows to be returned, that clause is filtering out all the rows. You'll need to go through your data to figure out why the NOT IN clause is filtering out all your rows.
Justin -
Please find this query very urgent
Query-->select value from mytable where value is not null
union all
select value from mytable where value is null
Ex: table name::mytable
In this table i have one column called 'value' and this column values shold be like this
12
null
13
null
11
null
....i executed above query the result will be like this
12
13
11
null
null
null
the above query executes on the table it's effect only one column result
but i need multiple columns to be effected same as above one only....Anyone please help me on it and give the query.I have a table..MyTable(value number(10))
select * from Mytable;value
12
null
13
null
11
null
This is the table i have and the records i have...... and i need output like this
value
12
13
11
null
null
null ..............>ike this i need output for this i use this query i.e
Query-->select value from mytable where value is not null
union all
select value from mytable where value is null
------------>and this query gives only one column result i need multiple results like below: i have table with 2 columns like below
MyTable2(value1 number(10),value2 number(10))
select * fromMyTable2value1 value2
111 null
null 201
112 null
null 200
110 null
this is the table i have......... and i need output like below
value1 value2
111 201
112 200
110 null
null null
null null
NOTE:: If we use ORDER BY table records order must change, i don't want to change any order....please what is the query for that -
Converting this query to Oracle-Help
New account as my old email address has changed so I had to create a new one. Sucks!
Either way can I please get some help with converting the query below to oracle syntax not microsoft sql. Cheers
select eventtypeid as Payment_Type,
sum(commission_amount) as commission_amount,
startdate as commission_date
from
SELECT distinct
PERIOD.STARTDATE,
Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
case when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('2573','185')
then 'D'
when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('1126','1055')
then 'O'
when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('789','4000','785','871','1028','743')
then 'R'
else Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE
end as SDC,
Master_Usage.GENERICATTRIBUTE2 AS Service_Id,
Master_Usage.EVENTTYPEID,
sum(Master_Usage.CONTRIBUTIONVALUE) AS Commission_Amount
FROM Master_Usage INNER JOIN PERIOD
ON Master_Usage.PERIODSEQ = PERIOD.PERIODSEQ
INNER JOIN (select distinct
lastname,
super_distributor_code,
distributor_code,
participantid,
startperiod
from Dealer_Hierarchy_107_114
where startperiod in ('107','108','110','111','112','114')
AND NOT POSITIONTYPEID LIKE 'MI %'
and not super_distributor_code = 'null' or distributor_code = 'null') as dealer_hierarchy
ON Master_Usage.GENERICATTRIBUTE1 = dealer_hierarchy.PARTICIPANTID and dealer_hierarchy.startperiod in ('107','108','110','111','112','114')
WHERE
(NOT Master_Usage.PRODUCTID = 'IDDV' OR Master_Usage.PRODUCTID IS NULL)
AND Master_Usage.PERIODSEQ in ('107','108','110','111','112','114')
and Dealer_Hierarchy.startperiod in ('107','108','110','111','112','114')
and Master_Usage.NAME not like '%revenue%'
and Master_Usage.name not like '%GST%'
group by PERIOD.STARTDATE,
Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
Master_Usage.GENERICATTRIBUTE2,
Master_Usage.EVENTTYPEID
) as asf
group by asf.EVENTTYPEID,
startdate
order by commission_amount descplease see the bold section,
could that be the reason ??
select eventtypeid as Payment_Type,
sum(commission_amount) as commission_amount,
startdate as commission_date
from
SELECT distinct
PERIOD.STARTDATE,
Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
case when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('2573','185')
then 'D'
when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('1126','1055')
then 'O'
when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('789','4000','785','871','1028','743')
then 'R'
else Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE
end as SDC,
Master_Usage.GENERICATTRIBUTE2 AS Service_Id,
Master_Usage.EVENTTYPEID,
sum(Master_Usage.CONTRIBUTIONVALUE) AS Commission_Amount
FROM Master_Usage INNER JOIN PERIOD
ON Master_Usage.PERIODSEQ = PERIOD.PERIODSEQ
INNER JOIN (select distinct
lastname,
super_distributor_code,
distributor_code,
participantid,
startperiod
from Dealer_Hierarchy_107_114
where startperiod in ('107','108','110','111','112','114')
AND NOT POSITIONTYPEID LIKE 'MI %'
and not (super_distributor_code = 'null' or distributor_code = 'null') as dealer_hierarchy
ON Master_Usage.GENERICATTRIBUTE1 = dealer_hierarchy.PARTICIPANTID and dealer_hierarchy.startperiod in ('107','108','110','111','112','114')
WHERE
(NOT Master_Usage.PRODUCTID = 'IDDV' OR Master_Usage.PRODUCTID IS NULL)
AND Master_Usage.PERIODSEQ in ('107','108','110','111','112','114')
and Dealer_Hierarchy.startperiod in ('107','108','110','111','112','114')
and Master_Usage.NAME not like '%revenue%'
and Master_Usage.name not like '%GST%'
group by PERIOD.STARTDATE,
Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
Master_Usage.GENERICATTRIBUTE2,
Master_Usage.EVENTTYPEID
) as asf
group by asf.EVENTTYPEID,
startdate
order by commission_amount desc -
Can someone please convert this vi (8.2.1) to 8.0
can someone please be kind enough to convert this vi I made during class (version 8.2.1) to version 8.0 (which is what I have at home)?
Thanks.
Attachments:
accelerometer.vi 19 KB
accelerometer1.vi 19 KBThank you for helping jl487 out Dennis!
FYI, jl487, LabVIEW has the options File » Save for Previous Version ... that you can use in the future.
Kameralina
Ask NI (ni.com/ask)
Search The KnowledgeBase
NI Developer Zone
Measure It. Fix It. ni.com/greenengineering/
NI Vision ni.com/vision/ -
Is Flip4Mac out for Intel yet? If not would some1 please convert this .mov?
Is the .mov to .wmv converting software from Flip4Mac out yet? If not could someone pleeease convert this .mov to .wmv for me?
http://people.brandeis.edu/~rugby/videos/colby-sawyer06.mov
I was able to do it a while ago using Adobe Premeir and Windows Movie Maker (WMM) but Premeir would always change the dimensions of the video waay too large and when I resized it in WMM quality was lost and it was either too small or too large, I couldn't keep the same dimensions of the original film.
Any help is appreciated.The latest version (v2.1) is supposed to have universal binary support...
I hope it helps!
Dual 2.5 GHz PowerPC G5 Mac OS X (10.4.7) -
Convert this query from Ms Access to Oracle?
How in the hole world can do this query in oracle?
TRANSFORM Sum(NET_SALES) AS SALES
SELECT YEAR_MONTH
FROM TBLCUSTOMER
WHERE (CUSTOMER=2083 Or CUSTOMER=1035 Or CUSTOMER=2097)
AND YEAR_MONTH Between 200709 And 200801
GROUP BY YEAR_MONTH
ORDER BY YEAR_MONTH
PIVOT CUSTOMER;Like this perhaps:
SQL> ed
Wrote file afiedt.buf
1 WITH t AS (SELECT TO_DATE('01/01/2008','dd.mm.yyyy') AS dt, 1 AS emplid, 100 as sales FROM dual UNION ALL
2 SELECT TO_DATE('01/01/2008','dd.mm.yyyy'), 1, 200 FROM dual UNION ALL
3 SELECT TO_DATE('01/02/2008','dd.mm.yyyy'), 2, 300 FROM dual UNION ALL
4 SELECT TO_DATE('01/06/2008','dd.mm.yyyy'), 2, 400 FROM dual UNION ALL
5 SELECT TO_DATE('01/03/2007','dd.mm.yyyy'), 2, 500 FROM dual UNION ALL
6 SELECT TO_DATE('01/05/2007','dd.mm.yyyy'), 3, 600 FROM dual UNION ALL
7 SELECT TO_DATE('01/02/2008','dd.mm.yyyy'), 3, 700 FROM dual UNION ALL
8 SELECT TO_DATE('01/12/2008','dd.mm.yyyy'), 3, 800 FROM dual)
9 -- END OF TEST DATA
10 select year, month, emp_1_sales, emp_2_sales, emp_3_sales
11 from (
12 select extract(year from dt) as year, extract(month from dt) as month,
13 sum(decode(emplid, 1, sales, 0)) as emp_1_sales,
14 sum(decode(emplid, 2, sales, 0)) as emp_2_sales,
15 sum(decode(emplid, 3, sales, 0)) as emp_3_sales
16 from t
17 group by extract(year from dt), extract(month from dt)
18 )
19* order by emp_3_sales desc, emp_2_sales desc, emp_1_sales desc
SQL> /
YEAR MONTH EMP_1_SALES EMP_2_SALES EMP_3_SALES
2008 12 0 0 800
2008 2 0 300 700
2007 5 0 0 600
2007 3 0 500 0
2008 6 0 400 0
2008 1 300 0 0
6 rows selected.
SQL> ed
Wrote file afiedt.buf
1 WITH t AS (SELECT TO_DATE('01/01/2008','dd.mm.yyyy') AS dt, 1 AS emplid, 100 as sales FROM dual UNION ALL
2 SELECT TO_DATE('01/01/2008','dd.mm.yyyy'), 1, 200 FROM dual UNION ALL
3 SELECT TO_DATE('01/02/2008','dd.mm.yyyy'), 2, 300 FROM dual UNION ALL
4 SELECT TO_DATE('01/06/2008','dd.mm.yyyy'), 2, 400 FROM dual UNION ALL
5 SELECT TO_DATE('01/03/2007','dd.mm.yyyy'), 2, 500 FROM dual UNION ALL
6 SELECT TO_DATE('01/05/2007','dd.mm.yyyy'), 3, 600 FROM dual UNION ALL
7 SELECT TO_DATE('01/02/2008','dd.mm.yyyy'), 3, 700 FROM dual UNION ALL
8 SELECT TO_DATE('01/12/2008','dd.mm.yyyy'), 3, 800 FROM dual)
9 -- END OF TEST DATA
10 select extract(year from dt) as year, extract(month from dt) as month,
11 sum(decode(emplid, 1, sales, 0)) as emp_1_sales,
12 sum(decode(emplid, 2, sales, 0)) as emp_2_sales,
13 sum(decode(emplid, 3, sales, 0)) as emp_3_sales
14 from t
15 group by extract(year from dt), extract(month from dt)
16* order by 5 desc, 4 desc, 3 desc
SQL> /
YEAR MONTH EMP_1_SALES EMP_2_SALES EMP_3_SALES
2008 12 0 0 800
2008 2 0 300 700
2007 5 0 0 600
2007 3 0 500 0
2008 6 0 400 0
2008 1 300 0 0
6 rows selected.
SQL>If you meant something different, you'd better give an example of how you expect the output to be. -
LSMW Please answer this query Experts
Hi all,
I Know how to use LSMW and upload data . Now I am trying to upload data for xk01 uisng lsmw. SO, the problem is vendor number uses internal assignment here. I don't know wether we use lsmw if lifnr uses internal assignment.Also I need to upload bank details for each vendor which are in a seperate flat file. Guys with real time experience, I think can solve this problem. Please guide me with this.
Regards,
Varun.You already have another post with the same question. Can you please close this one?
-
Please convert this VI to 8.2
Hello,
I need an example of how to save several numeric values and graphs to an csv file (or something that can be read by excel).
I have found this VI but I need it in 8.2 version.
Could someone convert it?
If anyone has more example of saving different values to file please post it.
Thanks.
Solved!
Go to Solution.
Attachments:
PressureCalibration4.vi 145 KBHere it is. But I'm not sure if this will help you since it is based on the Report Generation Toolkit.
If you need other examples please post at the LabVIEW forums!
Christian
Attachments:
PressureCalibration4[1].vi 209 KB -
Please Help this query should be simple :)
Here is what I have written so far: Basically I want it to return all the locations like I have specified that do not have DA-REPL in the area_code table but it is just returning everything it seems.
select l.location_no, l.zone_code, la.area_code
from move.location l, move.location_area la
where la.location_no = l.location_no
and l.zone_code = 'Z-BIN'
and (l.location_no like '%%-%%-2%%' or l.location_no like '%%-%%-1%%')
and la.area_code != 'DA-REPL'
order by 1
Here is what my results look like:
60-02-101 Z-BIN WA-60
60-02-101 Z-BIN WA-BIN
60-02-101 Z-BIN WA-BINRESV
60-02-101 Z-BIN WA-PALLET
60-02-102 Z-BIN WA-60
60-02-102 Z-BIN WA-BIN
60-02-102 Z-BIN WA-BINRESV
60-02-102 Z-BIN WA-PALLET
60-02-201 Z-BIN WA-60
60-02-201 Z-BIN WA-BIN
60-02-201 Z-BIN WA-BINRESV
60-02-201 Z-BIN WA-PALLET
Edited by: 906043 on Feb 20, 2012 2:23 PM906043 wrote:
At it's most basic the query would look like this but this gives me 67,834 results I am dealing with a pretty big warehouse with many "la.area_code" entries I am only trying to get the locations in a specific zone('Z-BIN') that do not have 'DA-REPL' as an la.area_code as this would cause that location never to get replenishments when it becomes empty.
select l.location_no, l.zone_code, la.area_code
from move.location l, move.location_area la
where la.location_no = l.location_no
l.zone_code = 'Z=BIN'
and la.area_code != 'DA-REPL'
order by 1
Not sure if that helps anymore I am at a loss but still plugging away :)A little attention to code formatting could bring some sanity to yourself. Enclosing that formatted code in the code tags on this forum would bring a lot of sanity to those trying to help you:
select l.location_no
, l.zone_code
, la.area_code
from move.location l
, move.location_area la
where la.location_no = l.location_no
l.zone_code = 'Z=BIN'
and la.area_code != 'DA-REPL'
order by 1And once it is formatted for easier reading by humans, it's easier to see that you are missing an "and" (maybe "or"?) in your WHERE clause.
Maybe you are looking for
-
Logging CRS configuration changes
Hallo, in a 10.1 RAC environment, is there a file which logs CRS configuration changes, like issuing a oifcfg -setif command? Thx
-
Error message - "The iTunes Library.itl could not be read because it was
created by a newer version of iTunes." I was having problems with iTunes so I uninstalled it and then reinstalled it by running an iTunesSetUp.exe, which reinstalled the iTunes version 6.0.4. I now however am getting the error message mentioned above
-
Sound lost during archive importation
Hi I have a video archive, imported from a Sony DSR 500 camera, with 2 sound tracks. When I watch it on the "importation from a camera" panel, it is ok I can hear both of the sound tracks, one and two. I imported it in Final Cut Pro X, and I simply l
-
Hi I've created AW using OLAP DML and populated the AW using SQL Fetch and SQL Import. Then I created an aggmap to aggregate (Parent-Child Concat Dimension) using SUM operator it worked very fine. When I added to the AGGMAP a MODEL to roll-up differe
-
Failed to Generate Wrapper Class
Hello, I am trying to deploy a cmp ejb (attached here) and I always get the following exception. Can anyone please help? Julien Martin. weblogic.management.DeploymentException: Exception:weblogic.management.ApplicationException: activate failed for a