Undisplayed Physical query SQL Server 208

Hi,
I am querrig an SQL Server 2008 database with OBIEE. But the physical query syntax isn't dispalayed in the nqQuery.
I got a message seems to History unfound.
Is there any way to get the physical query on database different from oracle like SQL server or XML...?
Thanks

Can you check the logging level of the user you are logging as ?
I guess because the logging level is not defined hence no history for this user !!

Similar Messages

  • Undisplayed Physical query SQL Server 2008

    Hi,
    I am querrig an SQL Server 2008 database with OBIEE. But the physical query syntax isn't dispalayed in the nqQuery.
    I got a message seems to History unfound.
    Is there any way to get the physical query on database different from oracle like SQL server or XML...?
    Thanks

    Can you check the logging level of the user you are logging as ?
    I guess because the logging level is not defined hence no history for this user !!

  • I want to query sql server database from oracle

    i want to query sql server database from oracle
    can anyone help me in this regard

    First of all - you are in the wrong forum.
    Look either for the Database general or search for Transparant / Heterogenous Gateways.
    cu
    Andreas

  • MS Access querying SQL Server: How to configure Network ACL?

    I need to set up a highly restrictive ACL for access to a particular SQL server in our network.  This ACL will reside on our core switch at the "front door" of our network and permit access to the SQL server only using the ports that
    are necessary.  The purpose is to A) Try to keep unauthorized users from gaining access to the host server and B) Should someone somehow gain unauthorized access to the host server. keep them from being able to "hop off" to other PC's on
    the network. 
    The server will be accessed by clients using MS Access to query the SQL database and bring back reports.  A few admins are actually able to make minor changes to the database such as updating a user list or location list. In other words, both
    read and write access is needed to the SQL database.
    I know that the default SQL server port is 1433, but according to a Microsoft Support article I read, "client ports are assigned a random value between 1024 and 5000".
    I was really hoping I could just put something like "permit PC1 access to SQL Server on Port 1433" in my ACL, but after reading the MS Support article it sounds like I've got to allow almost 4,000 ports through?
    Could someone help demystify this for me so I can build the right ACL?

    The tool to use is SQL Server Configuration Management.
    But what you can configure is which port SQL Server listens to. Which port the client listens to is not controllable as far as I know. But that can of course be many, since a client can have many connections to SQL Server. (And the range is not
    restricted to 1024-5000. I connected over TCP locally, and I see this with netstat -a
      TCP    127.0.0.1:6621         NATSUMORI:ms-sql-s     ESTABLISHED
    Then again, I don't see why you would have to open any ports for the clients at all. I have never heard of this being a problem.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Query sql server- oracle

    hi, i have this query in sql server :
    select *
    from x, com y, com z
    where x.a *= y.a and x.b *=z.a
    in oracle it's not supported ( i think) a query like:
    select *
    from x, com y, com z
    where x.a (+)= y.a and x.b (+)=z.a
    what's the solution??!
    thanks!

    This may not be best solution I guess - The query is
    untested .
    select people.name , max(b_city) , max(c_city) from
    select people.name, b_city.name b_city , null r_city
    from people, city b_city, city r_city
    where people.id_birthplace(+)=b_city.id
    union all
    select people.name, null b_city , r_city.name
    from people, city r_city
    where people.id_residence(+)=r_city.id
    group by people.nameWell after fixing your typos...
    SQL> ed
    Wrote file afiedt.buf
      1  WITH people as (select 1 as id, 'Fred' as name, 1 as id_birthplace, 1 as id_residence from dual union all
      2                  select 2, 'Bob', 3, null from dual union all
      3                  select 3, 'Jim', null, 2 from dual)
      4      ,city as   (select 1 as id, 'London' as name from dual union all
      5                  select 2, 'Birmingham' from dual union all
      6                  select 3, 'Manchester' from dual)
      7  -- END OF TEST DATA
      8  select name , max(b_city) , max(r_city) from (
      9    select people.name, b_city.name b_city , null r_city
    10    from   people, city b_city, city r_city
    11    where  people.id_birthplace(+)=b_city.id
    12    union all
    13    select people.name, null b_city , r_city.name
    14    from   people, city r_city
    15    where  people.id_residence(+)=r_city.id
    16    )
    17* group by name
    SQL> /
    NAME MAX(B_CITY MAX(R_CITY
         Birmingham Manchester
    Bob  Manchester
    Fred London     London
    Jim             Birmingham
    SQL>Seems that we've gained a new unnamed person

  • Error en Query : [SQL Server] Error de Division entre 0

    Maestros !!
    Tengo este problema:
    Al ejecutar una query me figura este error " [SQL Server] Error de Division entre 0 ". Entiendo el error, cualquier numero divido por 0 arroja este problema, mi pregunta es como lo hago para no considerar las operaciones con resultado 0. Al revisar las operaciones que esta resumiendo la funcion AVG existen operaciones con resultado 0.
    La query es la siguiente:
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 01'
    INTO #FV01 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='01'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 02'
    INTO #FV02 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='02'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 03'
    INTO #FV03 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='03'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 04'
    INTO #FV04 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='04'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 05'
    INTO #FV05 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='05'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 06'
    INTO #FV06 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='06'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 07'
    INTO #FV07 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='07'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 08'
    INTO #FV08 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='08'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 09'
    INTO #FV09 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='09'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 11'
    INTO #FV11 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='11'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 12'
    INTO #FV12 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode IN('12','12A','12B','12C')
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 14'
    INTO #FV14 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='14'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 20'
    INTO #FV20 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='20'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 221'
    INTO #FV21 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='221'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 22'
    INTO #FV22 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='22'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT T3.FirmCode, T3.FirmName, SUM(T1.Quantity) as 'Cantidades', AVG(T1.Price) as 'Precio Venta Promedio', AVG(T1.StockPrice) as 'Costo Promedio', SUM(T1.LineTotal) as 'Venta Neta', AVG((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100) as 'Margen Almacen 23'
    INTO #FV23 FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  INNER JOIN OITM T2 ON T2.ItemCode = T1.ItemCode LEFT OUTER JOIN OMRC T3 ON T3.FirmCode = T2.FirmCode
    WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'  and ISNULL(T0.Indicator,'') <> 'NL' and T0.DocType ='I' and T1.WhsCode ='23'
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    ---SELECCION DE DATOS
    SELECT T3.FirmCode, T3.FirmName as 'Proveedor',
    (Select T201.[Margen Almacen 01] From  #FV01 T201 where T201.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 01',
    (Select T202.[Margen Almacen 02] From  #FV02 T202 where T202.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 02',
    (Select T203.[Margen Almacen 03] From  #FV03 T203 where T203.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 03',
    (Select T204.[Margen Almacen 04] From  #FV04 T204 where T204.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 04',
    (Select T205.[Margen Almacen 05] From  #FV05 T205 where T205.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 05',
    (Select T206.[Margen Almacen 06] From  #FV06 T206 where T206.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 06',
    (Select T207.[Margen Almacen 07] From  #FV07 T207 where T207.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 07',
    (Select T208.[Margen Almacen 08] From  #FV08 T208 where T208.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 08',
    (Select T209.[Margen Almacen 09] From  #FV09 T209 where T209.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 09',
    (Select T211.[Margen Almacen 11] From  #FV11 T211 where T211.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 11',
    (Select T212.[Margen Almacen 12] From  #FV12 T212 where T212.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 12',
    (Select T214.[Margen Almacen 14] From  #FV14 T214 where T214.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 14',
    (Select T220.[Margen Almacen 20] From  #FV20 T220 where T220.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 20',
    (Select T221.[Margen Almacen 221] From  #FV21 T221 where T221.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 221',
    (Select T222.[Margen Almacen 22] From  #FV22 T222 where T222.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 22',
    (Select T223.[Margen Almacen 23] From  #FV23 T223 where T223.[FirmCode] = T3.FirmCode) as 'Margen Venta Local 23'
    INTO #RESULT FROM OITM T2 LEFT OUTER JOIN OMRC T3 ON T3.FirmCode =T2.FirmCode
    GROUP BY T3.FirmCode, T3.FirmName
    ORDER BY T3.FirmName
    SELECT * FROM #RESULT where isnull([Margen Venta Local 01],0) <> 0
    or isnull([Margen Venta Local 02], 0) <> 0
    or isnull([Margen Venta Local 03], 0) <> 0
    or isnull([Margen Venta Local 04], 0) <> 0
    or isnull([Margen Venta Local 05], 0) <> 0
    or isnull([Margen Venta Local 06], 0) <> 0
    or isnull([Margen Venta Local 07], 0) <> 0
    or isnull([Margen Venta Local 08], 0) <> 0
    or isnull([Margen Venta Local 09], 0) <> 0
    or isnull([Margen Venta Local 11], 0) <> 0
    or isnull([Margen Venta Local 12], 0) <> 0
    or isnull([Margen Venta Local 14], 0) <> 0
    or isnull([Margen Venta Local 20], 0) <> 0
    or isnull([Margen Venta Local 221], 0) <> 0
    or isnull([Margen Venta Local 22], 0) <> 0
    or isnull([Margen Venta Local 23], 0) <> 0
    ---FIN
    Agradeciendo vuestra ayuda.

    Buenas Tardes Eloy
    Al revisar todas las transacciones una a una, ninguna de ellas en el campo T1.LineTotal tiene como resultado el valor 0 ya que el campo T1.LineTotal es el monto neto de la venta (sin impuestos) y este nunca es 0 ya que tenemos validaciones antes de crear el documento.
    El valor 0 aparece como resultado de esta operación ((1-((T1.Quantity*T1.StockPrice)/T1.LineTotal))*100), ya que en varios ventas se vendió al mismo precio del costo del producto debido a promociones o liquidaciones de stock, por lo tanto el resultado 0 en dicha operación es correcto.
    Cuando a estas operación le aplico la función AVG para resumir datos comienza el problema.
    Que me sugieres que realice?
    Agradeciendo tu ayuda.

  • PS Query, SQL Server and prompts

    Hello,
    I try to create a query with a where clause like this :
    field = :1 or :1 = ' '
    so the SQL is :
    SELECT A.F1
    FROM PS_TAB A
    WHERE A.F2 = :1
    OR :1 = ' '
    My problem is when I execute it, if I fill the prompt I have the message :
    "A SQL error occurred. Please consult your system log for details.
    Erreur lors de l'exécution requête en raison d'une erreur SQL, Code=8010, Message=[Microsoft][SQL Native Client][SQL Server]Invalid column name 'ACC010'. (50,380)"
    and if I don't fill the prompt I have :
    "A SQL error occurred. Please consult your system log for details.
    Erreur lors de l'exécution requête en raison d'une erreur SQL, Code=8601, Message=[Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor. [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '='. [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared. (SQLSTATE 37000) 8180 (50,380)"
    Do you know how I can solve this ?
    I am on SQL Server 2005 and peoplesoft 8.45.
    Thanks in advance for your help.

    Thanks to take a look at my problem but I have just solved it (I just had to put in my criteria ' ' = :1 instead of :1 = ' '). So you can forget.

  • Query: SQL Server Book Recommendations

    Hi folks!
    There are Books Online. There are the SAP Notes and Documents created by people like Jürgen Thomas (THANKS!!!) ...
    There are many sources of information in the WWW - blogs, documents, discussons ...
    And there are many BOOKS. Too many ...
    I ask you to recommend your favourite books about SQL Server.
    Your recommendations should help all of us to buy those books which are helpful ...
    Kind regards, Rudi

    Hi Rudolf,
      Do you focus only on SQL server, not including Windows Server Failover Cluster and SAP? If yes, I  recommend you to ask in MSDN -> Database Engine.
    Because this is a SAP on SQL forum, I will talk a little bit about WSFC and SAP. Here is my MATERIAL list. Hope this helps.
    PS: These are very useful for troubleshooting and performance optimization. Regarding to reviews, there are so many people wrote in Amazon in great detail. I will skip it.
    1. Search "Failover Cluster" from MS TechEd 2008~2014
    2. Search "SQL Server Performance/Query/execution plan/AlwaysOn" from MS TechEd 2008~2014
    3. A book "Microsoft SQL Server 2005 administrator’s companion"
    3.5 Troushooting Sql Server ( Troubleshooting SQL Server: A Guide for the Accidental DBA )
    4. A material from SAP course "BC 490: ABAP Performance & Tuning"
    5. CD 262: Tune Your Custom ABAP Code.
    6. Performance Do’s and Don’ts – ABAP: http://service.sap.com/performance
    7. SAP performance optimization guide: http://www.amazon.com/SAP-Performance-Optimization-Guide-Edition/dp/1592293689
    8. Juergen best practices: http://scn.sap.com/docs/DOC-1006
    9. SAP DBA Cockpit and Microsoft SQL Server | SCN
    10. DBA Cockpit SQL scripts: http://blogs.msdn.com/b/saponsqlserver/archive/2007/06/05/sap-dbacockpit-and-some-related-sql-scripts-part-1.aspx
    11. Search "Enhancment Package/Solution Manager" from SAP TechEd

  • Querying SQL server table from Oracle database 11g

    Hi all
    We are using oracle database 11g R2 on REL 5 and i have an SQL server database used by one of our application.
    In my Oracle database, i want to query one table in my SQL server database and to link it in a table in Oracle database to compare data.
    Is there a way like database link or something else to do this need>
    Please send a link or pots here step by step the way on how to accomplish my query.
    Thank you.

    Yes, you can set up your SQL Server as an external database link, using Oracle Heterogeneous Services with SQL Server as an ODBC connection (easier to do if your Oracle server is a Windows server, a little more tricky if your Oracle server is *nix based)
    Here's the documentation... for 11gR2
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=heterogeneous+services

  • Formulating a count query - sql server 2012

    Hello,
    I am quite new to SQL and even though I can handle simple queries I have run into a problem. Maybe you can help :-)
    This is how the table I want to query from is structured:
       id   From                                 To                      
        Anomalies         
       1         01-08-2014 00:00:00       01-08-2014 00:30:00        24
       2       01-08-2014 00:00:00       01-08-2014 00:30:00
     80
       3         01-08-2014 00:00:00       01-08-2014 00:30:00        11
       4         01-08-2014 00:00:00       01-08-2014 00:30:00        10
       5         01-08-2014 00:00:00       01-08-2014 00:30:00        90
       1         01-08-2014 00:30:00       01-08-2014 01:00:00        20
       2         01-08-2014 00:30:00       01-08-2014 01:00:00        74
       3         01-08-2014 00:30:00       01-08-2014 01:00:00        11
       4         01-08-2014 00:30:00       01-08-2014 01:00:00        100
       5         01-08-2014 00:30:00       01-08-2014 01:00:00         98
    The problem is to write a query that will return the number of anomalies per department for the month of, say, July 2014. The final result set should have 5 records.
    Does anyone have any ideas?
    Thx

    Thanks. The month condition is what I am after though :-) Would thiS WORK:select id, sum (Anomalies) as monthlySum from yourtable
    WHERE Datename(month, From) = 'July' and DatenaME(month, To) = 'July'
    group by id?Thanks.

  • Querying SQL Server Data

    I have to pull information from a SQLServer in a PL/SQL procedure. I have tried to create a database link, but that hasn't worked. Any Ideas?
    Thanks.

    through Oracle JVM try to create a java program using JDBC read from SQLSERVER and write into oracle table, this can called through oracle proceudure

  • Outer join query for SQL server from Oracle

    Hi All,
    My question is regarding making queries from Oracle to SQL Server database thorugh DBLink.
    In my oracle database I have a DBLink emp.world for SQL Server database.
    I need to query SQL Server data from oracle (so that this query can be combined with other oracle tables).
    Query is given below:
    SELECT
            a."EmpID" as "Employee ID",
            a."EmpStatus" "Employee Status"
            b."EmpSub" as "Employee Subjects"
    FROM
            [email protected] a
            left outer join [email protected] b on a."EmpID" = b."suEmpID"
    ORDER BY  a."EmpID";My problem is when I run the same query from oracle, it does not show the EmpID that does not exist in Subjects table, but when run from actual SQL Server database, it shows all the records.
    Samples are given below:
    Run from Oracle
    Employee ID      Employee Status     Employee Subjects
    101                     Active                     Maths
    102                     Active                     Maths
    102                     Active                     Physics
    104                   Inactive                  Chemistry
    Run form SQL Server
    Employee ID      Employee Status     Employee Subjects
    101                     Active                     Maths
    102                     Active                     Maths
    102                     Active                     Physics
    103                 Active                       NULL
    104             Inactive            ChemistryI am not sure why in oracle outer join for SQL server tables is not working. What is the right way for outer join in this case.
    I am using oracle database 10gR2 and SQL Server 2005.
    Please Help.
    Thanks.

    SELECT
    a."EmpID" as "Employee ID",
    a."EmpStatus" "Employee Status"
    b."EmpSub" as "Employee Subjects"
    FROM
    [email protected] a
    left outer join [email protected] b on a."EmpID" = b."suEmpID"
    ORDER BY a."EmpID";
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175
    From your description, it appears you may need a right outer join. You want to get back all the rows from 'B', not from 'A'. Try a right join and let us know.

  • How to get hardware related metrics of SQL Server through query ?

    Hi Folks,
                   I am newbie to the SQL Server programming. I also follow this forum only now. I am not sure if these kind of question had been asked in the past. Let me furnish you more detail about my query. I do like
    to get few details regarding the SQL server. I do need the following details to get the information about it through query
    SQL Server Installation directory
    No. Of CPU(as i read SQL Server standard support 4 cpu and Enterprise support 32 CPU)
    CPU Speed of the SQL Server installed machine
    Disk Storage details
    Operating system on which the SQL Server is installed
    Location of the swap file of SQL Server
    TempDB directory path
    System database directory path
    User database location 
    Log files location
    I do like to get information like this through query. Can i know if such information can be get through query or it should be get only thro' WMI. Please drop your ideas in getting these details.
    Thanks in Advance,
    Regards,
    JeiSurya

    Try this query in the below link 
    http://gallery.technet.microsoft.com/Query-to-find-all-the-8fa765e6
    you will get the SQL Server and H/W Details like 
    IP Address 
    FQDN 
    CurrentSQLNodeName 
    SQL Instance Name 
    SQL Server Product
    SQL Server Edition 
    Service Pack 
    SQL Server Version 
    Operating System
    OS SP Level
    OS Build Number
    SystemManufacturer 
    Processor Type 
    System Model 
    Total RAM in MB 
    NumberOfPhysicalCPUs 
    NumberOfCoresInEachCPU 
    TotalNumberOfCores 
    NumberOfLogicalCPUs

  • Imapact of SQL Server Analysis services

    Hi 
    What will be the impact of installing analysis services on an existing SQL Server database which is shared among different web applications Project Server 2013 (PWA) and other SharePoint Applications?In my
    environment SQL Server database is shared between PWA and another sharepoint web applicaiton, so before installing I want to understand its impact on database and the other SharePoint Web application.
    Please help
    Himanshu
    Himanshu

    I may impact your Server and SQL Server performance significantly. 
    This is a common architecture in which both the SQL Server relational DB Engine and Analysis Services instances are running on the same server. In this scenario, it is absolutely crucial to override the defaults for both instances in order to prevent resource
    contention, memory pressure, and (in the worst case) memory exception errors.
    Consider
    SQL Server memory configuration after installing Analysis services, which includes
    Minimum Server Memory 
    Maximum Server Memory
    Minimum Memory per query (only for advance users)
    At the same time you have to set the
    memory configuration for SSAS engine also you have to consider
    LowMemoryLimit
    TotalMemoryLimit
    HardMemoryLimit
    Remember, other than SQL Server and Analysis service other application in your server will be consuming memory. And the most important part is to leave memory for OS to run properly. 
    So, General formula to set Hard limit of SSAS could be (but not limited to)
    Hard Memory Limit = Total Physical Memory - SQL Server Instance min - OS memory (include other application too)
    Disclaimer: Above formula is just for demonstration purpose only; should not be applied
    on production without complete analysis. 
    Worth to notice that SSAS does create its own database for cube so other than memory you need to plan about disk space (if you have limited space)

  • Oracle 10g dblink to sql server 2005

    Hi all,
    I'm conecting oracle 10g r2 (windows xp) with sql server 2005 (windows 2003 server)
    After configure ODBC connection to SQLSERVER, the DSN is called HUAWEI_DCDB
    I configure these three (3) archives:
    1) C:\oracle\product\10.2.0\db_1\hs\admin\initHUAWEI_DCDB.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an ODBC Agent.
    # HS init parameters
    HS_FDS_CONNECT_INFO = HUAWEI_DCDB
    HS_FDS_TRACE_LEVEL = OFF
    2) C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = mpr-1420)(PORT = 1522))
    SID_LIST_LISTENERSQL =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = HUAWEI_DCDB)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = hsodbc)
    LISTENERSQL =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1523))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    3) C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    LISTENER_ORCL =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mpr-1420)(PORT = 1522))
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mpr-1420)(PORT = 1522))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    HUAWEI_DCDB =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1523))
    (CONNECT_DATA=(SID=hsagent))
    (HS=OK)
    And when I tried to query sql server trought dblink, get these errors:
    SQL> create public database link HUAWEI_DCDB using 'HUAWEI_DCDB';
    Database link created.
    SQL> select * from tbl_policyinfo@HUAWEI_DCDB;
    select * from tbl_policyinfo@HUAWEI_DCDB
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from HUAWEI_DCDB
    Anyone have idea about the error???
    Thanks,
    Manuel

    Hi,
    You have the wrong values in the tnsnames.ora entry.
    You have -
    HUAWEI_DCDB =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1523))
    (CONNECT_DATA=(SID=hsagent))
    (HS=OK)
    but the CONNECT_DATA information is incorrect. it should be -
    HUAWEI_DCDB =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1523))
    (CONNECT_DATA=(SID=HUAWEI_DCDB))
    (HS=OK)
    The sid needs to match the sid defined in the listener.ora for the gateway.
    The actual tnsnames.ora entry should have spaces at the beginning of each line except the first, as they are lost in the forum entries.
    Once this is fixed you may also have a problem unless you put a user and password in the create database link statement -
    create public database link HUAWEI_DCDB connect to "userid" identified by "password" using 'HUAWEI_DCDB';
    One other point is that 10.2 HSODBC is now desupported and has been replaced by the 11g Database Gateway for ODBC (DG4ODBC). You should plan to install and use that instead of HSODBC to be on a fully supported product.
    Regards,
    Mike
    Edited by: mkirtley on Nov 9, 2010 8:16 AM

Maybe you are looking for

  • Safari quit unexpectedly while using the AOSAccounts plug-in

    Hello, since this morning I cannot open Safari. Here is the crash report that appears every tim I try to open it. Thanks for help PlugIn Path:       /System/Library/PrivateFrameworks/AOSAccounts.framework/Versions/A/AOSAccounts PlugIn Identifier: com

  • DVD won't play disc

    Having trouble playing DVD discs.  Some are okay and others won't play

  • Hide Industry Sector Field after giving it a defalut value

    Hi!! I want to hide industry secor field in material master initial screen . Also as industry sector is a mandatory field i want the system to take a default value all the time without ever displaying it . Pls tell me the settings . Regards , Anis

  • MOV files won't Import in Premiere Pro 1.5

    Hi I just got a Zodak zi8. When I try to import the MOV files, the importer reports a "generic error". It doesn't matter the quality of video I shoot.  HD, 720 60 frames, 720 30 frames.  It doesn't read it. They play in Quicktime, they play in Window

  • How do I work around large AIR Installer file for app updates?

    I develop AIR apps which often come with many included files (pdf, doc, swf, images, etc).  These get quite large, Total Air installer size measured in Gigs.   Distribution is via DVD.  Currently I create sub-folders under my project and place the as