Home » Developer & Programmer » Reports & Discoverer » REP-1241: Circular column dependency originating with column
REP-1241: Circular column dependency originating with column Tue, 30 September 2014 02:12
 mist598 Messages: 1194Registered: February 2013 Location: Hyderabad Senior Member
Hi,

```Function CF_MMM_formula
RETURN NUMBER
IS
v_qty NUMBER;
v_qty := (:CF_MON + :CF_A1 + :CF_A2 + :CF_A3 + :CF_A4 + :CF_A5 + :CF_A6);
return nvl(v_qty, 0);
end;

REP-1241: Circular column dependency originating with column 'CF_MMM'

FUNCTION Cf_formula RETURN NUMBER
IS
v_qty NUMBER;
Begin
IF :CF_MMM < 0 THEN AND Nvl(:cf_Fixed, 0) = 0 THEN
IF Nvl(:cf_Min_Qty, 0) = 0 THEN
v_qty := Abs(:CF_MMM);
RETURN Nvl(v_qty, 0);
END IF;

v_qty := Nvl(:cf_Min_Qty, 0);

IF v_qty >= Abs(:CF_MMM) THEN

RETURN Nvl(v_qty, 0);
END IF;

IF Nvl(:cf_Fixed, 0) > 0 THEN

LOOP
v_qty := v_qty + Nvl(:cf_Fixed, 0);

exit WHEN v_qty >= Abs(:CF_MMM);
END LOOP;

RETURN Nvl(v_qty, 0);
END IF;

v_qty := Abs(:CF_MMM);

RETURN Nvl(v_qty, 0);
END IF;
RETURN Nvl(v_qty, 0);
End;
```

Thanks

[Updated on: Tue, 30 September 2014 02:13]

Report message to a moderator

Re: REP-1241: Circular column dependency originating with column [message #624998 is a reply to message #624993] Tue, 30 September 2014 02:34
 mist598 Messages: 1194Registered: February 2013 Location: Hyderabad Senior Member
Re: REP-1241: Circular column dependency originating with column [message #625004 is a reply to message #624998] Tue, 30 September 2014 03:59
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
Where do CF_MON, CF_A1 etc come from?
Re: REP-1241: Circular column dependency originating with column [message #625006 is a reply to message #625004] Tue, 30 September 2014 04:18
 mist598 Messages: 1194Registered: February 2013 Location: Hyderabad Senior Member
Quote:
Where do CF_MON, CF_A1 etc come from?

In the CF_A1 i am used in the another CF_formula column so it is a huge code

My Question..

suppose i have CF_A1 (name of the formula column name)
```function CF_A1Formula return Number
is
.......
......
......
```

Suppose i need to use CF_A1 in the another formula column like
```function CF_A2Formula return Number
is
if :CF_A1<0 then
...
...
end if;

or

if :CF_A1Formula<0 then
...
...
end if;

which one is correct in the above code?
```

[Updated on: Tue, 30 September 2014 04:20]

Report message to a moderator

Re: REP-1241: Circular column dependency originating with column [message #625009 is a reply to message #625006] Tue, 30 September 2014 05:12
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
You should reference the name of the formula column not the underlying function.
Re: REP-1241: Circular column dependency originating with column [message #625010 is a reply to message #625009] Tue, 30 September 2014 05:18
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
So the Cf_formula in the first post is used to calculate CF_A1?
Re: REP-1241: Circular column dependency originating with column [message #625026 is a reply to message #625009] Tue, 30 September 2014 07:13
 mist598 Messages: 1194Registered: February 2013 Location: Hyderabad Senior Member
Quote:
You should reference the name of the formula column not the underlying function.

```if :CF_A1<0 then

CF_A1-->This is the Name of the Formula column name not a function name
CF_A1Formula--> is the Function name in the CF_A1

otherwise give an example.
```

Quote:
So the Cf_formula in the first post is used to calculate CF_A1?

Yes..
Re: REP-1241: Circular column dependency originating with column [message #625031 is a reply to message #625026] Tue, 30 September 2014 08:27
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
So CF_A1 is used to calculate CF_MMM and CF_MMM is used to calculate CF_A1.
The problem is pretty obvious isn't it - each one relies on the other being calculated first, so neither can be calculated.
Re: REP-1241: Circular column dependency originating with column [message #625066 is a reply to message #625031] Wed, 01 October 2014 01:42
 mist598 Messages: 1194Registered: February 2013 Location: Hyderabad Senior Member
Quote:

So CF_A1 is used to calculate CF_MMM and CF_MMM is used to calculate CF_A1.
The problem is pretty obvious isn't it - each one relies on the other being calculated first, so neither can be calculated.

Thank you so much for helping cookiemonster..leave it on the above question please

My Question is:
```function CF_C9Formula return Number is
v_qty number(10);
begin
v_qty := (:CF_1+:CF_2);
return nvl(v_qty, 0);
end;
```

```And used CF_C9 calculate beloe column

function CF_C99_PlusFormula return Number is
begin
return (:CF_C9 + :CF_A1 + :CF_A2);
end;
```

```function CF_a99Formula return Number is
v_qty number(10);

begin

v_qty := 0;

If :CF_C99_Plus < 0 THEN
.....
.....
.....
END if;
end;
```

And i am doubting on the "CF_C99_PlusFormula" is this correct?

And i am getting below error's
```REP-0069: Internal error
REP-57054: In-process job terminated:Terminated with error:
REP-271504897:
```

```[u]REP-271504897:[/u]
when all of the followings are true :

1. desformat=XML
2. The query is based on a table which has a "LONG" column
3. The length of the data in LONG column is 8192 bytes or larger. (When NLS_LANG and the database characterset does not match exactly -for example one is UTF8 and the other is WE8ISO8859P1- it fails even sooner, that is after 2730 characters)

When a character returning formula column returns NULL, memory leak
happens. This increases the memory usage exorbitantly, which results in
the REP error from Report Server.
```
Re: REP-1241: Circular column dependency originating with column [message #625078 is a reply to message #625066] Wed, 01 October 2014 03:57
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
I can't see anything obviously wrong but I don't know what cf_a1 and cf_a2 are.
You might want to consider doing these calculations in the SQL statement itself rather than formula columns.
 Previous Topic: detail and summary report Next Topic: do not show title of fields
Goto Forum:

Current Time: Sun Aug 07 16:32:25 CDT 2022