snippets_py
Integration
New integration from credential
connection = yepcode.integration.sap_hana('credential-slug');
New integration from plain authentication data
const hana = require('@sap/hana-client');
const connection = hana.createConnection();
connection.connect({
serverNode: 'your-host-and-port',
uid: 'your-user',
pwd: 'your-password',
sslValidateCertificate: 'false'
});
Disconnect
Disconnect
connection.close()
DDL Statement
DDL Statement
cursor = connection.cursor()
cursor.execute('CREATE TABLE Test (ID INTEGER PRIMARY KEY, msg VARCHAR(128))')
cursor.close()
DML Statement
DML Statement
sql = 'INSERT INTO T1 (ID, C2) VALUES (?, ?)'
cursor = connection.cursor()
cursor.execute(sql, (1, 'hello'))
cursor.execute(sql, (2, 'hello again'))
cursor.close()
Query
Query
sql = 'SELECT * FROM T1'
cursor = connection.cursor()
cursor.execute(sql)
for row in cursor:
print(row)
Query Parametrized
Query Parametrized
cursor = connection.cursor()
cursor.execute("SELECT * FROM Test WHERE ID BETWEEN ? AND ?", (5, 8))
for row in cursor:
print(row)