IS_Number(), Is_Date() , Is_Char()....
Is there any way to provide a value to a function and check if the value is numeric, character, date or any other data type. I know about Dump function in sql, please guide me if there is some other method like specific function(s) as is_date, is_number etc
you can easily create your own is_number function:
create or replace function is_number(pinput in varchar2) returns boolean is
vholdnum number;
begin
vholdnum := pinput-1;
return TRUE;
exception
when others then
return FALSE;
end;
is_date would be harder as you would have to check every conceivable format mask for dates.
For is_char (i assume you mean not just a number) just reverse is_number:
create or replace function is_char(pinput in varchar2) returns boolean is
vholdnum number;
begin
vholdnum := pinput-1;
return FALSE;
exception
when others then
return TRUE;
end;
Similar Messages
-
Error in IS_NUMBER Function PL/SQL!!
Hi Experts,
I have a pl/sql function for checking the input is numeber or not and it needs to retrun BOOLEAN value. Here is the code for that,
CREATE OR REPLACE function is_number(in_var in varchar2)
return BOOLEAN
is
v_number number;
begin
if in_var IS NOT NULL THEN
v_number := to_number(in_var);
return TRUE; -- No exception, so is a number
else
return FALSE;
end if;
exception
when others then
RAISE;
end;
When i run the above function,
select is_number('1') from dual;
Its errored out saying,
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
Please let me know where i am wrong.
Thanks,
GWrite it in this way:
CREATE OR REPLACE FUNCTION is_number (in_var IN VARCHAR2)
RETURN VARCHAR2
IS
v_number NUMBER;
BEGIN
IF in_var IS NOT NULL
THEN
v_number := TO_NUMBER (in_var);
RETURN 'true'; -- No exception, so is a number
ELSE
RETURN 'FALSE';
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN 'false';
END;
SELECT is_number ('d')
FROM DUAL;
false
SELECT is_number ('1')
FROM DUAL;
true- - - - - - - - - - - - - - - - - - - - -
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Data rule - Is_date Rule
Hi
I m trying to create adata rule which can identify whether the incomeing data is date or not. I tried using is_date data rule. but the format in which my data comes, is not supported by the IS_DATE rule. My data comes in 'DD/MM/YYYY HH24:MI:SS'
So, I created my own custom rule. But when i deploy the mapping it says that it doesnt recognises HH24, MI, SS. how should this time variables be represented?
Please help me on this.
Regards
VibhutiHi
The above mentioned problem waas solved. Thanks to the concept of Regular Expressions. I had to create a custom rule/data format rule and in the expression i gave the following RegExps and i applied this rule on my tables. It worked fine.
--DD/MM/YYYY HH24:MI:SS
^(((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))) ([0-1]?[0-9]|[2][0-3]):([0-5]?[0-9]):([0-5]?[0-9])$
For any further queries you can post here
Regards
Vibhuti -
IS_Data Insight View Data Function Limitation
Hi Experts,
Is there any limitation to view data of a table using View Data function in Data Insight module in Information Steward. I come across a strange issue with this, the details are explained below.
I am trying to perform Data profiling on table, as part of this I imported table into a Data Insight project. When i tried to view data of a table using View Data function, it is showing blank like (0 from 998987). I am able able to see data in database and even in DS designer too.
Then i created a view on top of this table by selecting all columns and tried to view data, again showed blank. Then i removed some columns in view and tried, now it showed data. The table contains 150 columns, I used around 110 columns in view.
My question here is, is there any limitations in Data Insight for viewing data apart 500 records. Will View Data function consider the number of Rows or the size of data to display the data. If it consider these two, is there any option available in IS to control these two parameters i.e., increase / decrease the size or no of rows.
If anyone come across with this issue, could you please help me if any solutions to fix this.
Thanks,
Ramakrishna KamurthyHello Rama,
In IS 4.2 this limitation is actually stated.
See here: IS_421_user_en.pdf in Related Information section pg 44 which states that:
The software displays only 500 records when you view data from an SAP table.
Also more details available in section: 2.5.10.2 Limit of 500 records when viewing data from SAP tables.
The software displays only 500 records when you view data from an SAP table.
Views that contain SAP tables have the potential to be quite large, especially when they are joined with other SAP tables. The limit of 500 records when viewing data prevents your computer from hanging or never completing the task because the tables were too large.
In addition to the 500 records limit, you can take steps to enhance performance in the following ways:
● Reduce the size of the file by mapping fields, join conditions, filters, and so on to limit the data in the table to information that you really need.
● Use SAP ABAP-supported functions in forming expressions in views. Using non-supported functions is allowed, but doing so may adversely affect performance.
● Use the View Data filter tools when you view and export data from SAP tables.
With the 500 records limit for viewing SAP table data, there is a potential for no records showing up in the View Data window.
This could happen, for example, when the view contains a child view, the child view contains one or more SAP tables, and a join is set up to join the entire data set.
A message appears at the top of the View Data window that instructs you to export the data to an external source (text file, CSV, or Excel file) to view all of the records.
I hope this is helpful.
Mike -
IS_NUMBER function?
I wrote a very primitive function to check if the contents of a VARCHAR field is Numeric. The function simply checks if every character in the field is between 0 - 9.
I feel like this is a very inefficient way to check for numeric/non-numeric data.
Is there a better way to do it?The problem is not in that members regular expression but in the way the forum treats square brackets if you don't include {noformat}{noformat} tags around the code.
The square brackets are in the code, you just can't see them because of the forum if the code hasn't been formatted. (just as it's done with your code) ;) -
I had a need to validate that an input date was in fact a valid date. Eventually I found this function and applied it to my program:
(i_date IN varchar2) RETURN DATE IS
v_date DATE;
BEGIN
v_date := TO_DATE(i_date ,'mm/dd/yyyy');
RETURN v_date;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END is_date;
The above code works perfectly for my date validation needs. I now want to create a similar function for validating that an input number is a valid number, and not something like gibberish "fsdhyubsd". So I tried to use the same logic as the date validator, and I made this:
(i_number IN number) RETURN NUMBER IS
v_number NUMBER;
BEGIN
v_number := TO_NUMBER(i_number);
RETURN v_number;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END is_number;
My new number validator is not working. And it's actually causing my date validator to stop working. But back to the number validator. When I type in gibberish, it comes back with an html error "Webpage cannot be found." Not like the sql error I was getting when I was tinkering with the date validator before I got it to work. Is it an easy fix to what I have already tried, or am I way off? Again, the 1st block of code is good, I need tweaking to the 2nd block of code to give me a number validator. Thanks!Ok, sort of to follow up on this. I think I figured out what was wrong. The variable I was trying to validate was declared as a number. It needed to be that way becuase later on in the program I was performing calculations based on that variable. The number validator function worked fine, but pl/sql was kicking my program out immediately because it was expecting a number as the input.
So, I had to change my initial input variable to a varchar2. But that was messing with my calculations later on, so I had to re-declare the variable it would do calculations to a different name as a number variable. Then assign the varchar2 variable to the new number variable so the program could do the calculations.
So finally, a varchar2 variable is used to do the number validation and a number variable is used for the rest of the program.
Now I'm left with one final decision. All 3 of the number validators work. Which one should I use? Like I said, they all work, but which one seems to have the "best code"?
Option 1
(i_number IN varchar2) RETURN NUMBER IS
v_number NUMBER;
BEGIN
v_number := TO_NUMBER(i_number);
RETURN v_number;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END is_number;
Option 2
(str in varchar2) return number is
v_number number(38);
begin
v_number := to_number(str);
return 1;
exception when value_error then
return 0;
end is_numeric;
Option 3
(n varchar2) return number is
number_hold number;
begin
number_hold := to_number(trim(n));
return number_hold;
exception
when others then
return null;
end; -
Hi,
I'd like to know how can I verify if the variable contains only the data type that I'm expecting for. In SQLSERVER we have the IS_NUMERIC, IS_CHAR... functions. Is there something similar in ORACLE? How can I use it?
Thanks.It is easy enough to test whether a value is numeric. You can create a function like:
CREATE OR REPLACE FUNCTION IS_NUMBER (p_test_val IN VARCHAR2)
RETURN BOOLEAN IS
l_t_val NUMBER;
BEGIN
l_t_val := TO_NUMBER(p_test_val);
RETURN TRUE;
EXCEPTION WHEN VALUE_ERROR THEN
RETURN FALSE;
END;This attempts to convert the value passed in (note that the parameter is a character type) to a number. If it suceeds, then it retrns TRUE. If the conversion causes an error, then the exception handler catches it and returns FALSE.
The BOOLEAN data type is only valid in PL/SQL (and probably other host languages like C or Java), you cannot use this function in a SQL statement. To use this in a SQL statement, then you would need to change the return type to number, and return something like 1 for TRUE and 0 for FALSE.
To use the function in a PL/SQL procedure, you could do something like:
DECLARE
l_val_to_test VARCHAR2(10) := '123';
BEGIN
IF is_number (l_val_to_test) THEN
DBMS_OUTPUT.Put_Line ('Value is a number');
ELSE
DBMS_OUTPUT.Put_Line ('Value is not a number');
END IF;
END;Which would return TRUE.
TTFN
John -
Hi , Please help to get the rows which have a character in the PFNUM column for this table
EMPNU PFNUM NAME
100 222 rat
101 a33 sanu
102 4a4 rahul
our PL/SQL is
1 DECLARE
2 i number;
3 j number;
4 t varchar2(10);
5 CURSOR ratnesh_cur IS
6 select PFNUM from employee;
7 BEGIN
8 OPEN ratnesh_cur;
9 FETCH ratnesh_cur into t;
10 FOR i IN 0..LENGTH(t)
11 loop
12 FOR j IN 0..9
13 loop
14 IF SUBSTR('t',i,1)= j THEN dbms_output.put_line(t);
15 ENDIF;
16 END LOOP;
17 END LOOP;
18 CLOSE ratnesh_cur;
19* END
20 /
END LOOP;
ERROR at line 16:
ORA-06550: line 16, column 5:
PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
if
ORA-06550: line 19, column 3:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
loopTO APC ...
<quote>Which solution is appropriate depends on the spec details.</quote>
Indeed ⦠that is why I provided a simple alternative answering the original question (my interpretation of it extrapolated from the actual data set provided) ⦠I did not comment on your reply.
But let me address your answers:
<quote>The best way of checking whether a value is numeric is to test for failure of the Oracle built-in function TO_NUMBER()</quote>
That would be too strong a statement, wouldnât it?
Let us assume a table with a varchar2 column which we know contains only alphanumeric characters ⦠2097152 rows ⦠half containing only digits ⦠half with a mix of digits, upper and lower alphabetical characters.
flip@FLOP> select count(0) from apc
2 where instr(translate(lower(v)
3 ,'abcdefghijklmnopqrstuvwxyz'
4 ,'xxxxxxxxxxxxxxxxxxxxxxxxxx'),'x') > 0
5 ;
COUNT(0)
1048576
Elapsed: 00:00:05.02
flip@FLOP> select count(0) from apc
2 where is_number(v) = 0
3 ;
COUNT(0)
1048576
Elapsed: 00:00:13.05
âis_numberâ is your function modified to return 1 (true) or 0 (false) instead of the Boolean.
Clearly a solution employing TO_NUMBER is not always the most performant way (as you seem to imply) ⦠all those context switches between SQL and PL/SQL do add up.
Soooo ⦠there is no âmost performant wayâ to check for numeric or non-numeric values for all categories of problems ⦠in fact there isnât even a universal solution ⦠one has to have some knowledge of the data domain being checked and the environment context.
So how about the â?â and '@â? ⦠Is the string â-1?123@99' numeric or not? Having modified your âis_numberâ function yet again to do âln := to_number(pv_string,'9G999G999D99');â â¦
flip@FLOP> select is_number('-1?123@99') from dual;
IS_NUMBER('-1?123@99')
0
NO.
flip@FLOP> alter session set nls_numeric_characters='@?';
Session altered.
flip@FLOP> select is_number('-1?123@99') from dual;
IS_NUMBER('-1?123@99')
1
YES.
But forget about nls settings ⦠how about â-123e2â? ⦠is this numeric or not ?
flip@FLOP> select to_number('-123e2') from dual;
TO_NUMBER('-123E2')
-12300
According to TO_NUMBER, it is numeric ⦠for the person having the knowledge of the data domain being checked that well may be a false positive.
Hope this proves the point about the universal solution and the qualities of TO_NUMBER.
As for <quote>And if the character is uppercase?</quote> ⦠this kind of flipped me ⦠looking at the link supplied by you ⦠and glancing over the implementation of âStringParseâ one could well ask: âand if the string contains lowercase?â ⦠but nobody did ⦠wouldâve been a bit too picky and outside the main technique being demonstrated.
Gabe -
How to use the ColumnDescriptor's type as CLOB?
I want to build a metric which are used to record the content of a file. But the length of the content is too long, it may not be stored with a ColumnDescriptor's type STRING. I tried to make the TYPE='CLOB', but failed. I though it might be something wrong with my output, but I have no idear how to make it right. Does it supposed to point to a file? Could anyone tell me how to do it?
Here is my code:
metadata.xml
<Metric NAME="TEST_LOB" TYPE="RAW" HELP="NO_HELP">
<TableDescriptor TABLE_NAME="TEST_LOB">
<ColumnDescriptor NAME="TIMES" COLUMN_NAME="TIMES" TYPE="STRING" IS_DATE="TRUE"/>
<ColumnDescriptor NAME="CONTENT" COLUMN_NAME="CONTENT" TYPE="CLOB" />
</TableDescriptor>
<QueryDescriptor FETCHLET_ID="OSLineToken">
<Property NAME="command" SCOPE="GLOBAL">"%perlBin%/perl" "%scriptsDir%/emx/%TYPE%/testlob.pl"</Property>
<Property NAME="delimiter" SCOPE="GLOBAL">%mydelimiter%</Property>
<Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
<Property NAME="errStartsWith" SCOPE="GLOBAL">em_error=</Property>
</QueryDescriptor>
</Metric>collection.xml
<CollectionItem NAME="TEST_LOB">
<Schedule>
<IntervalSchedule INTERVAL="5" TIME_UNIT="Min" />
</Schedule>
<MetricColl NAME="TEST_LOB" />
</CollectionItem>The output of script testlob.pl looks like as below. It started with "em_result=", and delimited by "|".
em_result=2009-07-30 15:30:35|*** (1) TRANSACTION:
TRANSACTION 2 1235033361, ACTIVE 0 sec, process no 14811, OS thread id 1158457696 inserting
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 368, undo log entries 4
MySQL thread id 26693314, query id 5239203160 192.168.95.138 passportuser update
insert into digital_id_info (digital_id) values (0x3930303636363734)
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 45 page no 14 n bits 392 index `idx_unq_digitalid` of table `passport/digital_id_info` trx id 2 1235033361 lock mode S waiting
Record lock, heap no 5 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 8; hex 3930303636363734; asc 90066674;; 1: len 4; hex 0014dae7; asc ;;
*** (2) TRANSACTION:
TRANSACTION 2 1235033200, ACTIVE 0 sec, process no 14811, OS thread id 1215965536 setting auto-inc lock
mysql tables in use 1, locked 1
3 lock struct(s), heap size 6752, undo log entries 323
MySQL thread id 26693430, query id 5239203161 10.10.71.74 passportuser update
insert into digital_id_info (digital_id) values (0x3930303637343639)
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 45 page no 14 n bits 392 index `idx_unq_digitalid` of table `passport/digital_id_info` trx id 2 1235033200 lock_mode X locks rec but not gap
Record lock, heap no 5 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 8; hex 3930303636363734; asc 90066674;; 1: len 4; hex 0014dae7; asc ;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `passport/digital_id_info` trx id 2 1235033200 lock mode AUTO-INC waiting
*** WE ROLL BACK TRANSACTION (1)the scripts for creating table "TEST_LOB",
CREATE TABLE TEST_LOB
TIMES DATE,
CONTENT CLOB
);Any help will be appreciated!!!
Thanks,
SatineSorry, that doesn't solve my problem. Please read the question more closely - I want my USERS to be able to do this without changing their configurations. My users are public school elementary teachers and parents. I can't ask them to toggle any settings - I'm looking for a way that my users can do this on their own.
Thanks -
CREATE_DEEP_ENTITY : Multiple Return Values
Hello,
My requirement is to pass some item data to web service & then i use FM to create a Item id for each item passed. So, if i have passed 10 items in input, 10 item ids will be created.
in SEGW model, i have created a entity type ENT1 that has fields Item id & item name ( This is the info i want WS to return in response). Other entity type ENT2 has item data information or fields that i want to input to web service. Then i created a navigation from ENT1 to ENT2 with cardinality as M:N.
So, now if i pass 10 Items info in input, i should get back in response 10 item ids with their name. I hope my requirement is clear.
Then, i have used method CREATE_DEEP_ENTITY to create items & then i have all the items created & their name in an internal table. Then i use below method to send this table in response:
copy_data_to_ref(
EXPORTING
is_data = lt_created_items
CHANGING
cr_data = er_deep_entity
My issue is that i don't see any item in response if i pass here a table in IS_data but if i pass a work area, then thats returned in response.
What could be the reason & how can i solve this?
Regards
Gaurav KHello Gaurav,
That is because the navigation property defined in the model for a particular entity need to be a part of your payload.
Explanation : consider
Say u have an entity ITEM and entity set ITEMSet where u will be sending your item details.
Say u have a header entity PARENT and entity set PARENTSet where u send header info.
Say u have another entity ITEMDETAIL and entity set ITEMDETAILSet ( which will be got from your BE logic as a part of response )
Say u have association & navigation between entities as below :
PARENT to ITEM - 1 to N
PARENT to ITEMDETAIL - 1 to N
Navigation Properties :
PARENT to ITEM - ParentItem
PARENT to ITEMDETAIL - ParentItemDetail
Now in Payload u would send as below :
JSON payload -
"HeaderProperty1":"",
"HeaderPropertyN":"",
"ParentItem":[{
< Your item info >
With this u will fire the Deep Entity, Creation of Items happens and u will send back the response as well. i.e., deep structure holding header,items sent initially in payload and item details which u got as part of successful creation )
But now in response u will not be able to see item details which u got as part of successful creation because the above payload will not have navigation property ParentItemDetail as part of payload so u wont see in response though u send those details as part of your deep structure
So now solution is :
Send the payload as below :
"HeaderProperty1":"",
"HeaderPropertyN":"",
"ParentItem":[{
< Your item info >
"ParentItemDetail":[{
With this u can see the item details which u got as part of successful creation along with your header and items sent initially in payload as well
Regards,
Ashwin -
Re: Column Name as Parameter in Oracle Procedure
Hi,
I've successfully compiled the following procedure:
CREATE OR REPLACE PROCEDURE CREATE_MEASURES_IND_RPT(
pSTART_DT IN date
, pEND_DT IN date
, PGEO_DIMENSION_COLUMN IN VARCHAR2
AUTHID CURRENT_USER IS
BEGIN
DECLARE
START_DT Date := pSTART_DT;
END_DT Date := pEND_DT;
text_ip_adjusted varchar2(10000):='
select
replace(fiscal_yr,''/'') as fiscal_year,
NVL(f_quarter(is_date(disdate,''yyyymmdd'')),''Year'') AS TIME_PERIOD_TYPE,
NVL('||PGEO_DIMENSION_COLUMN||',''Province'') as geo_desc
from data_table A,
postal_code_table B
where POSTCODE = B.POSTALCODE
AND (is_date(disdate,''yyyymmdd'') >= :1 and is_date(disdate,''yyyymmdd'') < :2)
GROUP BY
replace(fiscal_yr,''/''),
ROLLUP(f_quarter(is_date(disdate,''yyyymmdd''))),
ROLLUP('||PGEO_DIMENSION_COLUMN||');
begin
EXECUTE IMMEDIATE text_ip_adjusted using START_DT,END_DT; COMMIT;
END;
END CREATE_MEASURES_IND_RPT;
/When I try and execute the procedure, I get the following error:
ORA-00936: missing expression
ORA-06512: at "CREATE_MEASURES_IND_RPT", line 36
ORA-06512: at line 1The data table has date strings which need to be converted to dates using an "IS_DATE" function I've created which is while you'll see the is_date function used. The procedure works fine when I don't include the PGEO_DIMENSION_COLUMN as a parameter so I suspect that I haven't reference the name of the column properly. Essentially, I need my procedure to be able to specify a Column Name in the Postal Code table to use as a group by field.
Any help would be appreciated.
Thanks,
EdHi,
spalato76 wrote:
Hi,
I've successfully compiled the following procedure:
CREATE OR REPLACE PROCEDURE CREATE_MEASURES_IND_RPT(
pSTART_DT IN date
, pEND_DT IN date
, PGEO_DIMENSION_COLUMN IN VARCHAR2
AUTHID CURRENT_USER IS
BEGIN
DECLARE
START_DT Date := pSTART_DT;
END_DT Date := pEND_DT;
text_ip_adjusted varchar2(10000):='
select
replace(fiscal_yr,''/'') as fiscal_year,
NVL(f_quarter(is_date(disdate,''yyyymmdd'')),''Year'') AS TIME_PERIOD_TYPE,
NVL('||PGEO_DIMENSION_COLUMN||',''Province'') as geo_desc
from data_table A,
postal_code_table B
where POSTCODE = B.POSTALCODE
AND (is_date(disdate,''yyyymmdd'') >= :1 and is_date(disdate,''yyyymmdd'') < :2)
GROUP BY
replace(fiscal_yr,''/''),
ROLLUP(f_quarter(is_date(disdate,''yyyymmdd''))),
ROLLUP('||PGEO_DIMENSION_COLUMN||');
begin
EXECUTE IMMEDIATE text_ip_adjusted using START_DT,END_DT; COMMIT;
END;
END CREATE_MEASURES_IND_RPT;
/When I try and execute the procedure, I get the following error:
ORA-00936: missing expression
ORA-06512: at "CREATE_MEASURES_IND_RPT", line 36
ORA-06512: at line 1The data table has date strings which need to be converted to dates using an "IS_DATE" function I've created which is while you'll see the is_date function used. The procedure works fine when I don't include the PGEO_DIMENSION_COLUMN as a parameter so I suspect that I haven't reference the name of the column properly. Essentially, I need my procedure to be able to specify a Column Name in the Postal Code table to use as a group by field.
Any help would be appreciated.
Thanks,
EdIt l;ooks like you're missing a single-quote at the very end of the expression being assigned to text_ip_adjusted.
... ROLLUP(' || PGEO_DIMENSION_COLUMN || ')';How will you handle the output from that dynamic query? Maybe you should be opening a cursor. -
Error in mapping generation when using a data rule
I hope someone can point me in the right direction on this one. I've searched all over but can't find a similar problem anywhere.
This is OWB Client 10.2.0.1.31 and repository 10.2.0.1.0 in a 10g SE database . I have a table on which I have defined a data rule, which is deployed in the database along with its corresponding error table. The rule I have used is the built-in IS_DATE and it is applied to a VARCHAR2 field that will store a date in a specific format. I have defined the table as an operator in a mapping, and set the IS_DATE data rule action to MOVE TO ERROR. When I try to deploy the mapping I get the follwoing errors in the log:
Warning ORA-06550: line 244, column 4:
PL/SQL: ORA-00907: missing right parenthesis
Warning ORA-06550: line 221, column 3:
PL/SQL: SQL Statement ignored
Warning ORA-06550: line 3112, column 132:
PLS-00103: Encountered the symbol "DD" when expecting one of the following:
. ( ) , * @ % & | = - + < / > at in is mod remainder not
range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member
SUBMULTISET_
The symbol "." was substituted for "DD" to continue.
When I look at the generated code, there are lines like this one:
not (wb_to_date("table"."column", Month dd, RRRR, Mon dd, RRRR, MM-DD-RRRR, MM/DD/RRRR, YYYY-MM-DD, YYYY/MM/DD) is not null
Why is OWB not putting single quotes around the data formats from the built-in data rule? Is there something fundamental I'm missing in my warehouse model?Hi
This is bug 5195315, which looks to be fixed in a 10.2 patch. If you can pick up the latest 10.2 patch there is like 3 years of fixes worth picking up.
Cheers
David -
Error in copy of BCALV_TREE_SIMPLE_DEMO
I copied BCALV_TREE_SIMPLE_DEMO to a z version,
changed it with own structure
DATA: gt_sflight TYPE zhpa_vakantie_struc OCCURS 0, "sflight OCCURS 0, "Output-Table
now when running an error occurs, i think this has to do with the screen collumn layout???????
When in debug mode i see somewhere that the code is looking for fields from structure sflight!
Anyone a clue??
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
tartpunt van runtime error
Programma CL_GUI_ALV_TREE_SIMPLE========CP
Include CL_GUI_ALV_TREE_SIMPLE========CM01G
Regel 13
Moduletype (METHOD)
Modulenaam SET_HIERARCHY_DATA
ectie source code
egel Source
1 method SET_HIERARCHY_DATA.
2
3 data: ls_fieldcat type lvc_s_fcat,
4 ls_new_item type lvc_s_item,
5 l_data type lvc_value.
6
7 field-symbols: <f1> type any.
8 if not is_outtab_line is initial.
9 loop at mt_fieldcatalog into ls_fieldcat where
10 tech is initial.
11 assign component ls_fieldcat-fieldname
12 of structure is_outtab_line to <f1>.
>>>> if not <f1> is initial.
14 * get cell-value
15 call method cl_gui_alv_grid=>cell_display
16 exporting
17 is_data = is_outtab_line
18 i_int_value = <f1>
19 importing
Edited by: Richard van Veen on Oct 28, 2010 2:35 PM
Edited by: Richard van Veen on Oct 28, 2010 2:46 PMMaybe the problem comes from gt_sort then :
form build_sort_table.
data ls_sort_wa type lvc_s_sort.
* create sort-table
ls_sort_wa-spos = 1.
ls_sort_wa-fieldname = 'CARRID'.
ls_sort_wa-up = 'X'.
ls_sort_wa-subtot = 'X'.
append ls_sort_wa to gt_sort.
ls_sort_wa-spos = 2.
ls_sort_wa-fieldname = 'CONNID'.
ls_sort_wa-up = 'X'.
ls_sort_wa-subtot = 'X'.
append ls_sort_wa to gt_sort.
ls_sort_wa-spos = 3.
ls_sort_wa-fieldname = 'FLDATE'.
ls_sort_wa-up = 'X'.
append ls_sort_wa to gt_sort.
endform. " BUILD_SORT_TABLE
However, you get this error because there are differences between the structure of the table containing your data and the ones defining your field catalog or the sorting order. -
Validation - Business Rule or/and UJ_Validation
Hi experts,
I'm on BPC 7.5 NW, I'm facing problem to construct a simple validation where I need to compare the amount from one parent account against to other. Let's explain the business scenario and after the technical solutions.
Business Scenario
Compare the Total Assets is equal to the Total Liabilities. The Total Assets is represented by a parent account "1", the Total Liabilities is represented by a parent account "2". If it is different show a warning.
This is need to trigger, after the Actual Transactional Data Load + Journals.
Technical Solution
Application: Legal
Dimensions: Empresa (Entity), Conta (Account), Fonte (C_DataScr), Versao (C_Category), Groups, Intco, MesAno (Time), TipMov (Flow), CCusto (User Defined), CLucro (User Defined)
1 - Business Rule
Validation Definition
Validation Account Remark Validation Operand Other destination dimension Members Validation Tolerance
ZATIVO_X_PASSIVO Ativo x Passivo = CONTA=VALIDATIVPASS,INTCO=SPTOTAL,CLucro=ACTEDUMMY,CCusto=ACTENONE 0
Account 1 Flow 1 Sign 1 Account 2 Flow 2 Sign 2 Remark
1 TMTOTAL* 1 2 TMTOTAL* 1 Ativo x Passivo
*The TMTotal Flow is a parent from every data on the master data TipMov (flow)
Validation.lgf
*RUN_PROGRAM VALIDATION
CATEGORY = %VERSAO_SET%
CURRENCY = %GROUPS_SET%
TID_RA = %MESANO_SET%
OTHER = [ENTITY=%EMPRESA_SET%]//For More than one other scope parameters: OTHER = [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]
*ENDRUN_PROGRAM
Result
When I run with this parameters I receive the message : "UJP_PROCESS_EXCEPTION:Data for category not found in application LEGAL"
2 - Validation with UJ_Validation
Assign the driver dimension to Legal - in case I used the CONTA (Account)
Rule Maintenance
Assigned Member: "1" and "2"
Use Logic Table
Dimension = Empresa (Entity)
Operator "="
Members = TECSA - This is a parent from every Entities.
Result
When I run with this parameters I receive the message : "UJP_PROCESS_EXCEPTION:Data for category not found in application LEGAL"
3 - Validation with UJ_Validation and BADI
Assign the driver dimension to Legal - in case I used the CONTA (Account)
Rule Maintenance
Assigned Member: "1" and "2"
Use BAdI Implementation
BADI_UJ_VALIDATION_RULE_LOGIC
Create a Enhancement ZATIVO_X_PASSIVO
Filter
Rule_Num = 1
APPSET_ID = ZTECSA
DIMENSION = CONTA
Class
METHOD if_uj_validation_rule_logic~do_validation_logic.
FIELD-SYMBOLS:
<field1> TYPE ANY,
<field2> TYPE ANY.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE is_data TO <field1>.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE is_data TO <field2>.
IF <field1> NE <field2>.
es_message-message = 'Error in Validation'.
es_message-recno = 1.
es_message-MSGTY = 'W'.
ENDIF.
ENDMETHOD.
And add this line to the script
*START_BADI_UJ_VALIDATION_RULE_LOGIC~DO_VALIDATION_LOGIC
QUERY = ON
WRITE = ON
*END_BADI
Result
Data Region:
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CCUSTO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CLUCRO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CONTA WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:FONTE WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:INTCO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:TIPMOV WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] MEASURES IS NOT SPECIFIED!
So what could I make to maintain all my options to do what I need ?
I appreciate any help
Best Regards
Alexandre Mendoza CollepicoloHi,
Just to check, can you try and hardcode the category in the rules itself...just for a test to see if it is working.
You can have the category mentioned as CATEGORY=ACTUAL in the rules itself for Other source dimension members and other destination members. J
This is to check if the validation package runs successfully or not.
Thanks,
Sreeni -
Badi for Business partner contact person creation
Hi Experts
Kindly tell me what badi can I use to trigger error while creating the BP in role contact person , the requirement here is to check the email for duplication and throw the error
Thanks & Regards
RajasekharHi,
I think you can use BUPR_CONTP_CREATE to create contact persons or Badi BUPR_CONTP_CHANGE to change COntact Person Data. I give you a code example when I have used BUPR_CONTP_CHANGE to change data of contact persons:
SELECT * FROM but051 INTO TABLE lt_but051 WHERE dprtmnt NE space.
SORT lt_but051 BY relnr.
MOVE ls_but051-dprtmnt TO ls_babi_persona_contacto-comments.
MOVE 'X' TO ls_babi_persona_contacto_x-comments.
CALL FUNCTION 'BUPR_CONTP_CHANGE'
EXPORTING
iv_partner = ls_but051-partner1
iv_contactperson = ls_but051-partner2
iv_date_to = ls_but051-date_to
is_data = ls_babi_persona_contacto
is_data_x = ls_babi_persona_contacto_x
TABLES
et_return = lt_return_bapi.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = lt_return_co.
Maybe you are looking for
-
Creating a PDF from a database
Hi all I hope somebody could help here as I have been around and around trying to work this out Problem: PDF creation from a database I have a database which has all the text information to create a PDF. All images are from the web and are not stored
-
How to copy and paste text from a web site viewed in Chrome using the Xperia z3v?
I have searched high and low for a way to copy and paste text from a web site in Chrome using the Xperia z3v. I've tried a long tap, a double tap, a triple tap - nothing works. I am able to select text, copy and paste it in a Word doc, however. The
-
hi guys, i was involved in Master data distribution using Message Types MATMAS, DEBMAS and CREMAS but never created a customer specific Message Type that is why, i just want to know in what cases do we have to create our own message type's using we31
-
Installing Forms Server on Windows 2000
We installed Forms Server 6i on Windows 2000. We completed the installation successfully. When we clicked on the 'Run the Form on the Web.', it gives 'This page cannot be displayed.' error. We tried this twice, but getting same error. Any suggestions
-
Events "full day" does not appear in Notification Center
hello, Events " full day " does not appear in Notification Center on my iPhone 6 If I add an event at a specific time today , this event is displayed. Otherwise , the part calendar ( on today's page ) show " no events " even if there is one or more e