Feed unique values into effect parameters of duplicated pre-comps?
I have a pre-composition with some fairly complex particle systems that I would like to duplicate multiple times in a final comp.
The trick is that I want to apply a unique "position XY" value to the various effects inside each precomp instance. I already have the values chained together with the pick-whip inside the pre-comp, so all the "position XY" values can be moved as a unit.
Is it possible to feed unique effect values down into the stack of pre-comps using expressions or some other trick?
You can't have one instance of a set of precomps that renders differently when used multiple times.
You would have to create multiple sets of those precomps and put different values in each. You could do this by saving the set of precomps as a project then importing it multiple times. Or there's a script for duplicating a comp heirarchy here: http://aescripts.com/true-comp-duplicator/
Before doing that you could use expressions to feed a random value into certain properties so they would automatically be different in each duplicate set. For example this would put in a random XY position value:
seedRandom(1,true);
x = random(0,640);
y = random(0,480);
[x,y];
Similar Messages
-
Passing 'ALL' value into Two Parameters in SAP Crystal Reports
Hi,
I have one report made it from sql command in that there is 2 parameters one is C_Type and other is C_Type_HV both shows the records like 01,02,03,05 both the parameters are used in command where clause and also that report contain one sub report for showing summary made it from sql command in that command both the parameters are passing through where clause of command now i want to add 'ALL' as a value in both the parameters how i can do this in sap crystal report.
for referance I give u both the query of report
With Regards,
GaneshHi Ganesh,
Please have a look at this thread on how to add 'ALL' as a value for the prompt.
All values in parameter
-Abhilash -
Hi everyone,
Using the Writer block, configured with a correct SQLAzure instance, I experience this error:
- Error 1000: AFx Library library exception: Sql encountered an error: These columns don't currently have unique values.
I have read that this error can be related to inheritance problems, but my table does not have inheritances of any kind:
CREATE TABLE [dbo].[my_table](
[my_float] [float] NULL
) ON [PRIMARY]
GO
Writer block parameters:
Comma separated list of columns to be saved:
temp (from Bike Rental UCI Dataset)
Data Table name: [dbo].[my_table]
Comma separated list of datatable columns:
[my_float]
The experiment from which I have extracted the writing part was able to correctly write to DB until few days ago. Is it possible that some changes in the platform are causing this issue or am I doing something wrong?
Thank you and best regards,
FVHi Maureen,
Yes, the scenario is correct. On SQL profiler I can't see any SQL operation that can lead to that kind of error, but as you were saying it was worth trying anyway having that error message.
New test scenario:
CREATE TABLE [dbo].[my_table_identity](
[ID] [int] IDENTITY(1,1) NOT NULL,
[my_float] [float] NULL,
CONSTRAINT [PK_my_table_identity] PRIMARY KEY CLUSTERED
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
) ON [PRIMARY]
-- These lines work fine on SQL Management Studio
INSERT INTO [dbo].[my_table_identity] (my_float) VALUES (1.23)
INSERT INTO [dbo].[my_table_identity] (my_float) VALUES (1.23)
INSERT INTO [dbo].[my_table_identity] (my_float) VALUES (1.23)
-- I can see all new rows with each one a different ID
SELECT * FROM [dbo].[my_table_identity]
dbo is the default schema for my Azure login.
New writer block parameters:
Comma separated list of columns to be saved: temp
(from Bike Rental UCI Dataset)
Data Table name: my_table_identity
Comma separated list of datatable columns: my_float
I still get the same error: Error 1000: AFx Library library exception: Sql encountered an error: These columns don't currently have unique values.
I have also tried to pass the "instant" column instead of "temp", as it hasn't any duplicated values, but still no luck.
I attach the log file (purged of sensitive information) because I see some error / warnings there.
https://dl.dropboxusercontent.com/u/40411467/azure_log.txt
Thank you again and best regards,
FV -
Need to test if a column have unique values or not
Hi all,
in ETL process I need to check if some cols have unique values or not using sql or plsql.
Suppose we need to load a big file data with external table initially and then test if values
on one or more columns have unique values in order to proceed with ETL process.
What is the faster test I can execute to verify that a column have unique values or not?
It's better for the ETL performance, use:
a. techniques regard constraints like described on Ask tom forum
"ENABLE NOVALIDATE validating existing data"
(Ask Tom "ENABLE NOVALIDATE validating existing da...")
b. "simply" query on the data?
like this:
select count(count(*)) distinct_count,
sum(count(*)) total_count,
sum(case when count(*) = 1 then 1 else null end) non_distinct_groups,
sum(case when count(*) > 1 then 1 else null end) distinct_groups
from hr.employees a
group by A.JOB_ID
c. use analytics function?
d. use some feature directly on external table?
Bye in advanceHere is the example to handling the errrs using LOG_ERRORS into concept. You will check this and let me know if any doubt you have
DATAFILE:-
1000,ANN,ZZ105
1001,KARTHI,ZZ106
1002,PRAVEEN,ZZ109
1002,PARTHA,ZZ107
1003,SATHYA,ZZ108
1000,ANN,ZZ105
----- Original Table With unique constraints
SQL> CREATE TABLE tab_uniqtest(student_id NUMBER(10) UNIQUE,
student_name VARCHAR2(15),
course_name VARCHAR2(15)
2 3 4
Table created.
----- External table
SQL> CREATE TABLE tab_extuniqtest(student_id NUMBER(10),
2 student_name VARCHAR2(15),
3 course_name VARCHAR2(15)
4 )
5 ORGANIZATION EXTERNAL
6 (
7 DEFAULT DIRECTORY ann_dir
8 ACCESS PARAMETERS
9 (
10 RECORDS DELIMITED BY NEWLINE
11 BADFILE 'tabextuniqtest_badfile.txt'
12 LOGFILE 'tabextuniqtest_logfile.txt'
13 FIELDS TERMINATED BY ','
14 MISSING FIELD VALUES ARE NULL
15 REJECT ROWS WITH ALL NULL FIELDS
16 (student_id,student_name,course_name)
17 )
18 LOCATION ('unique_check.csv')
19 )
20 REJECT LIMIT UNLIMITED;
Table created.
---- Error logging table to log the errors
SQL> CREATE TABLE dmlerrlog_uniqtest(ORA_ERR_NUMBER$ NUMBER ,
2 ORA_ERR_MESG$ VARCHAR2(2000),
3 ORA_ERR_ROWID$ ROWID,
4 ORA_ERR_OPTYP$ VARCHAR2(2),
5 ORA_ERR_TAG$ VARCHAR2(4000),
6 inserted_dt VARCHAR2(50) DEFAULT TO_CHAR(SYSDATE,'YYYY-MM-DD'),
7 student_id VARCHAR2(10)
8 );
Table created.
---- Procedure to insert from external table
SQL> CREATE OR REPLACE PROCEDURE proc_uniqtest
2 AS
3 v_errcnt NUMBER;
4 BEGIN
5 INSERT INTO tab_uniqtest
6 SELECT * FROM tab_extuniqtest
7 LOG ERRORS INTO dmlerrlog_uniqtest('PROC_UNIQTEST@TAB_UNIQTEST') REJECT LIMIT UNLIMITED;
8 SELECT COUNT(1) into v_errcnt
9 FROM dmlerrlog_uniqtest
10 WHERE ORA_ERR_TAG$ = 'PROC_UNIQTEST@TAB_UNIQTEST';
11 IF(v_errcnt > 0) THEN
12 ROLLBACK;
13 ELSE
14 COMMIT;
15 END IF;
16 DBMS_OUTPUT.PUT_LINE ( 'Procedure PROC_UNIQTEST is completed with ' || v_errcnt || ' errors') ;
17 EXCEPTION
18 WHEN OTHERS THEN
19 RAISE;
20 END proc_uniqtest;
21 /
Procedure created.
SQL> SET SERVEROUTPUT ON
SQL> EXEC proc_uniqtest;
Procedure PROC_UNIQTEST is completed with 2 errors
PL/SQL procedure successfully completed.
SQL> SELECT STUDENT_ID,ORA_ERR_MESG$ FROM dmlerrlog_uniqtest;
STUDENT_ID ORA_ERR_MESG$
1002 ORA-00001: unique constraint (
SCOTT.SYS_C0037530) violated
1000 ORA-00001: unique constraint (
SCOTT.SYS_C0037530) violated -
Unable to Enforce Unique Values, Duplicate Values Exist
I have list in SP 2010, it contains roughly 1000 items. I would like to enforce unique values on the title field. I started by cleaning up the list, ensuring that all items already had a unique value. To help with this, I used the export
to excel action, then highlight duplicates within Excel. So as far as I can tell, there are no duplicates within that list column.
However, when I try to enable the option to Enforce Unique Values, I receive the error that duplicate values exist within the field and must be removed.
Steps I've taken so far to identify / resolve duplicate values:
- Multiple exports to Excel from an unfiltered list view, then using highlight duplicates feature > no duplicates found
- deleted ALL versions of every item from the list (except current), ensured they were completely removed by deleting from both site and site collection recycle bins
- Using the SP Powershell console, grabbed all list items and exported all of the "Title" type fields (Item object Title, LinkTitle, LinkTitleNoMenu, etc) to a csv and ran that through excel duplicate checking as well.
Unless there's some rediculous hidden field value that MS expects anyone capable of attempting to enforce unique values on a list (which is simple enough for anyone to figure out - if it doesn't throw an error), then I've exhausted anything I can think
of that might cause the list to report duplicate values for that field.
While I wait to see if someone else has an idea, I'm also going to see what happens if I wipe the Crawl Index and start it from scratch.
- JonFirst, I create index for a column in list settings, it works fine no matter duplicate value exists or not;
then I set enforce unique values in the field, after click OK, I get duplicate values error message.
With SQL Server profiler, I find the call to proc_CheckIfExistingFieldHasDuplicateValues and the parameters. After reviewing this stored procedure in content database,
I create the following script in SQL Server management studio:
declare @siteid
uniqueidentifier
declare @webid
uniqueidentifier
declare @listid
uniqueidentifier
declare @fieldid
uniqueidentifier
set @siteid='F7C40DC9-E5D3-42D7-BE60-09B94FD67BEF'
set @webid='17F02240-CE04-4487-B961-0482B30DDA84'
set @listid='B349AF8D-7238-419D-B6C4-D88194A57EA7'
set @fieldid='195A78AC-FC52-4212-A72B-D03144DC1E24'
SELECT
* FROM TVF_UserData_List(@ListId)
AS U1 INNER
MERGE JOIN
NameValuePair_Latin1_General_CI_AS
AS NVP1 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_MatchUserData)
ON NVP1.ListId
= @ListId AND NVP1.ItemId
= U1.tp_Id
AND ((NVP1.Level
= 1 AND U1.tp_DraftOwnerId
IS NULL)
OR NVP1.Level
= 2)
AND NOT((DATALENGTH(ISNULL(NVP1.Value,
= 0)) AND U1.tp_Level
= NVP1.Level
AND U1.tp_IsCurrentVersion
= CONVERT(bit, 1)
AND U1.tp_CalculatedVersion
= 0 AND U1.tp_RowOrdinal
= 0 INNER
MERGE JOIN
NameValuePair_Latin1_General_CI_AS
AS NVP2 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_CI)
ON NVP2.SiteId
= @SiteId AND NVP2.ListId
= @ListId AND NVP2.FieldId
= @FieldId AND NVP2.Value
= NVP1.Value
AND NVP2.ItemId <> NVP1.ItemId
CROSS APPLY TVF_UserData_ListItemLevelRow(NVP2.ListId, NVP2.ItemId,
NVP2.Level, 0)
AS U2 WHERE ((NVP2.Level
= 1 AND U2.tp_DraftOwnerId
IS NULL)
OR NVP2.Level
= 2)
AND NOT((DATALENGTH(ISNULL(NVP2.Value,
= 0))
I can find the duplicate list items based on the result returned by the query above.
Note that you need to change the parameter values accordingly, and change the name of NameValuePair_Latin1_General1_CI_AS table based on the last parameter of the
proc_CheckIfExistingFieldHasDuplicateValues stored procedure. You can review the code of this stored procedure by yourself.
Note that direct operation on the content database in production environment is not supported, please do all these in test environment. -
Get unique values from Parent List in Dropdown List SPServices
I have a dropdown list created using the SPServices ($().SPServices.SPCascadeDropdowns). It works as it should, I just need to add a requirement. I need to be able to filter the Parent Lookup list to show only unique values.
$().SPServices.SPCascadeDropdowns({
relationshipList: "ROInsComp",
relationshipListParentColumn: "AIP-RY",
relationshipListChildColumn: "NameAndCode",
parentColumn: "AIP-RY",
childColumn: "NameAndCode",
debug: true});
The issue is that in AIP-RY I have stored Years and each year could be repeated several times
I followed some of the recommendations from this blog:
GetListItems Unique Values
I this is what I tried:
$.ajax({
url: weburl+'https://my-site/_layouts/filter.aspx?ListId='+escape('{544C8B6A-C9B3-4BAD-B9CF-B032E5FD07DB}')+'&FieldInternalName='+"AIP-RY" + '&ViewId='+escape('{4B433420-156F-4F4F-9E3C-551DC43B593C}')+'&FilterOnly=1&Filter=1',
success: function(data) {
alert('It worked!');}
No luck so far! Thanks!
EMThanks for looking into this. I'm not sure this would work: SPServices.SPCascadeDropdowns
only works (as far as I know) for elements from the same list.
EM -
Getting unique values from internal table
Hi Gurus,
From time to time I hit this problem and so far I havn't found any nice solution. I've an internal table with several fields. I would like to get all unique values for one (or several) of these fields. However let say that this table has a lot of entries so making a copy is not an option. Also changing this table in any way is forbiden.
For example for table below I would like to get all unique values for field Number. In this case it would be 1,2,3,4.
Name | Number |
name1 | 1|
name2 | 2|
name3 | 2|
name4 | 3|
name5 | 4|
name5 | 3|
Can anyone propose me better solution than going in the loop through all entries in table? Maybe there is some ABAP functionality that I don't know about?
BR
Marcin CholewczukLet's say that if I sort this table I won't be able to restore it to previous order which is important for me
True...If you sort the table you won't be able to restore. So the only option is to copy/move all the records into another table.
Sorting If you need to retrive unique values. I don't think without sorting the table would be a nice idea and proper programming to proceed ahead.
Regarding logic, as replied earlier
Either we can go with DELETE ADJACENT DUPLICATES or proceed as replied in my earlier post. There might be number of algorithms to resolve this. But we cannot go ahead without sorting or looping. -
Get previous items unique value in new add item form
Hi
I have on list having items related to multiple locations.
Every location is related to one user.
When user logs in it filters the list with that users location.
Now when user click on add new item I want to get the data related to his location using item event listener.
But in new item form there is no way to get the location of that user in event listener as its new item.
So I passed the qury string parameter form list and changed the add item form link and form to get the query string paramter as default value in Add new Item form.
But again when user clicks on save button it redirects to original url without paramter.
How to redirect user to url with parameter on click on Save/Cancel.
Is there any other way to get the previous item unique value in add new item from before executing the event listener?Hi,
According to your post, my understanding is that you wanted to redirect user to url with parameter on click on Save/Cancel.
You need to modify the onclick event need to as below:
javascript: {{ddwrt:GenFireServerEvent('__redirect={{Home.aspx?Participant={@Participant}&@Activity={@Activity}}}')}}
Here is a similar thread for your reference:
http://social.technet.microsoft.com/Forums/en-US/b506cfe5-650e-4017-b470-9ca0a75cd390/sharepoint-2010-list-how-to-pass-parameters-in-a-url-to-another-page?forum=sharepointcustomizationprevious
In addition, you can creating an intermediate page which just finds the filed value with a DVWP and then redirect to RedirectURL with the filed value on the Query String.
For more information, you can refer to:
Redirect to Another Page from NewForm.aspx with the New Item’s ID
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Problem in Showing multiple values into one text box.
Hi all,
How can show i multiple row values into one text box. here text box is multi line type.
i have one table it has content column, it has number of rows. i need to show those data into one text box in form. how can i solve it?
my sample code here,
egin
--:block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
-- go_item('txt_from');
insert into chat(fromid,toid,content)values(:block3.fromid,:block3.toid,:block3.txt_From);
:block3.txt_From:= null;
commit;
:block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
go_item('txt_from');
declare
cursor c4 is select content from chat where toid = :block3.fromid;
rec1 c4%rowtype;
begin
open c4;
loop
fetch c4 into rec1;
exit when c4%notfound;
null;
end loop;
end;
--select content into :block3.txt_to from chat where toid= :block3.fromid;
end;
please give me some tips to solve it.
thanks
gurusHi,
Try giving CHR(10) for line feed.
DECLARE
CURSOR C4 IS SELECT CONTENT FROM CHAT WHERE TOID = :BLOCK3.FROMID;
Str_Temp VARCHAR2(20);
BEGIN
:BLOCK3.TXT_TO := '';
OPEN C4;
LOOP
FETCH C4 INTO Str_Temp;
EXIT WHEN C4%NOTFOUND;
:BLOCK3.TXT_TO := :BLOCK3.TXT_TO || CHR(10) || Str_Temp;
END LOOP;
CLOSE C4;
END;Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks. -
How do I count the unique value pairs in two columns of a table?
I have a table (Table 2) that is populated with data from an imported .csv file. On table 1 I need to count the unique value pairs in two columns of Table 2.
Here's what I have:
Date Person
7/10/2011 A
7/12/2011 W
7/12/2011 X
7/12/2011 X
7/12/2011 X
7/12/2011 Z
7/14/2011 Z
7/15/2011 X
7/16/2011 Z
I'm focusing on person "X" and can easily count how many days that person shows up but what I want is to see on how many unique days that person shows up.
Here's the result I'm looking for (Person "X" shows up on 2 different days - 3 times on 7/12/2011 and once on 7/15/2011):
X 2
I can't seem to find a function that allows me to do that. I also am not allowed to modify Table 2 so that leaves me to come up with a solution on Table 1.
Any ideas would be greatly appreciated.Hi John,
Not being allowed to modify Table 2 is a minor inconvenience. Just copy (using a formula) the necessary two columns onto Table 1.
Yellow columns may be hidden. The procedure progresses from left to right. All formulas are entered into row 2 then filled down that column to the end of the table. The table must be as long as the list in column A of Table 2.
A2: =Table 2::A
Fill right to column B.
Fill both columns down as far as needed.
I've used actual Date and Time values in column A, formatted to show only the Date part, but the technique will work with text in these cells, provided all cells representing the same 'date' have exactly the same content.
C2: =A&B
This concatenates the contents of each row of columns A and B into a single text string.
D2: =COUNTIF($C$2:C2,C)
This counts the number of occurrences of the Date&Name string on the current row from the first regular cell in column C (C2) to the current cell.
E2: =IF(COUNTIF($B$2:B2,B)=1,MAX($E$1:E1)+1,"")
This constructs the index of first occurrences of each name, in the order they first occur. The index is used by LOOKUP in column F.
F2: =IF(ROW()-1>MAX(E),"",LOOKUP(ROW()-1,$E,$B))
This uses the index value created in E as a search-for value to extract a single copy of the names in column B. The result is a list of all distinct names in the list. Note that spelling differences will be counted as distinct names.The IF statement stops the listing when the last distinct name is extracted.
G2: =IF(LEN(F)>0,COUNTIFS($B,"="&F,$D,"=1"),"")
This counts the number of 'first occurrences of distinct Date & Name strings for each name on the list (ie. the number of distinct dates on which each name appears in the original list).
All of the functions used are described, with at least one example for each, in the iWork formulas and Functions User Guide. You can download the guide, and the Numbers '09 User Guide, via the Help menu in numbers.
Regards,
Barry -
Mapping Problem.. I Need to pass Unique value everytime to Target filed.
Hi All,
I need to pass some unique value everytime the message processed to the target field.
Source filed ---> Target Field
can anyone has the UDF to generate like this.. ?
I heard that through RFCLookup we can do that.. by maintaing some table and taking 2 parameters one as input and one as output and everytime when the message processes it will add by one to the previous value and pass to the target field.
I dont know much about these lookups..
Can anyone through some light on this, how i can solve this issue.??
Waiting for your answers.
Thanks&Regards
Deepthi.Hi Liang,
That's my exact issue.Please let me know when you find the solution.
Actually i tried with some UDF.. its generating unique values whenever mapping is executed.But when we Reboot the system we found that its reinitializing again from "1".
So definetly we need to maintain the count in some database and system has to update evytime according to that.
Iam trying something by calling RFC from UDF and updating the Ztable by incrementing everytime.
I wil let you know if i find any solution..
Meanwhile anyone wants to suggest me... Please respond.
Thanks
Deepthi. -
I am facing a problem in passing multiple values as out parameters from fo
Hi All,
i am facing a problem in passing multiple values as out parameters from for loop.
EX:
i have a select statment inside a loop like.....
PACKAGE SPEC:
create or replace PACKAGE EMP_PKG AS
TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
temp_table TAB_NUM;
procedure test(temp_TAB_e_no OUT TAB_NUM,
temp_TAB_e_name OUT TAB_NAME,
temp_TAB_e_job OUT TAB_JOB);
END EMP_PKG;
PACKAGE BODY:
create or replace PACKAGE BODY EMP_PKG AS
v_e_no NUMBER;
procedure test(temp_TAB_e_no OUT TAB_NUM,
temp_TAB_e_name OUT TAB_NAME,
temp_TAB_e_job OUT TAB_JOB) IS
BEGIN
select EMPNO bulk collect into temp_table from emp;
for i in 1..temp_table.count loop
v_e_no := temp_table(i);
select empno,
ename,
job
into temp_TAB_e_no(i),
temp_TAB_e_name(i),
temp_TAB_e_job(i)
from emp
where empno = v_e_no;
end loop;
end test;
END EMP_PKG;
PROBLEM FACING IS:
I am expecting all rows returning from bellow select statment ...
select empno,
ename,
job
into temp_TAB_e_no(i),
temp_TAB_e_name(i),
temp_TAB_e_job(i)
from emp
where empno = v_e_no;
But,while running the SP , i am getting error like
ORA-06531: Reference to uninitialized collection
ORA-06512: at "SCOTT.EMP_PKG", line 16
why i am not getting all values as out parameters.please provide a solution for me.
Thanks in advance my friend.user9041629 wrote:
Hi All,
i am facing a problem in passing multiple values as out parameters from for loop.
EX:
i have a select statment inside a loop like.....
PACKAGE SPEC:
create or replace PACKAGE EMP_PKG AS
TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
temp_table TAB_NUM;
procedure test(temp_TAB_e_no OUT TAB_NUM,
temp_TAB_e_name OUT TAB_NAME,
temp_TAB_e_job OUT TAB_JOB);
END EMP_PKG;
PACKAGE BODY:
create or replace PACKAGE BODY EMP_PKG AS
v_e_no NUMBER;
procedure test(temp_TAB_e_no OUT TAB_NUM,
temp_TAB_e_name OUT TAB_NAME,
temp_TAB_e_job OUT TAB_JOB) IS
BEGIN
select EMPNO bulk collect into temp_table from emp;
for i in 1..temp_table.count loop
v_e_no := temp_table(i);
select empno,
ename,
job
into temp_TAB_e_no(i),
temp_TAB_e_name(i),
temp_TAB_e_job(i)
from emp
where empno = v_e_no;
end loop;
end test;
END EMP_PKG;
PROBLEM FACING IS:
I am expecting all rows returning from bellow select statment ...
select empno,
ename,
job
into temp_TAB_e_no(i),
temp_TAB_e_name(i),
temp_TAB_e_job(i)
from emp
where empno = v_e_no;
But,while running the SP , i am getting error like
ORA-06531: Reference to uninitialized collection
ORA-06512: at "SCOTT.EMP_PKG", line 16
why i am not getting all values as out parameters.please provide a solution for me.
Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
This is a horrible way to return the contents of a table.
Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code. -
Import screen field value into search help assigned to a different field
Hi,
I have created an elementary search help based on a custom DDIC table ZSH_SHHLDR. Dialog Type: Dialog depends on set of values, search help parameters:
Parameter Import Export LPos SPos SDis
FOLIO X 1 1 X
CERTN X 2 2
where FOLIO and CERTN are fields in my table.
There are two fields in my program defined as like FOLIO and CERTN respectively. These fields are screen fields in a custom dynpro created using Screen Painter. The search help is assigned to the CERTN field. In the screen, I want that the contents of the FOLIO field should be imported into the search help, i.e. on the screen:
FOLIO: 21353
CERTN: <F4>
When I click on F4 help for CERTN, I want that the FOLIO parameter in the search help should contain the value for FOLIO that I entered in the text box on the screen. Is there a way to do this, through an exit for instance? Help is appreciated, thanks.
RegardsHi,
You need to use the below statement.
process on value-request.
field zcom_doa_users-zzjob_role module sub_tes_module.
Here I declared three fields in the screen fields from structure zcom_doa_users. Try to name the fields with table name-field name. So inside the module in structure zcom_doa_users you will get given value for the other fields also.
Now you can do your own processing for f4 help.
Thanks
Subhankar -
I want to update the unique values, if they are not inserted... Please help in this regard
CREATE OR REPLACE PROCEDURE PR IS
lv_operator VARCHAR2(1) := 'N';
TYPE subset_rt IS RECORD
ltt_whse_loc oe_sales_ord_commit.whse_loc%TYPE,
ltt_shape oe_sales_ord_commit.shape%TYPE,
ltt_isize oe_sales_ord_commit.isize%TYPE,
ltt_grade oe_sales_ord_commit.grade%TYPE,
ltt_length oe_sales_ord_commit.length%TYPE,
ltt_pieces NUMBER,
ltt_inv_lbs_commit oe_sales_ord_commit.inv_lbs_commit%TYPE,
ltt_roll_lbs_commit oe_sales_ord_commit.roll_lbs_commit%TYPE,
ltt_ishcom_lbs oe_sales_ord_commit.ishcom_lbs%TYPE);
TYPE subset_aat IS TABLE OF subset_rt
INDEX BY PLS_INTEGER;
aa_subset subset_aat;
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(dml_errors, -24381);
BEGIN
lv_operator := sy_checkpriv(USER,
'SY_OPERATIONS');
SELECT whse_loc,
shape,
isize,
grade,
length,
0,
inv_lbs_commit,
roll_lbs_commit,
ishcom_lbs
BULK COLLECT INTO aa_subset
FROM oe_sales_ord_commit_temp
WHERE processed_datetime IS NULL
AND username = decode(lv_operator,
'Y',
username,
USER);
BEGIN
FORALL indx IN 1 .. aa_subset.COUNT SAVE EXCEPTIONS
INSERT INTO
(SELECT loc,
shape,
isize,
grade,
length,
pieces,
inv_lbs_commit,
roll_lbs_commit,
ishcom_lbs FROM oe_inventory_temp)
VALUES
aa_subset(indx);
EXCEPTION
WHEN OTHERS THEN
*+<<Trap the rows that have failed due to dup_val_on_index exception and update the inv_lbs_commit,+*
*+roll_lbs_commit, ishcom_lbs columns in oe_inventory_temp table>>+*
-- loc,shape, isize,grade, length, pieces are composite primary keys.
errors := SQL%BULK_EXCEPTIONS.COUNT;
DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
FOR i IN 1..errors LOOP
DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
DBMS_OUTPUT.PUT_LINE('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
DBMS_OUTPUT.PUT_LINE(aa_subset(SQL%BULK_EXCEPTIONS(i).ERROR_INDEX));
END LOOP;
END;
END PR;
/Due to the following restriction a number of simple collections is used instead of the collection of records.
[FORALL Statement|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm#sthref2742]: You cannot refer to individual record fields within DML statements called by a FORALL statement. Instead, you can specify the entire record with the SET ROW clause in an UPDATE statement, or the VALUES clause in an INSERT statement.
10g syntax of FORALL statement is used:
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 11.02.2009 567
SQL> desc a
Name Null? Type
INT NOT NULL NUMBER(38)
DT DATE
STR VARCHAR2(20)
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 11.02.2009 567
SQL> DECLARE
2 TYPE T_Int_List IS TABLE OF A.Int%TYPE INDEX BY PLS_INTEGER;
3 TYPE T_Dt_List IS TABLE OF A.Dt%TYPE INDEX BY PLS_INTEGER;
4 TYPE T_Str_List IS TABLE OF A.Str%TYPE INDEX BY PLS_INTEGER;
5
6 vInts T_Int_List;
7 vDts T_Dt_List;
8 vStrs T_Str_List;
9
10 eBulk_Error EXCEPTION;
11 PRAGMA EXCEPTION_INIT(eBulk_Error, -24381);
12 BEGIN
13 vInts(1) := 2;
14 vDts(1) := sysdate - 1;
15 vStrs(1) := '888';
16
17 vInts(2) := 3;
18 vDts(2) := sysdate - 22;
19 vStrs(2) := '0000';
20
21 BEGIN
22 FORALL indx IN INDICES OF vInts SAVE EXCEPTIONS
23 INSERT INTO A(Int, Dt, Str)
24 VALUES(vInts(indx), vDts(indx), vStrs(indx));
25 EXCEPTION
26 WHEN eBulk_Error THEN
27 DECLARE
28 vErr_Count INTEGER;
29 vErr_Message VARCHAR2(2000);
30 vErr_Indices T_Int_List;
31 BEGIN
32 vErr_Count := SQL%BULK_EXCEPTIONS.COUNT;
33 -- Getting the indices of rows with duplicate key
34 -- FOR vI IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP - Doesn't work for some reason on 10.2.0.1.0
35 FOR vI IN 1 .. vErr_Count LOOP
36 IF SQL%BULK_EXCEPTIONS(vI).Error_Code <> 1 THEN
37 -- Error other that duplicate key is reraised
38 vErr_Message := SQLERRM(-SQL%BULK_EXCEPTIONS(vI).Error_Code);
39 Raise_Application_Error(-20001, vErr_Message);
40 END IF;
41 vErr_Indices(SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX) := SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX;
42 END LOOP;
43
44 -- Bulk update
45 FORALL vI IN INDICES OF vErr_Indices
46 UPDATE A SET
47 Dt = vDts(vI),
48 Str = vStrs(vI)
49 WHERE Int = vInts(vI);
50 END;
51 END;
52 END;
53 /
PL/SQL procedure successfully completed.
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 09.02.2009 888
3 19.01.2009 0000Regards,
Dima
Edited by: DimaCit on Feb 10, 2009 10:39 AM -
Count of unique values in 7 columns
Hey there…
I have a Lookup table with 8 columns
ID = unique ID
U = Sunday,
M = Monday
T = Tues
W = Weds
R = Thur
F = Fri
S = Sat
Each of the ‘day’ columns can have a value between 1 and 1150, looks like this
ID U M T W R F S
1 15 15 16 15 17 345 17
What I am trying to find is a count of the deviation of each row… or how many of the days have different values
So for the above example
ID U M T W R F S COUNT
1 15 15 16 15 17 345 17 4
As there are 4 unique values in the week..
15,16,17,345
Any ideas on how that could be done in oracle? Stumped!Yep, pre-11g:
CREATE TABLE temp (id INTEGER, col_1 INTEGER, col_2 INTEGER, col_3 INTEGER, col_4 INTEGER, col_5 INTEGER, col_6 INTEGER, col_7 INTEGER);
INSERT INTO temp VALUES (1000, 1, 2, 3, 4, 5, 6, 7);
INSERT INTO temp VALUES (1001, 7, 2, 3, 4, 5, 6, 7);
INSERT INTO temp VALUES (1002, 1, 1, 1, 1, 1, 1, 1);
SELECT * FROM temp
ORDER BY id;
SELECT id, COUNT (DISTINCT col)
FROM (
SELECT id, col_1 col FROM temp UNION
SELECT id, col_2 FROM temp UNION
SELECT id, col_3 FROM temp UNION
SELECT id, col_4 FROM temp UNION
SELECT id, col_5 FROM temp UNION
SELECT id, col_6 FROM temp UNION
SELECT id, col_7 FROM temp
GROUP by id
ORDER BY 1;
Table dropped.
Table created.
1 row created.
1 row created.
1 row created.
ID COL_1 COL_2 COL_3 COL_4 COL_5 COL_6 COL_7
1000 1 2 3 4 5 6 7
1001 7 2 3 4 5 6 7
1002 1 1 1 1 1 1 1
ID COUNT(DISTINCTCOL)
1000 7
1001 6
1002 1
Maybe you are looking for
-
Organizer and external hard drive
I have 20,000 pictures in Organizer, and am always terrified of losing my work here, captions tags etc, which happened once before. So, I do periodical back-ups. As I use Organizer for all of my work, I have not worried about folders, which are a mes
-
I've just been messing around with some AVCHD...tut. Using Log and Transfer, the files are coming in as 2560 x 1080 pixels and there's no way to get it to behave in the timeline. It seems to be in some mega cinemascope frame size. No matter what you
-
I purchased a song on this Mac, an authorized computer. I am now getting a message that this computer is not authorized to play the song. When I provide my username and password to authorize my computer, the song is still not authorized. Why?
-
Airport Extreme not connecting to AT&T DSL, not using a modem
It seems that all the fixes I read are about are bridging a modem but I do not have a modem. I unplugged my Netgear Router and plugged in my Extreme and my Mac Book pro sees the Extreme but no internet. Amber light will not turn green.
-
I'm trying to use my roomates HP All-in-one scanner/printer, and I sucsessfully installed all required software... restarted the comper, and did a test print. The printer works with my iBook, but whenever i try to "scan", "HP Scan Pro" pops up on my