loopbackio / loopback-connector-oracle

Connect Loopback to Oracle
http://loopback.io/doc/en/lb3/Oracle-connector.html
Other
28 stars 30 forks source link

Cannot insert data when model is created dynamically. #129

Closed angularj closed 7 years ago

angularj commented 7 years ago

Description/Steps to reproduce

`ds.discoverSchema(dynamicTableName, function (err, schema) { ds.createModel(schema.name, schema.properties, schema.options); appModel = ds.getModel(schema.name); app.model(appModel, { dataSource: app.dataSources.source, public: true }); });

//Calling -> appModel.create(items, function (err, details) {});

//Error -> loopback-connector-oracle\lib\Oracle.js

Oracle.prototype.buildInsertReturning = function(model, data, options) { var modelDef = this.getModelDefinition(model); var type = modelDef.properties[this.idName(model)].type; ////////////////////////// ERROR!! var outParam = null; if (type === String) { outParam = new this.driver.OutParam(this.driver.OCCISTRING); } else { outParam = new this.driver.OutParam(); } var params = [outParam]; var returningStmt = new ParameterizedSQL('RETURNING ' + this.idColumnEscaped(model) + ' into ?', params); return returningStmt; };

Expected result

Additional information

node 6.10.1 loopback-connector-oracle@^2.4.1 loopback-connector@^2.1.0 loopback-boot@^2.6.5 loopback@^2.22.0 loopback-datasource-juggler@^2.39.0

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 7 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.