Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all 6412 articles
Browse latest View live

Compare Timestamps of rows of the same table

$
0
0

Hello everybody,

 

i'm actually working on my masterthesis, whose topic is "big data technologies for fraud detection".

I want to build a system, which consist of hadoop and sap hana. hadoop has to import, parse and persistent the logfiles. the result of this process is one hugh logfile, which is eventually exported to sap hana appliance.

 

and here we go.

the format of the logfile look like this: Date, Time, User, IP, Timestamp

 

And i want to figure out, which user, changed his IP adress in less then 5 seconds. I tried to use a calculation view and to build a semi-cross product by joining the logfile with it self, by joining it by username. But the problem with this join is, that it joins everything twice. (A | B) and (B | A) because they matching the condition (username = username AND ip != ip)

 

So how could i only get the distinct values of the cross product?

 

 

Regards,

 

Suerte


where in-operator

$
0
0

Hello folks,

 

i need help implementing the in operator in a ce_projection:

 

so this is what i want to do with only using CE Functions:

 

SELECT "a","b" from table WHERE "b" = (

                                                                 SELECT MIN ("b") FROM table

                                                             );

 

 

so far i got this:

 

 

temp1 = CE_COLUMN_TABLE("Schema"."project.data::table1", ["a", "b", "c", "d"]);

 

temp2 = CE_AGGREGATION(:temp1, [MIN("b")]);

 

temp3 = CE_PROJECTION(:temp2, ["a", "b"], '"b" = :temp2');

 

 

 

This of course will not work, since temp2 is a whole result set (with rowcount only being 1) but still, this wont work.

 

in this discusstion  'IN' Operator in CE_PROJECTION i found a possibility for the IN operator

 

according to that, temp3 would be:

 

temp3 = CE_PROJECTION(:temp2, ["a", "b"], 'in("b", '':temp2'')');

 

the in clause from the post above works just fine, where COL1 is being compared to a,b,c characters

 

var_out   = CE_PROJECTION (:lt_test_n, ["COL1", "COL2"], ' in("COL1",''A'',''B'',''C'');

 

 

any thoughts? or other ways to solve this?

 

i mean i could just do a

 

declare temp4 int;

 

select "b" into temp4 from :temp2

 

temp3 = CE_PROJECTION(:temp2, ["a", "b"], '"b" = :temp4);

 

but then i am going to the sql optimizer again. i would like to do this with CE functions alone.

 

 

Thanks for any help and ideas

Chris

Help with HANA DB upgrade.

$
0
0

We are trying to upgrade HANA DB from rev48 to rev68. Followed the instructions as per the doc http://scn.sap.com/docs/DOC-30980

- It went smoothly, after installation it stopped the system and then restarted. while on start it hung and timed out.
- the last line in the log is "Installation Done".

- As per instruction in troubleshooting of the above mentioned doc tried manually stopping and starting the DB. But the start timed out again.

 

Any help will be appreciated.

password for HANA trial system

$
0
0

I registered for HANA trial system from Get 30 days of free access to SAP HANA, developer edition .and i am not sure why the system does nt turn on.

 

There are two VMs available from the trial account and opening the Hana Studio ,asking for the passowrd , and HANA server also.

What are the default passwords for these systems to access them

 

hana server trial.pngHana login.png

911: Does the SAP HANA ODBC driver support passing a table type to a stored procedure?

$
0
0

I’m building a proof-of-concept C++ application that uses ODBC to create an Order with line items where I’m using a table type to hold the line items and then pass the type to a stored procedure along with an customer id.

Unfortunately, I’m getting the following ODBC driver error message when I attempt to make the call:


Error-Thread 1-[SAP AG][LIBODBCHDB DLL][HDBODBC] General error;7 feature not supported: Parameterized input table parameter is not allowed: Line 1 col 30 (at pos 29) [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;-10210 Invalid command state (No prepared SQL command)

 

Does the HANA ODBC driver support passing a table type? If so, is there a trick to it. If not, do you have suggestions for a workaround?

 

Here is some of the relevant SAP HANA code that makes up the app.

-- Define the type for calling usp_InsertOrder procedure

CREATE TYPE "DBO"."INMEMDBTVPORDERS" AS TABLE 

(

"SEQ" INT CS_INT NOT NULL,

"PR_ID" BIGINT CS_FIXED NOT NULL,

"PR_QTY" INT CS_INT

);

 

-- usp_InsertOrder procedure using a TVP

CREATE PROCEDURE dbo.usp_InsertOrder

(IN C_ID bigint,

IN ORDERS dbo.InMemDBTVPOrders)

AS

BEGIN

    DECLARE CurrentRow integer;

     DECLARE RowsToProcess integer;

     DECLARE Pr_Id              bigint;

     DECLARE Pr_Qty integer;

    DECLARE Order_Id           bigint;

    DECLARE Pr_Price           decimal(9,2);

    DECLARE TotalPrice         decimal(12,2);

    DECLARE CurrentDate        timestamp;

   

    CurrentDate := CURRENT_TIMESTAMP;

    TotalPrice := 0;

 

    --insert an Order record to claim the O_ID

    INSERT INTO dbo.Orders (O_ID, O_C_ID, O_TOTAL, O_DTS) VALUES (dbo.ORDERS_ID.NEXTVAL, :C_ID, 0, :CurrentDate);

   

    -- get the inserted order id 

     SELECT dbo.ORDERS_ID.CURRVAL into Order_ID FROM DUMMY;

    

    -- now process the order lines

    INSERT INTO dbo.OrderLines

        SELECT  :Order_ID,

                O.SEQ,

                O.PR_ID,

                O.PR_QTY,

                P.PR_PRICE,

:CurrentDate

        FROM    :ORDERS O INNER JOIN dbo.Products P ON (O.PR_ID = P.PR_ID);

 

    --SELECT  @TotalPrice = ISNULL(SUM(OL_PRICE),0)

     SELECT Ifnull(SUM(OL_PRICE),0) into TotalPrice

    FROM    dbo.OrderLines

    WHERE   OL_O_ID = :order_id;

         

    -- now update the order with the total price

    UPDATE  dbo.Orders

    SET     O_TOTAL = :TotalPrice

    WHERE   O_ID = :Order_Id AND

            O_C_ID  = :C_ID;

 

    SELECT  :order_id,

            :C_ID,

            :TotalPrice

    FROM DUMMY;

 

END;

 

Here is the test code that we used to make sure the type passing works in HANA.

CREATE PROCEDURE dbo.Util_TestOrderInsert

(OUT tvp "DBO"."INMEMDBTVPORDERS")

LANGUAGE SQLSCRIPT

AS

BEGIN

     tvp = SELECT 1 AS "SEQ", 3678 AS "PR_ID", 100 AS "PR_QTY" FROM DUMMY;

     CALL dbo.usp_InsertOrder(3428, :tvp);

END;

 

I have a version of the C++ application that works fine with SQL Server and it’s table type, but when moving to HANA, this is the only call that fails.

Regards,

Bill

Is it possible to schedule a procedure

$
0
0

Hi folks,

 

Is it possible to schedule a SQLscript procedure to run on a nightly basis?  ie: a procedure that massages data and inserts new data into a table each night.  I realize this is more of a BW data warehousing solution but I am being asked this question.  Is there some way to invoke the procedure automatically?

 

Thanks,

-Patrick

Unable to load xsappsite

$
0
0

Hi there,

 

Just got myself a copy of SAP HANA Developer Edition (SP07) on AWS, added in delivery unit HANA_UI_INTEGRATION_SVC.tgz from server for SAP HANA UI Integration Service and the following roles to my user id:

 

  • sap.hana.uis.db::SITE_DESIGNER
  • sap.hana.uis.db::SITE_USER

 

When I tried to open up the one of the SHINE .xsappsite, I am not able to load the site designer. Instead, I am getting the following from the error log:

 

  • Message: Could not login to system: Connection refused: connect
  • Plug-in: com.sap.ndb.studio.portal.ui

 

pic001.PNG

 

Any idea what I might be missing? I have also tried enabling all the inbound TCP ports for my AWS security group.

 

Regards,

TM

Demo application of HANA using UI5

$
0
0

Are the any demo applications  available consuming ODATA from HANA XS engine and build with UI5?

I found one Your World , but the link is broken now.

 

The main intention is to test the application in Mobile/desktop and review the performance.


Relationship between SPS number and release and version

$
0
0

I have to confess that I'm very confused by Hana's version terminology.  I could really use a table that shows how the various HANA version identifiers are related to one another. Given the rapid release cycle, it would be really nice if this table were updated here in the HANA developer center.

 

From the HANA Studio, I can see that my version is 1.00.69.385057.  After about an hour of research, I believe this is also known as SP7.  After further research it appears that version 70 is also known as SP7.  I've also found references to the terms "SPS07" and "SPS7" which i believe to be synonyms for SP7.

 

I found this general article about release strategy. FAQ: SAP HANA Release Strategy that talks about releases in general but is missing any real detailed information.

 

So, here's what I really need.  Can somebody fill this in for me?

 

ReleaseVersion/Build NumberRelease DateRelease Notes
Version 1 SP71.00.691/1/2014 (a guess, please fix)URL To Release Notes
1.00.702/1/2014 (a guess, please fix)URL to Release Notes

Capturing returned data from Stored Procedures

$
0
0

I have a stored procedure that returns some data, something like this:

 

CREATE PROCEDURE MyProc()

...

BEGIN

     SELECT "COL1" FROM "MYTABLE";

END

 

In another procedure I want to capture that result set:

 

CREATE PROCEDURE CallingProc ()

...

BEGIN

     ...

     CALL MyProc;

     ...

END

 

So, how do I get the result set returning from MyProc?

 

I tried things like:   MyResult = CALL MyProc;  with no avail.

 

Thank you for your response.

Need help with hands on in HANA

$
0
0

I know this question might have been already answered many times before. But I couldn't find a link for that here. So I am posting the questions again here. Sorry for the duplication.

 

I am new to HANA and want to learn more about HANA by doing more of Hands on Practices. I am more interested in modeling and reporting aspect of HANA and thus would  like to concentrate especailly on the data modeling, data extraction and reporting areas during my journey of self discovery of HANA. I am currently making a transition from the world of Informatica, Oracle and BO to SAP HANA ( I guess you can understand from where I am coming and what I am trying to accomplish here). My immeditate goal is to develop a traditional data warehouse application in HANA.

 

To get started I subscribed for the 30 day free trial access on the cloudshare pro sever. I was able to connect to HANA server from HANA studio (as SYSTEM) and was able to import the SFLIGHT data model. This is where I am now. But I need some help in proceeding further. Can any one point me to the right documentation where I can practice hands on on this SFLIGHT data model? Is this still a valid data model that HANA supports or do I need to import any other data models for my hands on? Any additional help is really appreciated.

 

Hopefully with the great minds here in this community I can make the right tranisition to SAP HANA world and one day become as knowledgable as you people are and can begin to contribute to the community.

 

 

Thanks

CE Function : CE_CALC_VIEW - running with placeholders

$
0
0

Hi Experts ,

 

I am bit stuck in specifying placeholders in a graphical calculation view.

I created one graphical calcualtion view which has 2 mandatory input paramters(PLANT & DATE).

  • How use CE Function to access the cal view with placeholders ?
  • how can i use direct select statement to fetch data from calculation view with dynamic placeholders (I am trying to fetch calculation view inside a procedure)
SELECT  "YYYYMM",       "DebitCreditCode",
sum("AmountInCompanyCodeCurrency") AS "Amount" FROM "_SYS_BIC"."TurnOverValue_BugFix/ABCDEFG_L1"
('PLACEHOLDER' = ('$$PLANT$$', '0001'), 'PLACEHOLDER' = ('$$TO_DATE$$', '201401')) 
GROUP BY 
"DebitCreditCode", 
"YYYYMM";

Here, i need to replace '0001' and '201401' with dynamic values. I tried bot ":variable_name' and "variable_name". Both raise error.

Thanks in advance ,

Sreehari V Pillai

could you please tell me how to create project in sap hana studio...

$
0
0

Hi All,

      I am new to sap world now i am practicing on sap hana but i am getting errors administration side while working on SAPHANA

i am not unable to find out the errors its difficult to understand..please can anybody provide the SAPHANA documents

 

 

Thanks,

sowjanya

SAP HANA : Uploading data from excel file with table key NULL

$
0
0

Hi all,

i would need to upload an excel file into SAP HANA table.

 

The ECC table is "RESB" and it has a key field (RSART) equal NULL,but i can't upload it because SAP HANA doesn't let me to fill key field equal NULL.

 

How can i solve this problem? Have i to change field constraint?

 

Thank in advance.

Regards.

Dario.

Unable to update multiple columns in a single update statement

$
0
0

Hi, I am unable to update multiple column values in a single update statement.

 

Please help me.


Export data to excel in HANA

$
0
0

Hi,

 

I have a stored procedure.

 

I need to make it like it  will execute sql and export the results to excel sheet.

 

Please help me.

How to get remote access of SAP HANA free trail version

$
0
0

Hi,

please share me how to use the trail version of SAP HANA?

Unable to load xsappsite

$
0
0

Hi there,

 

Just got myself a copy of SAP HANA Developer Edition (SP07) on AWS, added in delivery unit HANA_UI_INTEGRATION_SVC.tgz from server for SAP HANA UI Integration Service and the following roles to my user id:

 

  • sap.hana.uis.db::SITE_DESIGNER
  • sap.hana.uis.db::SITE_USER

 

When I tried to open up the one of the SHINE .xsappsite, I am not able to load the site designer. Instead, I am getting the following from the error log:

 

  • Message: Could not login to system: Connection refused: connect
  • Plug-in: com.sap.ndb.studio.portal.ui

 

pic001.PNG

 

Any idea what I might be missing? I have also tried enabling all the inbound TCP ports for my AWS security group.

 

Regards,

TM

Demo application of HANA using UI5

$
0
0

Are the any demo applications  available consuming ODATA from HANA XS engine and build with UI5?

I found one Your World , but the link is broken now.

 

The main intention is to test the application in Mobile/desktop and review the performance.

Run Programs from SAP HANA

$
0
0

Hi,

 

My requirement is like,

 

I have a stored procedure in that takes command name as input

 

I want to call cmd.exe with the command  from HANA and it give some result.

 

I want to store the result in some table.

 

Please help me.

Viewing all 6412 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>