Quantcast
Channel: SCN: Message List - SAP HANA and In-Memory Computing
Viewing all 8968 articles
Browse latest View live

HANA live view

$
0
0

Hi Experts,

 

Any answer why SAP HANA live is build completely on Calculation views ( even for master data ). Does it recommends us to use CV in our modeling as well.

 

Thanks & Regards,

Siva A


Re: SAP HANA Lifecycle Manager Error (SPS08 - LCM)

$
0
0

Hi Alston,

 

I'm sorry for the late reply. Are you still experiencing this error?

 

I've seen this issue before with another customer and the final resolution was to make sure the /etc/hosts file does not have the ipv6 BEFORE ipv4. Here is an example:

 

 

>> cat /etc/hosts

 

# special IPv6 addresses
::1             localhost ipv6-localhost
ipv6-loopback
ff02::3         ipv6-allhosts

 

192.168.180.31  abceccd01.sap.com abceccd01
192.168.180.34  abceccs01.sap.com abceccs01
192.168.180.35  abccrms01.sap.com abccrms01
192.168.180.30  abceccs01.sap.com abceccs01
10.36.10.5      abceccs01-nfs.sap.com  abceccs01-nfs

 

The resolution would be to change the ordering. So the IPv6 section appears below the IPv4 section.


After that is done, perform the following to "reset" HLM.

 

1. Stop all browsers that have HLM pages open
2. Stop the Studio
3. Execute /usr/sap/hlm_bootstraps/<SID>/HLM/stop-hlm.sh –f
4. Check that there are no any left HLM processes
5. Go to /usr/sap/hlm_bootstraps/<SID>/HLM/param/
and rename all files except logging.properties

 

6. go to directory: /usr/sap/hlm_bootstraps/<SID>/HLM
and rename directory persistence

7 restart SAP Host Agent - as root: /usr/sap/hostctrl/exe/saphostexec
-restart

8. open HLM ui via browser:

 

https://<hostname>:1129/lmsl/HLM/<SID>/ui/

 

I hope this helps.

 

Best Regards,
Jimmy

Re: Table Type as OutPut Parameter

$
0
0

Because that's how the syntax for CALL is defined.

It's pretty straight foward.

The type is defined in your procedure and the SQL Console in SAP HANA figures out the return structure after the CALL statement is prepared respectively when the resultset is ready.

 

Since the SQL Console is note a SQL script runtime environment (like e.g. SQL*PLUS is a PL/SQL runtime shell) you cannot dynamically create custom types and use them.

 

That also means, if you got a table type input parameter that you cannot "make up" a table type data item on the go. Instead you need to embed call in a SQL Script context.

 

Hope that explains it to you. As with all "why" questions around products, this might not be very satisfying...

 

- Lars

Re: Backup for the DR site

$
0
0

Jimmy,

 

Is there a way to perform the same?

Re: Table Type as OutPut Parameter

$
0
0

Thanks Lars

 

Now It's more clear to me.

 

Best Regards

SAP HANA XS batch insert with SYSUUID

$
0
0

Ha folks!

 

I have come across strange behavior of hana xs engine while writing some batch inserts using prepared command that includes calling of "sysuuid"

So, for example I have some table like

 

create column table "IDS"( "ID" VARCHAR (36) not null,  "COL" INTEGER null)

Then I created xs javascript file that tries to populate this table in a batch way

I pass number of records to insert from the request parameter. Roughly code looks like:

 

var count =  parseInt ($.request.parameters.get("count"));

var conn = $.db.getConnection();

 

conn.prepareStatement('delete from "IDS"').execute();

 

  var pstmt = conn.prepareStatement('insert into "IDS"  (id, col) values (sysuuid, ?)');

  pstmt.setBatchSize(count);

  

  for (var i = 0; i < count; ++i){

  pstmt.setString(1, i.toString());

  pstmt.addBatch();

  }

 

  pstmt.executeBatch();

  pstmt.close();

  conn.commit();

  conn.close();

 

If I execute this xs file with e.g. count=10 I will get 10 rows created, each would have "col" column value in a range of 0..9, but all "id" values will be equal

If I change prepare statement to the following:

 

var pstmt = conn.prepareStatement('insert into "IDS"  (id, col) select  sysuuid, ? from dummy' );

.. all "id" values will get their unique values as expected. So, it felt like in a first scenario it computed sysuuid value once and then used for every row

 

I would be fine with this "select .. from dummy" workaround if not the fact that this insert statement is around 10 times slower than the analog with "values". Some may think that this is due to that calling "sysuud" for every row inserted slows execution in a second scenario, but its not the case. Even by replacing sysuuid with some scalar value shows worse performance when doing "select .. from dummy" vs "values ( .. )"

 

Has anyone faced similar issues and solved them somehow?

 

I find this batch processing functions very useful for bulk data insertion as it performs really fast - I could insert millions of rows in a few seconds. But this issue with sysuuid would require coming up with some workarounds which may kill benefit of using batches.

 

Thanks!

 

Artem

Re: HANA live view

$
0
0

Thanks John for your response.

 

Could you please elaborate more in detail of this sentence.

 

If your model is syntactically sane then they will all perform the same in SPS09.


Is there something big change how the views work in back end in SPS09?


- Siva

Re: Unable to validate SUM for HANA version

$
0
0

Hello Ravindar,

I am also getting the same error while installing SP05.

 

Can you please let me know the solution of this, if you got it?

my id saurabh.vai19@gmail.com

 

Thanks In advance.

Saurabh


Re: Backup for the DR site

$
0
0

I don't believe there is a current way to do this. It is possible they may feature this in a new release. This question was asked a while back in SPS06 days:Can a HANA DR Standby system be used as a sourc... | SAP HANA

 

but this feature was not mentioned in the SPS08 release notes so I assume it wasn't implemented.

 

As of right now, the only way to do that would be to decouple the DR environment and then back it up.

 

Have you considered a multi-tier system replication scenario? That might be an option for you as well.

 

Cheers,
Jimmy

XSoData Post error treatment

$
0
0

Hi All,

 

I'm trying to bulk post to an OData service and for some reason, the posting is failling. I know that in the http return, I already have a description regarding the error message, but is possible to check somewhere (maybe increasing a trace level, for example) a comple error message, or at least more details about the error?

 

Thanks and regards,

Roberto Falk

Re: HANA PAL Executing error

$
0
0

Hi All,

 

I'm getting the same error :

 

"dberror(CallableStatement.execute): 2048 - column store error: search table error: [2620] executor: plan operation failed;Can not insert data from temp table into Result_Table"

 

I have verified i/p & o/p data types and the same code works fine on studio editor , but facing issue only executing the same from xsjs.

 

Please let me know any other suggestions ..

 

Thanks & Regards,

Anup Singh

SQL Syntax Question:

$
0
0

I am pretty new to HANA and SQL and confronted with a problem that I am not sure how to solve.

 

In an SQL-procedure (Procedure A) there is an IN parameter 'inTabA' and an OUT parameter 'outTabA'.

 

inTabA and outTabA are identical and both contain

'Product' and

'Customer' and

'Discount'.

 

From Procedure A a call must be made to Procedure B.

 

Procedure B

has the parameters IN 'inTabB' and OUT 'outTabB' which are identical and both contain

'Customer' and

'Discount'.

 

Within Procedure B the Discount is determined based only on the Customer (is not my responsibility and I dont know how).

 

Hence I reckon I must call Procedure B from within Procedure A using some sort of loop-construct, but which is the "right" approach using SQL?

Re: Inserting Multiple Rows of Data With One Insert

$
0
0

Ah, then I misunderstood your comment downthread. I considered the statement above to be a single SQL command, which may be wrong from a referential point of view. I am not too experienced in SQL therefore maybe the misunderstanding.

Re: SQL Syntax Question:

$
0
0

Thanx for this but what is a "UDF" and what does "wrap the call into the UDF" mean?

 

Please note I MUST use the discount procedure (Procdure B) since it is a central, tested and approved functionality.

Re: SQL Syntax Question:

$
0
0

UDF = user defined function.

And as I wrote, you could use the procedure by calling it in the function.

 

- Lars


Re: SQL Syntax Question:

$
0
0

I assume using a UDF is feasible, but also there I will be confronted with the same issue:

 

- receiving the data in the UDF in an internal table (containing Product, Customer, Sales)

 

- needing to call Procedure B separately for each Product thereby

          passing an internal table (containing Customer, Sales) and

          receiving an internal table (containing Customer, Sales, Discount)

 

- needing to add the results from each call to Procedure B to the UDF 'out' parameter table (containing Product, Customer, Sales, Discount) with the final results

 

Hence, the original question remains:

 

"using some sort of loop-construct, but which is the "right" approach using SQL?"

Re: SQL Syntax Question:

$
0
0

I don't agree that you need a loop contruct.

Just hand over the table.

 

create type tt_prd_cst_dscnt as table (customer_id int, product_id int, sales_amt integer, discount int);

drop procedure  proc_A;


CREATE PROCEDURE proc_a ()

LANGUAGE SQLSCRIPT READS SQL DATA

AS

BEGIN

 

    /* note how the column names are used to match the table type */

    bIn = SELECT customer_id, product_id, sales_amount as SALES_AMT, NULL as discount

          FROM product_sales;

  

    call proc_B(:bIN, bOUT);

  

    select * from :bOUT;

 

END;

 

 

drop procedure  proc_b;

 

CREATE PROCEDURE proc_b (IN tabIN tt_prd_cst_dscnt, OUT tabOUT tt_prd_cst_dscnt)

LANGUAGE SQLSCRIPT READS SQL DATA

AS

BEGIN

/* just some garbage action to add the "discount" to the output tabe 

    select * from :tabIN;

  

    tabOUT = select customer_id, product_id, sales_amt, mod (customer_id + product_id, 3)*10 + 2  as discount

             from :tabIN;

  

END;

 

After these two procedure are in place we can call proc_a to get the resultsets of the unbound selects...

 

call proc_A;

 

-> first result set is coming from proc_B: SELECT * from :tabIN;

 

CUSTOMER_IDPRODUCT_IDSALES_AMTDISCOUNT
2          1        50      NULL   
3          2        5        NULL   

 

-> second result set (with DISCOUNT) is coming from proc_A: SELECT * FROM :bOUT;

 

CUSTOMER_IDPRODUCT_IDSALES_AMTDISCOUNT
2          1        50      2      
3          2        5        22     

 

Works for me...

 

 

- Lars

Re: HANA live view

$
0
0

No, the changes happened in SPS07 and SPS08. They did a lot of optimizations of calc views because of HANA Live. As a result, if you build a model different ways, you should find they all perform the same.

Re: SQL Syntax Question:

$
0
0

Thanks but this does not seem right for the case I am facing.

 

The procedure declaration is missing 'inTabA' and 'outTabA', where 'inTabA' contains the data to be processed and 'outTabA' the results.

 

Hence, the procedure declaration for procedure A would have to be:

CREATE PROCEDURE proc_a (IN inTabA tt_TabA, OUT outTabA tt_TabA)

LANGUAGE SQLSCRIPT READS SQL DATA

AS...

 

and for B it would be:

 

CREATE PROCEDURE proc_b (IN inTabB tt_TabB, OUT outTabB tt_TabB)

LANGUAGE SQLSCRIPT READS SQL DATA

AS...

 

 

Where the types tt_TabA and tt_TabB are specified via CDS I think it is called.

 

What I am (still) assuming/fearing is that a loop-construct is needed over 'inTabA'. Am I wrong (I hope so )???

Re: HANA PAL Executing error

$
0
0

Hi Bhupender ,

 

Please find below syntax :

 

Executed from Studio successfully -

 

CREATE LOCAL TEMPORARY COLUMN TABLE #CONTROL ("NAME" VARCHAR(50), "INTARGS" INTEGER, "DOUBLEARGS" DOUBLE, "STRINGARGS" VARCHAR(100));

 

INSERT INTO #CONTROL VALUES ('THREAD_NUMBER', 50, null, null);

INSERT INTO #CONTROL VALUES ('MIN_SUPPORT', null, 0.001, null);

INSERT INTO #CONTROL VALUES ('MIN_CONFIDENCE', null, 0.001, null);

INSERT INTO #CONTROL VALUES ('MAX_ITEM_LENGTH', 100, null, null);

INSERT INTO #CONTROL VALUES ('MAX_CONSEQUENT', 100, null, null);

 

DROP TABLE "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result";

 

CREATE COLUMN TABLE "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result" ("PRERULE" VARCHAR(256), "POSTRULE" VARCHAR(256), "SUPPORT" DOUBLE, "CONFIDENCE" DOUBLE, "LIFT" DOUBLE);

 

DROP TABLE "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult";

CREATE COLUMN TABLE "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult" ("ID" INTEGER, "Descritption" VARCHAR(5000));

 

CALL "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori"("devUser"."CNMR_APRIORI_TRANS_TBL1", #CONTROL, "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result", "devUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult") with overview;

 

 

__________________________________________________________________

 

I get the error when executing the same from XSJS -

 

 

var sqlstmt;

var method;

var conn;

var output = {};

output.msg = "";

$.response.contentType = "text/json";

$.response.status = $.net.http.OK;

method = parseInt($.request.parameters.get("method"),10);

if (method >= 1 && method <= 4) {

    conn = $.db.getConnection("CentralRepo.ABCRecommends1::DevUser");

  

    sqlstmt = 'CREATE LOCAL TEMPORARY COLUMN TABLE #CONTROL ("NAME" VARCHAR(50), "INTARGS" INTEGER, "DOUBLEARGS" DOUBLE, "STRINGARGS" VARCHAR(100))';

    conn.prepareStatement(sqlstmt).execute();

  

 

 

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'THREAD_NUMBER\', 50, null, null)';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'MIN_SUPPORT\', null, 0.0001, null)';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'MIN_CONFIDENCE\', null, 0.0001, null)';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'LIFT\', null, 0.001, null)';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'MAX_ITEM_LENGTH\', 100, null, null)';

    conn.prepareStatement(sqlstmt).execute();

  

  

    sqlstmt = 'INSERT INTO #CONTROL VALUES (\'MAX_CONSEQUENT\', ?, null, null)';

    var pstmt = conn.prepareStatement(sqlstmt);

    pstmt.setInt(1,method);

    pstmt.execute();   

 

    sqlstmt = 'DROP TABLE "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result"';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'CREATE COLUMN TABLE "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result" ("PRERULE" VARCHAR(256), "POSTRULE" VARCHAR(256), "SUPPORT" DOUBLE, "CONFIDENCE" DOUBLE, "LIFT" DOUBLE)';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'DROP TABLE "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult"';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'CREATE COLUMN TABLE "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult" ("ID" INTEGER, "Descritption" VARCHAR(5000))';

    conn.prepareStatement(sqlstmt).execute();

  

    sqlstmt = 'CALL "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori"("DevUser"."CNMR_APRIORI_TRANS_TBL1", #CONTROL, "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_Result", "DevUser"."CentralRepo.ABCRecommends1.Algorithms::Apriori.Apriori_aprioriRule_PMMLResult") with overview';

    conn.prepareCall(sqlstmt).execute();

  

  

    conn.commit();

    output.msg = "Finished!";

} else {

    output.msg = "Value for 'method' parameter is not between 1 and 4.";

}

if (conn) {conn.close();}  

$.response.setBody(JSON.stringify(output));

 

Thanks & Regards,

Anup Singh

Viewing all 8968 articles
Browse latest View live


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