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

Server processing time for SQLScript stored procedure

$
0
0

Hi everybody,

 

I'm trying to measure the processing time of a stored procedure which will be executed several times with different parameters.

 

If I execute the procedure within the SQL Console, the server processing time is displayed. But as I must execute the procedure about 300 times, I would ne nice to have that server processing time within SQL or SQLScript in order to save it in a database table for later analysis.

 

Is there any way to achieve that? I think comparing timestamps before and after the executing won't be sufficient.

 

Thanks in advance.

 

Best regards,

Daniel


HANA geo spatial: only ST_POINT and ST_GEOMETRY allowed in ddl

$
0
0

Hi experts,

 

We are on HANA 1.0 Rev68 and using the spatial engine.


I'm curious why only ST_GEOMETRY and ST_POINT are allowed in DDL in HANA. We tried to create ST_POLYGON, ST_LINESTRING, etc but these failed.


It is not really important (as we use the supertype ST_GEOMETRY by default), but just a little remarkable.


Cheers, Wout

Consuming procedure from calc view

$
0
0

Hi folks,

 

I have developed a procedure via procedure editor in SAP HANA Developer perspective.  Up until now I have no IN or OUT parameters and I have tested the procedure via DEBUG perspective and it works great.  The result of the procedure that I want to pass to a calculation view is a simple select at the end of my procedure;

 

ONTIME = SELECT FIELD1, FIELD2, FIELD3 etc FROM TABLE1

 

When I debug the procedure I can do a data preview of my ONTIME resultset and it looks great.  Now I want to pass this to the OUT parameter but I can not seem to get the syntax correct.

 

I thought it would be something like this;

 

CREATE PROCEDURE _SYS_BIC.myproc(OUT ONTIME TABLE)

 

But upon activation it fails;  it converts the 'TABLE' type to 'SYSTEM.TABLE' and says this can not be found.

ie: the line gets automatically changed to;

 

CREATE PROCEDURE _SYS_BIC.myproc(OUT ONTIME SYSTEM.TABLE)

 

Looking in SQLscript guide I'm finding tons of examples that look something like this;

 

CREATE PROCEDURE ceGetRowNum(IN it_books books, OUT ranked_books ot_ranked_books)

 

where I am assuming ot_ranked_books is somehow previously declared?  Anyhow I can not get any of those examples to work either.

 

How can I properly declare my OUT parameter as a table type?  When I was working with OLD procedure editor via CONTENT area in modeler perspective it was as simple as var_out = SELECT * FROM.... and then I would just setup the table in the output parameter fields in the output pane.

 

Thanks for any guidance you can provide,

-Patrick

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

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.

what is an instance in sap hana??

$
0
0

Can anyone please explain clearly what does an "instance" mean in sap hana?

Error during activation of decision table based on analytic view

$
0
0

Hi,

 

 

Issue:          During check or activation of decision table error given "invalid column name"

System:      AWS Hana SPS07, Studio rev. 70 (Win x.64).

 

 

1. Start creation of decision table

 

dt1.PNG

 

 

2. Add analytic view to data foundation

 

dt2.PNG

 

3. Set attributes, condition and create parameter for action

 

dt3.PNG

 

4. Set 1 condition table entry

 

dt4.PNG

 

 

5. Upon activation get error "invalid column name"

 

dt5.PNG

 

 

6. Index server trace file entry

 

[6176]{-1}[-1/-1] 2014-02-18 09:14:05.538097 w Logger           SavepointImpl.cpp(02343) : NOTE: BACKUP DATA needed to ensure recoverability of the database

[6358]{300567}[44/-1] 2014-02-18 09:14:24.889576 i TraceContext     TraceContext.cpp(00699) : UserName=SYSTEM, ApplicationUserName=JP, ApplicationSource=csns.dwb.tools.core.internal.destination.ConnectionHandle.createConnection(ConnectionHandle.java:121);csns.dwb.team.internal.jobs.RepositoryJob.run(RepositoryJob.java:220);org.eclipse.core.internal.jobs.Worker.run(Worker.java:53);

[6358]{300567}[44/-1] 2014-02-18 09:14:24.889571 e REPOSITORY       rulesCompiler.cpp(02462) : error executing statement CREATE PROCEDURE "_SYS_BIC"."hpl.missioncontrol.models/DT_ACHIEVEMENT_SCORECARD"(OUT returned_tt "_SYS_BIC"."hpl.missioncontrol.models/DT_ACHIEVEMENT_SCORECARD/TT") LANGUAGE SQLSCRIPT READS SQL DATA WITH RESULT VIEW "_SYS_BIC"."hpl.missioncontrol.models/DT_ACHIEVEMENT_SCORECARD/RV" AS

BEGIN

returned_tt = SELECT "MISSIONID" AS "MISSIONID", "VEHICLEID" AS "VEHICLEID", "PILOTID" AS "PILOTID", "CA_RESULT" AS "CA_RESULT", "CONDITIONID" AS "CONDITIONID", CASE WHEN "CONDITIONID" = 'GEN' THEN 0

 

 

ELSE 0

END

AS "PA_SCORECARD" FROM "_SYS_BIC"."hpl.missioncontrol.models/AT_ACHIEVEMENT_CONDITION_MESSAGE";

 

 

 

 

END;

Error : invalid column name: MISSIONID: line 3 col 22 (at pos 313) at ptime/query/checker/check_id.cc:545line: 3 column: 22

 

 

 

 

 

7. If I delete attribute MISSIONID and try to re-activate, the system issues error about the next attribute being invalid column name i.e. VEHICLEID.

 

 

 

Any ideas gratefully received, thanks.

SQL statement to derive Year and Month

$
0
0

Hi,

 

I have a date field in a table with YYYY-MM-DD format. is it possible to get year and month in a separate columns using SQL statement.

 

2014-02-17_13-09-52.jpg


How to insert values into newly created column of a table

$
0
0

Hi,

 

I have created a table in hana through hana studio and inserted data.

 

Later I have added one more new column to that table,

 

Now I want to insert values only  to that new column

 

What is the syntax for that.

 

Can any one help me in this.

 

 

Thanks In Advance

Minimum eligibility criteria for SAP HANA Event participation

$
0
0

hi..

 

I am new to SAP and SAP HANA. But i came to know that SAP HANA is helping start-ups to build application related to big data analytics.

 

Please help me in knowing minimum developers work experience needed to participate in this event.

 

Hope you members will help me in solving my query. thank you..

An error occurred: Failed to call repository: insufficient privilege: Not authorized

$
0
0

Hi,

 

I´m new in this community and also new at SAP HANA Studio and the topic SAP HANA.

 

SAP gives a lot of helpful tutorials and instructions but for my question/error I don´t find an answer.

A have a HANA could platform cockpit with schema. In my HANA Studio I try to start a DB connection. The schema is started and the DB tunnel works. At HANA Studio I add the system connection, but when I want to create the workspace at WINDOW/C: I get the error message.

 

Does anyone haveanidea?


Thanks

Edina

Search for * (star) character using CONTAINS()

$
0
0

Consider the following example:

 

create column table test_text (some_text text);
insert into test_text values ('ABC');
insert into test_text values ('*');

 

What I would like to get is only the second line, where text is '*'.

I tried:

-- Returns both rows
select *
from test_text where
CONTAINS(some_text,'*', EXACT);
-- Tried to escape the character, no result
select *
from test_text where
CONTAINS(some_text,'\*', EXACT);
 -- ASCII code for *, two rows again
select *
from test_text where
CONTAINS(some_text,char(42), EXACT);

 

As you see, I couldn't find a way in HANA to select a row where text contains star character.

Any solution you could suggest?

UDFunctions Table to Table

$
0
0

Hello there,

 

recently I try to define some UDFs which map tables to tables. Therefore I've written an hdbfunction file like this:

 

FUNCTION "NEO_X"."project.logic::simpleFunc" (IN val "project.structures::tt_simpleTable" )   RETURNS TABLE ( res VARCHAR(500) )  LANGUAGE SQLSCRIPT  SQL SECURITY INVOKER AS
BEGIN  RETURN SELECT CONCAT (COL1, COL2) FROM val;
END;

But this results in an error while activating it, saying that "DEV_"."val" is not defined... well of course it's not!

 

What am I doing wrong here?

 

Thanks.

JDBC Error on exporting DBTable via HANA-Studio

$
0
0


Hi,

 

we need to to export a DB-Table with 7.8 million entries.

 

in our system it works fine with export in modeler perspective. But in another system i get an error

 

SAP DBTech JDBC:[2] general error: Filling result table ..... failed with exception: Not allowed to exceed maximum in-memory lob size. Please user server-local export.

 

Unfortunately i get the same error if i use export location  Server.

 

 

Any hint what to do?

 

TIA

Joachim

 

Capture.JPG

Gaps in a sequence when using a row table.

$
0
0

Hi,

 

I was the process of writing a blog for SCN when I stumbled across something that might be a bug.  When inserting into a row table from a subquery, I get gaps in the sequence I'm calling.  This does not happen doing the same process when inserting to a column table.  I'm using HANA1.0r70.  You can try it yourself with the following SQL.

 

DROP SCHEMA SQI CASCADE;

CREATE SCHEMA SQI;

SET SCHEMA SQI;

CREATE COLUMN TABLE CTAB1 (ID INTEGER PRIMARY KEY, COL1 NVARCHAR(128));

CREATE SEQUENCE SEQCOL;

CREATE ROW TABLE RTAB1 (ID INTEGER PRIMARY KEY, COL1 NVARCHAR(128));

CREATE SEQUENCE SEQROW;

INSERT INTO CTAB1

(

  SELECT TOP 1000

  SEQCOL.NEXTVAL,

  TO_NCHAR(RAND())

  FROM

  OBJECTS

  CROSS JOIN

  OBJECTS);

INSERT INTO RTAB1

(

  SELECT TOP 1000

  SEQROW.NEXTVAL,

  TO_NCHAR(RAND())

  FROM

  OBJECTS

  CROSS JOIN

  OBJECTS);

 

 

SELECT

  COUNT(*),

  MIN(ID),

  MAX(ID)

FROM

  CTAB1;

 

SELECT

  COUNT(*),

  MIN(ID),

  MAX(ID)

FROM

  RTAB1;

 

On my system the result from CTAB1 shows the row count as 1000, minimum ID as 1 and the maximum ID as 1000.  The result from RTAB1 should be the same but returns with the row count as 1000, minimum ID as 1 and the maximum ID as 37,750.

 

A SELECT * FROM RTAB1 shows the sequence starts off OK.  After ID 125 there is a jump to 5,376.  This also increments correctly for 125 rows before leaping to 5,500.  After every 125 rows, the sequence skips a large number of places. 

 

It's worth mentioning that this only happens when cross joining OBJECTS and using the RAND function (as far as I know).  Everything works as expected when the subquery is pulling rows from real tables.  It also works find when cross joining OBJECTS but only inserting the ID column using the sequence.  I'd be extremely interested if anyone can shed any light on what is happening here.


Create an FULLTEXT index with text analysis on

$
0
0

I am trying to create an FULLTEXT index with tet analysis on at a column with datatype text,

but Hana throws an error that the column is already indexed.From HanaAcademy the example given there at Text Analysis: Full text Search using TEXT | SAP HANA

mentions that there is not any problem.How can i implement the example?

 

Also is it possible to create a Fulltext index with a deployment file like .hdbtable creates a Table?

 

Thanks,Otto

How to calculate PreviousCalWeek (YYYYWW format) using expression editor in HANA

$
0
0

Hi Experts,

 

I need to create a calculated column in my Analytic View called PreviousCalWeek in YYYYWW format. Ex: 201401,201402....201452 etc using the HANA Forumula/Expression editior functions. The output of this column should always look at the current system date and calculate current calweek and then finally populate PreviousCalWeek in YYYYWW format.

 

So I need the above column basically to find all documents where DocumentClearingWeek = PreviousCalWeek , i.e trying to find out all docs that got cleared last week.

DocumentClearingWeek is always 6 digit (YYYYWW) derived from DocumentClearingDate (mapped that to SYS_M_TimeDimension).

 

Could you please help me with the logic for deriving PreviousCalWeek using the functions provided in HANA expression/formula editor.

There is a now() function which gives currentdate&time and weekday() function but no week() function. Please help.

 

Thanks,

KPK

DECLARE not working in SQL Console

$
0
0

Hi All:

 

I have many years of db development experience but am new to SAP HANA. It is puzzling that I cannot simply write a simple "DECLARE RowCount INT = 0;" in the SQL Console and execute it without getting error message. Why cannot that statement be executed in the SQL Console?

 

Also, there is a notion of a DUMMY table. I tried to find information about it but could not find anything. I know you cannot do SELECT 'Hello'; but this works SELECT 'Hello' FROM DUMMY;. What is the concept behind DUMMY?

 

Thank you;

Server processing time for SQLScript stored procedure

$
0
0

Hi everybody,

 

I'm trying to measure the processing time of a stored procedure which will be executed several times with different parameters.

 

If I execute the procedure within the SQL Console, the server processing time is displayed. But as I must execute the procedure about 300 times, I would ne nice to have that server processing time within SQL or SQLScript in order to save it in a database table for later analysis.

 

Is there any way to achieve that? I think comparing timestamps before and after the executing won't be sufficient.

 

Thanks in advance.

 

Best regards,

Daniel

hdbsql SEGV

$
0
0

Hi

 

I am running a SQL to call a procedure:


CALL "OPS_SCHEMA"."P1"(1001,?,?,?)

 

When I run it from HANA Studio it works fine and produces 1 correct row. When I run it from linux command line using hdbsql then I get the following:


Unknown type 4 for column 1

Segmentation fault

 

Bang!

 

The indexserver trace file has nothing beyond one cryptic message:

[61459]{216198}[469/1229883] 2014-02-20 22:23:29.586575 e cePlanExec cePlanExecutor.cpp(06610) : Error during Plan execution of model OPS_SCHEMA:_SYS_SS_CE_1623978_INS (-1), reason: "OPS_SCHEMA"."P1": line 20 col 4 (at pos 528): [1299] (range 3) no data found exception

But that step produces 1 row of output - we can run it in Studio or hdbsql separately and see that row. It does not throw 1299.

 

Where can I get more details on why it is failing and how to fix it?

 

We are running it on AWS HANA ONE Rev 70.

 

Thanks and regards

Dinesh

Viewing all 6412 articles
Browse latest View live