cancel
Showing results for 
Search instead for 
Did you mean: 

The identifier is already defined in Datasphere SQL view

jlopezm
Participant
0 Kudos
85

Hello Datasphere Experts

I'm having a problem that doesn't make any sense to me.

I created a SQL view where I perform a left outer join with a local table called NFPZ. Its semantic use is dimension, it's stored on disk, and it works correctly. This table is located in the same space as the SQL view.

The problem is that I'm getting an error like "The identifier "n_1" is already defined."

jlopezm_0-1746014625661.png

left outer join "NFPZ" as n_1 on
	nbew_op.mandt = n_1.mandt and
	nbew_op.einri = n_1.einri and
	nbew_op.falnr = n_1.falnr and
	nbew_op.lfdnr = n_1.lfdbw and
	(n_1.storn = '' or n_1.stdat = '00000000') and
	(n_1.farzt = '6' or n_1.farzt = 'E' or n_1.farzt = 'F') and
	not exists (
		select 1
		from "NFPZ" as n2
		where
			n2.mandt = n_1.mandt and
			n2.einri = n_1.einri and
			n2.falnr = n_1.falnr and
			n2.lfdbw = n_1.lfdbw and
			(n2.storn = '' or n2.stdat = '00000000') and
			(n2.farzt = '6' or n2.farzt = 'E' or n2.farzt = 'F') and
			to_int(n_1.lfdnr) > to_int(n2.lfdnr)
	)

Things I've checked:

I don't use that identifier anywhere else in the code.
The syntax of the entire code is correct and validated.

  1. I've tried removing the quotes, and it doesn't work.
  2. I've tried removing the alias that currently has "n_1," and it doesn't work.
  3. I've tried enclosing the alias in quotes (double and single), and it doesn't work.
  4. I've changed the case of the alias to lowercase, and it doesn't work.
  5. I've changed the order of the joins, and it doesn't work either.
  6. I've checked the table and its definition, and it's correct.

I don't understand this Datasphere error. I don't understand why no documentation appears, and I'm running out of ideas to fix it.

Could you please help me?

Thank you very much in advance.

Accepted Solutions (0)

Answers (0)