How to limit numeric columns to 32-bit and 64-bit values
Hi,
Is it possible to somehow limit the column datatype to 32-bit (or 64-bit) signed integer range of positive values, so that the permitted values would be within 0.. 2,147,483,647 for the 32-bit and 0.. 9,223,372,036,854,775,807 for the 64-bit. The reason is that we are using Java datatypes int and long to read data from the database and would like to constrain the maximum values at the database level.
An approach would probably be to define columns as NUMBER(10, 0) (or NUMBER(19, 0) for 64-bits) and add a CHECK constraint which would guarantee the value is within the boundaries, but is there any other solution? Unfortunately constrained datatypes http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/datatypes.htm#CHDBBCIE are available only in PL/SQL.
Thanks in advance.
Regards,
Jure
Here is an example with an object type:
SQL> CREATE TABLE TEST(TXT VARCHAR2(5), N INT_32);
Table created.
SQL> CREATE OR REPLACE TYPE INT_32
2 IS OBJECT
3 (
4 val NUMBER(10,0)
5 , CONSTRUCTOR FUNCTION INT_32 (val NUMBER) RETURN SELF AS RESULT
6 );
7 /
Type created.
SQL> CREATE OR REPLACE TYPE BODY INT_32
2 AS
3 CONSTRUCTOR FUNCTION INT_32 (val NUMBER)
4 RETURN SELF AS RESULT IS
5 BEGIN
6 IF val NOT BETWEEN 0 AND 10 OR val IS NULL THEN
7 RAISE_APPLICATION_ERROR(-20001,'Out of bounds!');
8 ELSE
9 SELF.val := val;
10 END IF;
11 RETURN;
12 END;
13 END;
14 /
Type body created.
SQL> CREATE TABLE TEST(TXT VARCHAR2(5), N INT_32);
Table created.
SQL> INSERT INTO TEST VALUES('Test',INT_32(5));
1 row created.
SQL> INSERT INTO TEST VALUES('Test',INT_32(-1));
INSERT INTO TEST VALUES('Test',INT_32(-1))
ERROR at line 1:
ORA-20001: Out of bounds!
ORA-06512: at "TEST.INT_32", line 7
SQL> INSERT INTO TEST VALUES('Test',INT_32(11));
INSERT INTO TEST VALUES('Test',INT_32(11))
ERROR at line 1:
ORA-20001: Out of bounds!
ORA-06512: at "TEST.INT_32", line 7
SQL> SELECT TXT, T.N.VAL FROM TEST T;
TXT N.VAL
Test 5
Similar Messages
-
How to use numeric column in BI Publisher 11g Data Model?
Hi Gurus
I was able to create a link(join) in Data model when I used VARCHAR column.
However if I used numeric column I got an error
Any ideas?
Thanks
LaszloCan you please post the error message?
Regards,
Kalyan Chukkapalli
http://123obi.com -
How to make the column red in field catalog if its value is negetive
i am displaying 25 columns in a field catalog ,
if the value of the cell is negative it should appear in red colour .
for ex,
mat.no custno value
1 10 10
<b>2 20 -10</b>
3 30 20
note:
only cell which is the intersection of second row and third column
should appear red .
not the whole row or columnHi Balaji,
Run this code for coloring specific coloum in a row when the value of that column is negative
REPORT zex34 .
TYPE-POOLS: slis.
INCLUDE <icon>.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
it_fieldcat1 TYPE slis_t_fieldcat_alv..
DATA: x_fieldcat TYPE slis_fieldcat_alv,
x_fieldcat1 TYPE slis_fieldcat_alv.
DATA: it_events TYPE slis_t_event,
x_events TYPE slis_alv_event,
i_program LIKE sy-repid.
x_events-name = 'END_OF_LIST'.
x_events-form = 'LIST_MODIFY_OUPUT'.
APPEND x_events TO it_events.
data : count type i,
calc1 type i value 1,
calc2 type i value 1,
TOTREC TYPE I.
DATA: BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
kunnr LIKE mara-kunnr,
value type i,
flag(1),
END OF it_mara.
SELECT matnr
kunnr
UP TO 10 ROWS
INTO corresponding fields of TABLE it_mara
FROM mara.
loop at it_mara.
count = sy-tabix mod 2.
if count eq 0.
it_mara-value = calc1.
calc1 = calc1 + 6.
it_mara-flag = ' '.
else.
calc2 = calc2 - 5.
it_mara-value = calc2.
it_mara-flag = 'X'.
endif.
modify it_mara index sy-tabix.
TOTREC = TOTREC + 1.
ENDLOOP.
i_program = sy-repid.
DATA:l_pos TYPE i VALUE 1.
CLEAR: l_pos.
l_pos = l_pos + 1.
x_fieldcat-seltext_m = 'MATNR'.
x_fieldcat-fieldname = 'MATNR'.
x_fieldcat-tabname = 'IT_MARA'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '18'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-seltext_m = 'KUNNR'.
x_fieldcat-fieldname = 'KUNNR'.
x_fieldcat-tabname = 'IT_MARA'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '10'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-seltext_m = 'VALUE'.
x_fieldcat-fieldname = 'VALUE'.
x_fieldcat-tabname = 'IT_MARA'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '10'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-seltext_m = 'FLAG'.
x_fieldcat-fieldname = 'FLAG'.
x_fieldcat-tabname = 'IT_MARA'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '1'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = i_program
it_fieldcat = it_fieldcat
it_events = it_events
TABLES
t_outtab = it_mara
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form LIST_MODIFY_OUPUT
text
FORM list_modify_ouput.
DATA: l_matnr LIKE mara-matnr,
l_kunnr LIKE mara-kunnr,
l_value type i,
l_index TYPE sy-index.
CLEAR it_mara.
DO 20 TIMES.
CLEAR: l_matnr, l_kunnr , l_value.
READ LINE sy-index INDEX sy-lsind
FIELD VALUE it_mara-matnr INTO l_matnr
it_mara-kunnr INTO l_kunnr
it_mara-value into l_value.
*3lines are reserved for alv headings , so i am reading it form 4th
*line so 4th line is equal to 1st line of itab
IF sy-subrc = 0 AND sy-index GE 4.
l_index = sy-index - 3.
READ TABLE it_mara INDEX l_index.
IF sy-subrc = 0 AND it_mara-flag = 'X'.
*-Modifying current list
MODIFY LINE sy-index INDEX sy-lsind
FIELD FORMAT it_mara-VALUE COLOR 6 INVERSE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. -
Hi,
I have table called Employe. And the Columns are Emp_ID,EMP_NAME,SRC_SYS_CD,DOB
I have Query like
Select
COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN Emp_id END), MAX(CASE WHEN src_sys_cd='2' THEN Emp_Id END))Emp_Id,
COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN Emp_name END), MAX(CASE WHEN src_sys_cd='2' THEN Emp_Name END))Emp_name,
COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN dob END), MAX(CASE WHEN src_sys_cd='2' THEN dob END))dob ,
from Employe
group by dob.
I want to generalize the query like get the columns from SYS.ALL_COLUMNS table for that table name and want to pass it to COALEACE() function. I tried with Cursor. But i didnt get the appropriate results.
Is there any way to achieve this? Please help me out in this regard.
Thanks,Is this the kinda thing you're after?
Add a filter to the queries to get just a single table/
WITH allCols AS (
SELECT s.name as sName, o.name AS oName, c.name AS cName, column_id,
CASE WHEN st.name in ('float','bigint','tinyint','int','smallint','bit','datetime','money','date','datetime2','uniqueidentifier','sysname','geography','geometry') THEN st.name
WHEN st.name in ('numeric','real') THEN st.name + '('+CAST(c.scale AS VARCHAR)+','+CAST(c.precision AS VARCHAR)+')'
WHEN st.name in ('varbinary','varchar','binary','char','nchar','nvarchar') THEN st.name + '(' + CAST(ABS(c.max_length) AS VARCHAR) + ')'
ELSE st.name + ' unknown '
END + ' '+
CASE WHEN c.is_identity = 1 THEN 'IDENTITY ' ELSE '' END +
CASE WHEN c.is_nullable = 0 THEN 'NOT ' ELSE '' END + 'NULL' AS bText,
f.name AS fileGroupName
FROM sys.columns c
INNER JOIN sys.objects o
ON c.object_id = o.object_id
AND o.type = 'U'
INNER JOIN sys.systypes st
ON c.user_type_id = st.xusertype
INNER JOIN sys.schemas s
ON o.schema_id = s.schema_id
INNER JOIN sys.indexes i
ON o.object_id = i.object_id
AND i.index_id = (SELECT MIN(index_id) FROM sys.indexes WHERE object_ID = o.object_id)
INNER JOIN sys.filegroups f
ON i.data_space_id = f.data_space_id
), rCTE AS (
SELECT sName, oName, cName, column_id, CAST(cName + ' ' + bText AS VARCHAR(MAX)) as bText, CAST(cName AS VARCHAR(MAX)) AS colList, fileGroupName
FROM allCols
WHERE column_id = 1
UNION ALL
SELECT r.sName, r.oName, r.cName, c.column_id, CAST(r.bText +', ' + c.cName + ' ' +c.bText AS VARCHAR(MAX)), CAST(r.colList+ ', ' +c.cName AS VARCHAR(MAX)), c.fileGroupName
FROM allCols c
INNER JOIN rCTE r
ON c.oName = r.oName
AND c.column_id - 1 = r.column_id
), allIndx AS (
SELECT 'CREATE '+CASE WHEN is_unique = 1 THEN ' UNIQUE ' ELSE '' END+i.type_desc+' INDEX ['+i.name+'] ON ['+CAST(s.name COLLATE DATABASE_DEFAULT AS NVARCHAR )+'].['+o.name+'] (' as prefix,
CASE WHEN is_included_column = 0 THEN '['+c.name+'] '+CASE WHEN ic.is_descending_key = 1 THEN 'DESC' ELSE 'ASC' END END As cols,
CASE WHEN is_included_column = 1 THEN '['+c.name+']'END As incCols,
') WITH ('+
CASE WHEN is_padded = 0 THEN 'PAD_INDEX = OFF,' ELSE 'PAD_INDEX = ON,' END+
CASE WHEN ignore_dup_key = 0 THEN 'IGNORE_DUP_KEY = OFF,' ELSE 'IGNORE_DUP_KEY = ON,' END+
CASE WHEN allow_row_locks = 0 THEN 'ALLOW_ROW_LOCKS = OFF,' ELSE 'ALLOW_ROW_LOCKS = ON,' END+
CASE WHEN allow_page_locks = 0 THEN 'ALLOW_PAGE_LOCKS = OFF' ELSE 'ALLOW_PAGE_LOCKS = ON' END+
')' as suffix, index_column_id, key_ordinal, f.name as fileGroupName
FROM sys.indexes i
LEFT OUTER JOIN sys.index_columns ic
ON i.object_id = ic.object_id
AND i.index_id = ic.index_id
LEFT OUTER JOIN sys.columns c
ON ic.object_id = c.object_id
AND ic.column_id = c.column_id
INNER JOIN sys.objects o
ON i.object_id = o.object_id
AND o.type = 'U'
AND i.type <> 0
INNER JOIN sys.schemas s
ON o.schema_id = s.schema_id
INNER JOIN sys.filegroups f
ON i.data_space_id = f.data_space_id
), idxrCTE AS (
SELECT r.prefix, CAST(r.cols AS NVARCHAR(MAX)) AS cols, CAST(r.incCols AS NVARCHAR(MAX)) AS incCols, r.suffix, r.index_column_id, r.key_ordinal, fileGroupName
FROM allIndx r
WHERE index_column_id = 1
UNION ALL
SELECT o.prefix, COALESCE(r.cols,'') + COALESCE(', '+o.cols,''), COALESCE(r.incCols+', ','') + o.incCols, o.suffix, o.index_column_id, o.key_ordinal, o.fileGroupName
FROM allIndx o
INNER JOIN idxrCTE r
ON o.prefix = r.prefix
AND o.index_column_id - 1 = r.index_column_id
SELECT 'CREATE TABLE ['+sName+'].[' + oName + '] ('+bText+') ON [' + fileGroupName +']'
FROM rCTE r
WHERE column_id = (SELECT MAX(column_id) FROM rCTE WHERE r.oName = oName)
UNION ALL
SELECT prefix + cols + CASE WHEN incCols IS NOT NULL THEN ') INCLUDE ('+incCols ELSE '' END + suffix+' ON [' + fileGroupName +']'
FROM idxrCTE x
WHERE index_column_id = (SELECT MAX(index_column_id) FROM idxrCTE WHERE x.prefix = prefix) -
How To know Which Columns are not null and Which are null
Hi Freinds,
I want to Know ,How by Wrting a Query we can get the Names of The Columns from the Table which is set to not-null or null,
Thanks
ShoaibSELECT * FROM user_tab_columns
WHERE table_name='Your_Table_Name'Check NULLABLE column. -
How to create logical columns for current period and prior period
Hello all.
Is there any way in obiee to create a new logica column in BMM layer that says "CURRENT PERIOD" AND "PRIOR PERIOD" OR ONE SINGLE COLUMN THAT SAYS "PERIOD".
In those columns what I need is if it a current period column it shoould have 03/01/2012-03/31/2012 (this month date range)
and in prior period column I shouldhave 02/01/2012 -02/29/2012(which is previous month date range).These columns I will be using in my reports.
Please help me if we can create any such columns with these conditions/requirementsHi,I have already created he dynamic variables.But I am not getting how to use those variables and create the new logical columns in bmm layer.
this is what I am trying
case when VALUEOF("Current Month begin date"."Current Month begin date") ='..' and VALUEOF("Current Month end date"."Current Month end date")
='..' then 'current period' end
I don't really understand what I should write case when VALUEOF("Current Month begin date"."Current Month begin date") ='..'?? -
How to get a column by applying logical AND operator on two column ?
All column are VARCHAR2 data type.
I have table output in this way :
col1 col2
True True
True False
False FalseBut i want a additional column in this way :
col1 col2 result
True True True
True False False
False False FalseAs the output indicates its clear that resut column is logical AND operator
on col1 and col2. How to achieve this ?try this
WITH logic AS
(SELECT 'TRUE' col1, 'TRUE' col2
FROM DUAL
UNION ALL
SELECT 'TRUE' col1, 'FALSE' col2
FROM DUAL
UNION ALL
SELECT 'FALSE' col1, 'TRUE' col2
FROM DUAL
UNION ALL
SELECT 'FALSE' col1, 'FALSE' col2
FROM DUAL)
SELECT col1, col2,
CASE
WHEN 'FALSE' IN (col1, col2)
THEN 'FALSE'
ELSE 'TRUE'
END AS log_and,
CASE
WHEN 'TRUE' IN (col1, col2)
THEN 'TRUE'
WHEN 'FALSE' IN (col1, col2)
THEN 'FALSE'
END AS log_or
FROM logic
Explain complete.
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 4 | 32 | 8 (0)|
| 1 | VIEW | | 4 | 32 | 8 (0)|
| 2 | UNION-ALL | | | | |
| 3 | FAST DUAL | | 1 | | 2 (0)|
| 4 | FAST DUAL | | 1 | | 2 (0)|
| 5 | FAST DUAL | | 1 | | 2 (0)|
| 6 | FAST DUAL | | 1 | | 2 (0)|
Note
- 'PLAN_TABLE' is old version
16 rows selected.regards,
friend -
How to create a column graph with colors per set of values
I need to create with Microsoft Excel, a column graph that based on different values, each column will contain different color.
To be precise:
E.g.:
- Green: If it is 0
- Orange: If it is between 0 and 10
- Red: If it is more than 10
I would appreciate to help me how to do this.Hi EriValidata,
According to your description, I get the result as shown in the following figure.
Is this a correct result? If yes, this is an excel chart with conditional formatting. Please try the following steps to create the chart.
To accomplish this task, you will need to create three additional columns of data and plot those three columns of data-and not the original column of sales data – in a stacked column chart. As shown in the figure.
And the formula in C2 is: =IF(AND(B2>0,B2<=10),B2,0). The formula shows the value in column C if it falls between the limits in rows 0 and 10; otherwise it shows 0. The formula is filled into the range C2:E4.
Then we select the source data with A2:A4 and C1:E4, as shown in the figure to insert a column chart. The chart now shows 3 sets of colored bars, one for each data range of interest.
And I upload a TEST2.xlsx file on OneDrive, you can download this file via this link:
https://microsoft-my.sharepoint.com/personal/v-lzng_microsoft_com/Documents/Shared with Everyone
Hope it’s helpful.
Regards, -
How to add balance column in the PO and AP Report
I have added amount remaining column in this report from ap payment schedules all,but it is not returning any rows,can you please look into this issue.
select
distinct po_vendors.segment1
|| chr(9) || po_vendors.vendor_name
|| chr(9) || po_vendor_sites.vendor_site_code
|| chr(9) || po_vendors.vendor_type_lookup_code
|| chr(9) || po_vendor_sites. attribute2
|| chr(9) || po_vendor_sites.inactive_date
|| chr(9) || po_vendor_sites.creation_date
|| chr(9) || to_char(max(ap_checks.check_date), 'DD-MON-YYYY')
|| chr(9) || ap_payment_schedules.amount_remaining
from
po_vendors
,po_vendor_sites
,ap_checks
,ap_payment_schedules
,ap_invoices i2
where
po_vendors.end_date_active is null and
po_vendors.vendor_id = po_vendor_sites.vendor_id
-- and po_vendors.VENDOR_ID=i2.VENDOR_ID
and i2.invoice_id=ap_payment_schedules.invoice_id
and po_vendor_sites.inactive_date is null
and po_vendor_sites.creation_date < sysdate--&v_cutoff_date
and po_vendor_sites.pay_site_flag = 'Y'
and not exists (select vendor_site_id from ap_checks c2 where
c2.vendor_site_id = po_vendor_sites.vendor_site_id
and c2.check_date < sysdate)--&v_cutoff_date)
and not exists (select vendor_site_id from ap_invoices i2 where
i2.vendor_site_id = po_vendor_sites.vendor_site_id
and (i2.invoice_date < sysdate or payment_status_flag in ('N', 'P') ) )
and po_vendor_sites.vendor_site_id = ap_checks.vendor_site_id (+)
--and ((i2.invoice_amount) - (i2.amount_paid)) <>0
--and (i2.invoice_amount - NVL(i2.amount_paid,0))>=0
group by
po_vendors.segment1
,po_vendors.VENDOR_ID
,po_vendors.vendor_name
,po_vendor_sites.vendor_site_code
,po_vendors.vendor_type_lookup_code
,po_vendor_sites.attribute2
,po_vendor_sites.inactive_date
,po_vendor_sites.creation_date
--,i2.invoice_amount,i2.amount_paid
--,i2.invoice_num
,po_vendor_sites.VENDOR_SITE_ID
,ap_payment_schedules.amount_remaining
--,(i2.invoice_amount-nvl(i2.amount_paid,0))
--order by
-- po_vendors.vendor_name
--- ,po_vendors.segment1
-- ,po_vendor_sites.vendor_site_codeHi,
Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
Am I using the wrong table ? wrong user-exit ? or my code ..
Thansk a lot again for your help.
Fanny GROUX -
How does "Unflatten From String" take a type and return a value of that type?
http://zone.ni.com/reference/en-XX/help/371361E-01/glang/unflatten_from_string/
How exactly does the "type" argument for "Unflatten From String" work? I need to create a VI that takes a type, passes it as an argument to several calls of the "Unflatten From String" function, and returns an array containing elements of the type originally passed. The "Unflatten From String" function seems to do some magic though, because the type of the "value" that it outputs changes depending on the type it is passed as input. How do I do the same magic in my VI?
Ultimately, what I need to accomplish is an unflatten-list operation. Given a type T and a byte string of length L (which contains a concatenation of T elements that are flattened to their bytes), create a VI that unflattens all the types in the string and return an array of length (L / sizeof(T)) that contains each type.
Note: performing the unflatten-list operation is trivial, but I cannot for the life of me figure out how to do it in a VI that takes a type and returns an array of the appropriate type. By the way, my data is being given to me from another source, so please don't bother suggesting that I should be flattening an array using LabVIEW's "Flatten To String" function in the first place. My data is not given in LabVIEW's array format: http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/flattened_data/
Thanks a ton!
-WakkaTake a look at this example: You can see that the flattened string contains several bytes. The first four bytes contain the length of array (number of elements). Since the data type is U32, the next 32 bits (4 bytes) contains the value of the first element, and so on. Could you possibly use this scheme to do what you want to do? Other data types present different outputs. You would have to experiment with them.
- tbob
Inventor of the WORM Global -
How to download ECC customers without Sales Office and Sales Group values
Dear all,
In SD Customer master record we enter Sales Office and Sales Group fields under Sales Area tab-->Sales Tab.
While downloading customers form ECC to CRM, How can I exclude this Sales Office and Sales Group Data from the download.
I want to download customers without this sales office and Sales group data...Kindly suggest me how can I do this.
Your suggestions will be highly appreciated.
Best regards
Raghu ramHi Chandrakanth,
I have removed 'Object Permitted in determination' checkbox for all Sales Offices, but still the problem persist.
I am getting following problem in SMW01 while downloading customers.
"Sales office O 50000004 sales group O 50000057 not maintained for sales area O 50000001 C5 Z0
Message no. CRM_BUPA_FRG0140204."
This problem is coming for all customers, so I though of excluding Sales Office and Sales groups from downloading.
Can we use Filters functionality for this, if so what sort of settings need to be maintained for Customer_Main object in R3AC1 transaction.
Please suggest, your suggestions will be highly appreciated.
Best regards
Raghu ram -
How to compare two rows in PL/SQL and retrieve the values?
Hello,
I have two tables which have identical schemas, one table (tbl_store) is used to hold the latest version, and the other table (tbl_store_audit) holds previous versions. When the latest record is updated, it is inserted into the tbl_store_audit table as a revision, and the updated details are used as the latest record.
For example: The latest version is held in tbl_store, however the tbl_store_audit may hold 5 records which are the past records used before changes were made - these are seen as revisions.
I want to be able to compare what has changed between each revision in the tbl_store_audit table. For example: Out of the 10 columns, the change between revision 1 and revision 2 was the size from XL to XXL. The change between revision 3 and revision 4 was the size XS to M and price 4.99 to 10.99, and so on.
Eventually i will create an APEX report that will show the user the revision number and what was changed from and to.
I seen in a previous post i need to note my oracle version: Oracle version 10.2.0.4.0Hi,
Like suggested already you should give some sample data and output.
Maybe you would like to have something like this:
-- Sample data
-- Note PK is the primairy key of the source table and rev are the revisions
with tbl_store_audit as
select 1 pk, 1 rev , 1 price , 'XXL' unit_size from dual union all
select 1 pk, 2 rev , 1 price, 'XL' unit_size from dual union all
select 1 pk, 3 rev , 1.4 price, 'XXL' unit_size from dual union all
select 2 pk, 1 rev , 1.4 price, 'XL' unit_size from dual union all
select 2 pk, 2 rev , 1.4 price, 'XL' unit_size from dual union all
select 2 pk, 3 rev , 1.4 price, 'XL' unit_size from dual union all
select 1 pk, 4 rev , 1 price , 'XL' unit_size from dual union all
select 1 pk, 5 rev , 1 price , 'XL' unit_size from dual union all
select 3 pk, 1 rev , 1.2 price, 'XL' unit_size from dual union all
select 3 pk, 2 rev , 1.2 price, 'XXL' unit_size from dual union all
select 4 pk, 1 rev , 1 price , 'XL' unit_size from dual
-- end of sample data
,tbl_store_audit_tmp as
select
pk
,rev
,'PRICE' field_name
,to_char(price) field_value
,to_char(lag(price,1) over (partition by pk order by rev) ) old_field_value
from
tbl_store_audit
union all
select
pk
,rev
,'UNIT_SIZE' field_name
,to_char(UNIT_SIZE) field_value
,to_char(lag(UNIT_SIZE,1) over (partition by pk order by rev) ) old_field_value
from
tbl_store_audit
-- include all other fields from the table here with it's own union all select ...
select
from
tbl_store_audit_tmp
where
field_value != old_field_value
PK REV FIELD_NAME FIELD_VALUE OLD_FIELD_VALUE
1 3 PRICE 1.4 1
1 4 PRICE 1 1.4
1 2 UNIT_SIZE XL XXL
1 3 UNIT_SIZE XXL XL
1 4 UNIT_SIZE XL XXL
3 2 UNIT_SIZE XXL XL
6 rows selected If you realy want to keep track of all the changes I think it would be better if you make a "after update trigger" on the base table that checks what changed and put that directly in the uadit table.
Regards,
Peter
Edited by: Peter vd Zwan on Aug 16, 2012 8:25 AM -
ICM 7.5-how to get individual outbound dialer calls talktime and respective ECC values
Hello,
I'm looking for following two items
1. Outbound dialer calls talktime in each call.
2. Each calls respective ECC values.
I have tried to get talktime from TCD table it’s shows zero value.
Please advice how to get above values, it would be much appreciated.
Thanks
Regards,
ParamHey Param,
You can use the PeripheralCallType in the TCD table to find dialer calls. Look for calls with:
PeripheralCallType IN ('27','28','29','30','31') for reservation calls and
PeripheralCallType IN ('32','33','34','35') for the customer calls
For duration of reservation calls look at the HoldTime value
For duration of the customer call you can look at the HoldTime + TalkTime + WorkTime for a total handle time for the customer leg of the dialer call
If you want to look at the ECC variables that were associated with that call you will have to lookup the Termination_Call_Variable table matching:
Termination_Call_Variable.TCDRecoveryKey = Termination_Call_Detail.RecoveryKey
Cheers,
Nathan -
How to log strings stored in Station Globals and/or PreUUT values?
Hi all,
I have a Station Global that is persistent across all UUTs in a particular PC. I have also created a custom PreUUT dialog to obtain user input that applies to the upcoming UUT (I pass this user input to the UUT by storing it in a File Global). Both the Station Global and the File Global store a string.
What is a good way to log these strings into the ATML report and SQL database?
Currently, the best solution I can think of is:
Create a LabVIEW VI that takes a string input and passes it straight through to the output
Pass the Station Global (or the File Global) into the VI input
Assign the VI output to Step.Result.ReportText
This seems rather cumbersome though. Is there a simpler way to achieve this? (i.e. is there a built-in TestStand action that logs a variable directly into the report?)
In case it's important, I'm using TestStand 2013 SP1 and I'm using the default report templates: tr5_horizontal.xsl for ATML, and C:\Program Files\National Instruments\TestStand 2013\Components\Models\TestStandModels\Database\SQL Server Create Generic Recordset Result Tables.sql for SQL.
Thanks!
Solved!
Go to Solution.JKSH,
You can handle this with the Additional Results functionality in TestStand, which can be configured in the settings for an existing step, or as a standalone step type. We have an example of this in the TestStand Fundamental Example series here: http://www.ni.com/product-documentation/52354/en/#toc3 (Look for section 3, "Adding Custom Data to a Report"
I hope it helps, and let us know if we can do anything else to help!
Daniel E.
TestStand Product Support Engineer
National Instruments -
ASH
T2
T3
T6
T8
T12
T14
T15
T18
T19
T22
T29
T32
T35
T39
T49
T52
T2
100
68
53
65
74
52
61
63
50
55
53
52
86
45
48
69
T3
0.6
100
51
65
55
49
55
62
34
43
69
55
52
53
58
73
T6
0.6
0.3
100
68
83
74
63
60
65
32
55
62
66
76
63
71
T8
2.6
0.2
3.9
100
58
62
56
68
63
58
60
63
63
73
69
67
T12
1.2
1.9
2.2
6.9
100
86
61
73
47
47
53
67
60
47
58
88
T14
0.2
0.8
3.1
3.4
2.3
100
62
64
38
60
60
56
51
37
56
74
T15
2
0.6
2.6
2.4
0.3
9.5
100
59
57
40
57
60
67
71
57
53
T18
2.1
0.3
2.2
5.1
3.8
3
1.6
100
71
68
50
31
70
63
55
58
T19
1.2
1.6
3
0.2
0.5
3.2
3.2
2.3
100
60
56
65
48
47
58
56
T22
1.2
0.6
3.2
4.7
2.5
3.5
6.5
5.1
2.3
100
61
55
59
60
50
62
T29
3.3
4
1.6
3
1.2
4.7
3.7
3.4
3.5
6.3
100
53
51
67
47
68
T32
0.1
1.3
4.4
2.4
2.8
2.9
3.7
0.2
0.5
3.1
0.4
100
56
74
45
65
T35
4
3.8
0.3
2.9
0.9
3.1
1.8
0.2
0.3
3.5
5.7
0.8
100
62
68
68
T39
0.4
0.7
1.9
1
1.5
3
0.4
0.3
0.3
1.5
0.3
1.6
1.8
100
70Hi Ken
Use Conditional Format to provide a Cell colour fill or a font colour if the Cell contents exceed a certain value.
Here is a thread where the question was to highlight values below a certain value, but I think you will get the idea!
https://discussions.apple.com/thread/5187841?tstart=0
Regards,
Ian.
Maybe you are looking for
-
When an overage is posted, the total amount of the cash drawer plus the negative amount of the overage is being posted to the cash deposit account. This negative amount should not hit the cash account and should show up as a credit to our expense/rev
-
Unable to see Accrued amt in Sales summary of Rebate
Hi. I have created Customer Rebate "BO03" for customer. i have also created OR->Del-> Inv for that customer. but still i am unable to see same invoice in Sales Summsry of Rebate. Reg, Amol
-
Is it possible to deploy a CQ5.4 cloud?
Hi, the header of the deploymentscript (deployscript.sh) says: # Deploy CQ 5.4 (5.5 alpha) on AWS EC2 with multiple choices # details see: http://wiki.day.com/content/wiki/Users/chuesler/How%20to%20deploy%20CQ5%20on%20Amazon%20EC 2.html # author: [em
-
Hi. Working in Photoshop 7.0 Acrobat 5.0 Reader 8.1.2 I made a .psd. I flattened layers & brought down the resolution & made a .jpeg out of it. I put the .jpeg into Acrobat, then saved as a .pdf. I printed the .pdf from Acrobat & the page came out li
-
I have the HP envy 14-2166se and downloaded the newest update from HP today and I can no long play any sounds or any videos. If someone could help that would be great.