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

How Fuzzy score and Score() function works in HANA?

$
0
0

Hi,

 

I read fuzzy developer guide of HANA, but i am not getting how HANA calculate score() and fuzzy score?

 

As per developer guide, Score() is calculate using TF/IDF, and I also try to calculate TF/IDF as per WIKI page, but it gives different values. and Score() value is changed as per x value of fuzzy(x) .

 

See example

 

select score() as sc, *

from COMPANIES2

where contains(Companyname,'IBM',fuzzy(0.7))

 

it returns

SC;                             ID; COMPANYNAME;  CONTACT

0.7599999904632568;   6;  IBM Corp;               M. Master

 

and for

select score() as sc, *

from COMPANIES2

where contains(Companyname,'IBM',fuzzy(0.2))

it return

SC;                               ID;  COMPANYNAME;       CONTACT

0.16945946216583252;   2;   SAP in Walldorf Corp;  Master Mister

0.8392000198364258;     6;   IBM Corp;                   M. Master

and table content of Companies2 is

ID; Companyname;           contact

1;  SAP Corp;                   Mister Master

2;  SAP in Walldorf Corp;   Master Mister

3;  ASAP;                         Nister Naster

4;  ASAP Corp;                 Mixter Maxter

5;  BSAP orp;                   Imster Marter

6;  IBM Corp;                    M. Master

 

Please provide any formula or algorithm for above.

 

Thanks,

Somnath A. Kadam


XSJob not executing

$
0
0

Hi,

 

I have followed all of the steps from the developer guide (page 469-472): http://help.sap.com/hana/SAP_HANA_Developer_Guide_en.pdf

but the job is not executing, neither it is showing in the JOB Log.

 

I have attached a screenshot of admin tool.

 

scheduleInsert.xsjob

 

{

    "description": "Scheduled Insert",

    "action": "sap....appl.services:testInsert.xsjs::insert",

    "schedules": [

        {

            "description": "insert",

            "xscron": "* * * * * * 1"

        }

    ]

}

 

sap....appl.services:testInsert.xsjs

 

$.import("sap....appl.xsjslib",   "dummyInsert");

 

function insert() {

    var dbConnection      = null;

    var output            = null;

    var bo                = null;

    var payload  = null;

    dbConnection    = $.db.getConnection(); //Get dbConnectionection for DB

    bo              = new $.sap....appl.xsjslib.dummyInsert.Value( dbConnection );

    output          = bo.insertValue(JSON.parse("[\"1\"]"), 10, true);

    dbConnection.close();

    dbConnection    = null;

    bo              = null;

    $.response.status = output.HttpStatusCode;

    $.response.setBody(JSON.stringify(output) + '\n');

}

 

 

Thanks & Regards,

Rachit

Reading metadata of columns of a table using XSJS

$
0
0

Hi,

 

I am stuck with a problem when using XSJS APIs. I have a table as below:

     

     Table Name: Employee.

     Table columns: EID: varchar

                            Age: INT.

    

     My requirement is to get the metadata of the columns of the EMPLOYEE table. Like I want to know the ColumnName, ColumnType of column EID using XSJS APIs.

I can use a workaround like

 

var conn = $.db.getConnection();

var prepStatement = conn.conn.prepareStatement('SELECT * FROM EMPLOYEE');

var rs = prepStatement .executeQuery();

var meatadata = rs.getMetaData();

 

This would give me the ResultSetMetaData and I can call appropriate function to get the desired information. But, this doesn't feel quite right, does it? I mean doing a select on the table to retrieve the meta information. Please suggest some alternate approach. I have seen something similar being done in the SAP HANA's web based Catalog editor.

 

Thanks,

Vikash.

OdataLib - xsodata

$
0
0

Is it possible to use ODataLib in xsodata ?

 

Thanks.

Custom Development impact on HANA migration

$
0
0


Does anyone have any metrics, white papers, or lessons learned regarding the LOE required to adapt custom code to be HANA compliant. I know that there are some tools being provided by SAP, but with mature customers we see a good deal of custom code. What can be shared regarding the LOE to ready this code for the IMDB? What has the experience been thus far.

Unable to view the Decision Table tab after setting Condition and Action

$
0
0

Hi

 

I am creating a decision table with update values from the HANA Academy Video https://www.youtube.com/watch?v=XuSp0m3fwFI

I've added the shipper ID and Discount as the attributes and set Shipper ID as Condition and Discount as Action and then saved it.

Now as per the video (At length 6:25 in the video) I should see a Decision Table tab with 2 columns ShipperID and Discount after setting 1 condition and 1 attribute. But I don't see any such tab created and any columns for ShipperID and Discount.

All I see is the Scenario pane, Details pane and the OUtput pane and 1 decision table tab "STS_DECISION_TABLE_UPDATE" that I created.

I validated the decision table and I get the following error message:

 

•Validation of multiple objects•Summary of Validation◦

Validation of STS_DECISION_TABLE_UPDATE•Detail Validation Result◦

Validation of STS.STS_DECISION_TABLE_UPDATE ◾Client-side validation◾Decision Table Validation Rule◾STS.STS_DECISION_TABLE_UPDATE:Model Validation Rule Successful◾Data Foundation Table Existence Check◾

Data Foundation Table Existence Check◾Validation on server◾Activation ID: 62◾

Repository: Activation failed for at least one object;

At least one runtime reported an error during activation.

Please see CheckResults for details◾

Activation is performed with activation mode Check only.◾STS.STS_DECISION_TABLE_UPDATE◾

Repository: Internal error during statement execution,

please see the database error traces for additional details; error in generated procedure - insufficient privilege:

Not authorized at ptime/query/checker/query_check.cc:2443line: 4294967295 column: 4294967295◾Repository: info message;

finished generate for OID {tenant: , package: STS, name: STS_DECISION_TABLE_UPDATE, suffix: hdbruldec}; number of checkResults: 1; last error code 40103

 

 

Is it because I don't have enough privileges that I am unable to see the Decision Table tab. Please explain. Also what do I need to do to get the privileges to validate the decision table.

 

 

 

Thank you.

 

Regards,

 

Pavan.

How to Concatenate Column Value from Multiple Rows into a Single Column?

$
0
0

Hi,

 

I want to concatenate values from multiple rows into a single column in SAP HANA.  Can someone please help me how this can be achieved?

I don’t want to use Cursor.

 

Input Table:

Product No.

Customer No.

Stor_ Name

101

10

Store1

101

10

Store2

101

10

Store3

102

10

Store1

102

10

Store3

 

Output Table

Product No.

Customer No.

Store_Name_Concat

101

10

Store1, Store2, Store3

102

10

Store1,Store3

 

 

 

 

 

Thanks,

Vishnu

HANA Restore/Recover Issue

$
0
0

I am facing an issue with recovering a HANA DB from HANA Studio. Every time I click on recover I see the below message and the recover wizard does not open. The HANA Appliance is a scale-out (4 node) appliance and running on Rev 62. Any clues to help resolve the issue would be helpful.

 

---------------------------------------------------------------------------------------------------------------------------------------


eclipse.buildId=unknown

java.version=1.7.0_21

java.vendor=Oracle Corporation

BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

Command-line arguments:  -os win32 -ws win32 -arch x86_64


Error

Sun Jan 05 21:12:05 PST 2014

Problems occurred when invoking code from plug-in: "com.sap.ndb.studio.backup".

java.lang.NullPointerException


                at com.sap.ndb.studio.backup.commands.recovery.RecoveryCommandHandler$2.done(RecoveryCommandHandler.java:182)


                at org.eclipse.core.internal.jobs.JobListeners$3.notify(JobListeners.java:39)

                at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:112)

                at org.eclipse.core.internal.jobs.JobListeners.done(JobListeners.java:152)

                at org.eclipse.core.internal.jobs.JobManager.endJob(JobManager.java:647)

                at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:105)

                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:70)

---------------------------------------------------------------------------------------------------------------------------------------


 

 


Calculation column Syntax

$
0
0

Calculation column in Analytic view syntax: if(now()>"DATAB" AND now()<"DATBI",'now()','isnull()')

 

is the syntax correct ?

hana db is not running.

$
0
0

when i execute HDBAdmin.bat file it shows shared memory not initialized.retry in 5 sec.

XSJOB not able to access file

$
0
0

Hi,

 

I have a xs job running, which is supposed to execute a function from a xsjs file. But the job shows up error saying - "Access to source denied (404)"

Any pointers as to why?

I have granted the role : sap.hana.xs.admin.roles::JobAdministrator to my user. Anything else I have missed?

 

Thanks & Kind regards,

Reshma

SAP HANA STUDIO Not Responding

$
0
0

Hi All,

 

Good Day!!

 

Recently I have updated SAP HANA instance from SPS5 Revision 52 to SPS6 Revision 60.

 

I have updated SAP HANA Studio as well to SPS6 revision 60.

 

When I try to go to Modeler perspective and navigate to the content folder under my ID, the STUDIO gets hung.

After waiting, I could see in the task manager that "Modeler - - SAP HANA STUDIO Not Responding"

 

When I end it in task manager, I get the below error.

 

--XX: +HeapDumpOnOutOfMemoryError

 

I'm facing this issue only when I try to navigate to content folder and I don't see with rest of the navigations.

 

Later I updated SAP HANA Studio to revision 61, and this actually fixed the issue, I don't see this error in revision 61.

 

Please provide inputs or solution if anyone has come across the same issue.

 

Thanks & Regards,

Sampath Shankar

HANA equivalent of oracle's sql%rowcount to get affected rows.

$
0
0

I want to get the number of rows affected from an insert or update statement inside a stored procedure.

 

Is there any equivalent to oracle's sql%rowcount that can be called after the query.

 

For example:

 

create procedure procedure_name

begin

     declare l_c integer;

     insert into table values ('somevalue');

     l_c := sql%rowcount; -- This would return 1 for the row inserted.

end;

stored procedure creation and activation

$
0
0

Hello all,

 

can anyone tell me which privilege I would require in order to create a stored procedure?

I get the following error message:

 

05-14-2014 3-55-06 PM.jpg

 

thanks for any suggestions...

Error when test sapui sdk help on cloudshare hana instance


Hana Modelling

$
0
0

Hai

 

Iam new to SAP HANA, will some help Hana Modelling to create View, Analytical View, and Calculation View.

 

Where is to be create

How to create

com.sap.db.jdbc.exceptions.jdbc40.SQLDataException: [303]: invalid DATE, TIME or TIMESTAMP value: Error while parsing DATE/TIME at function to_timestamp()

$
0
0

I've written a program that needs to insert data that includes a timestamp column into HANA using a jdbc connection. This insert fails every time with com.sap.db.jdbc.exceptions.jdbc40.SQLDataException: [303]: invalid DATE, TIME or TIMESTAMP value: Error while parsing DATE/TIME at function to_timestamp(). The code produces SQL that will run in HANA in a SQL session.

 

code sample

...

private static final String INSERT_STW = "insert into STW.STWS values(?,?,?,TO_TIMESTAMP(?,'YYYY-MM-DD HH24:MI:SS.FF3'),?,?,?,?,new ST_POINT(?,?))";

 

PreparedStatement prepStatement = con.prepareStatement(INSERT_STW);

 

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

 

String format1 = "'" + format.format(createdAt) + "'";  // createdAt has value Fri May 09 14:13:49 EDT 2014 and produces format1 = '2014-05-09 14:13:49.000'

 

prepStatement.executeUpdate();

 

produces this SQL which will insert using a SQL connection to HANA

 

insert into STW.STWS values(464830615054217217,'en',2305754499,TO_TIMESTAMP( '2014-05-09 14:13:49.000','YYYY-MM-DD HH24:MI:ss.FF3'),'GB',0,'@jade46_ ict is hard okay',0,new ST_POINT( -0.35978946,52.78673714))

 

Thank you in advance for any help.

Wayne

How to register in SCC from SAP Appbuilder?

$
0
0

Hello All,

I am new to SAP appbuilder. I am developing an app using appbuilder for registering a user in SCC. I am not able to load the SAP logon screen while running the app. Can anyone please help me in how to load the SAP logon screen from the app and hence register in SCC?

Transpose rows to columns

$
0
0

Hello,

 

I have temporary table with one column like this.

 

Data

 

a

 

b

 

c

 

My Problem is to convert the temporary table to like this.

 

Col1  Col2 Col3

  a       b      c

 

 

Please help me.

Recommendations for Data model design in HANA

$
0
0

Hello All,

 

I am trying to build a complete data model in HANA using some tables from ECC and APO. But the combination of tables are such that it is making difficult for me to join them. i have tried various combinations of Analytical, Attribute and Calculation views but of no help.

hence I am requesting to suggest/recommend what you think can best fit.

 

ECC tables:

VBAP

VBAK

PLAF

MARA,

MARC,

KNA1

 

APO

/SAPAPO/MATKEY

/SAPAPO/LOC

 

Any suggestions will be helpful.

 

thanks in advance.

 

rgs,

Parth. 

Viewing all 6412 articles
Browse latest View live


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