Einzelnen Beitrag anzeigen

NormanNG

Registriert seit: 1. Feb 2006
294 Beiträge
 
Delphi 2007 Professional
 
#2

Re: Temp Tabellen in Stored Procedure

  Alt 7. Aug 2008, 16:08
Hi,

du muss der temp.Tabelle einen Aliasnamen geben und damit arbeiten:

SQL-Code:
SELECT
  hyp_planning.HSP_OBJECT.OBJECT_ID, hyp_planning.HSP_OBJECT.PARENT_ID, hyp_planning.HSP_OBJECT.OBJECT_NAME,
  A.ALIAS, -- <-- Alias der Tabelle = A
  hyp_planning.HSP_OBJECT.GENERATION, hyp_planning.HSP_OBJECT.POSITION, hyp_planning.HSP_OBJECT.HAS_CHILDREN
FROM
  hyp_planning.HSP_MEMBER
INNER JOIN @AliasTable A -- <---- Alias der Tabelle = A
  ON hyp_planning.HSP_MEMBER.MEMBER_ID = A.MEMBER_ID -- <-- hier nochmal ...
RIGHT OUTER JOIN hyp_planning.HSP_OBJECT
  ON hyp_planning.HSP_MEMBER.MEMBER_ID = hyp_planning.HSP_OBJECT.OBJECT_ID
WHERE (hyp_planning.HSP_OBJECT.OBJECT_NAME = @NODETEXT)
Gruß
Norman
  Mit Zitat antworten Zitat