Bug: Error Convert Type #26

Merged
salim-dev merged 1 commit from patch-1 into master 2021-09-28 23:29:24 +01:00
salim-dev commented 2021-09-27 21:41:24 +01:00 (Migrated from github.com)

Stopped at ., 3/23:\n[XPTY0004] Cannot convert xs:string to xs:integer: "xx".

Stopped at ., 3/23:\n[XPTY0004] Cannot convert xs:string to xs:integer: "xx".
apb2006 commented 2021-09-28 23:29:29 +01:00 (Migrated from github.com)

Thanks for this. I have never used typed parameters though this API.

There seems to be no reason not to pass the type if has been set.

I plan add a test for the binding behavoir.
Do you have a simple example where this is needed?

Thanks for this. I have never used typed parameters though this API. There seems to be no reason not to pass the type if has been set. I plan add a test for the binding behavoir. Do you have a simple example where this is needed?
salim-dev commented 2021-09-29 11:37:01 +01:00 (Migrated from github.com)

Thank.
below is an example to add in the test-commands.js file.

describe(
		'create query and bind with type ',
		function() {
			var reply, err;
			before(function(done) {
				var input = "declare variable $max external := 20; for $i in 1 to $max return element Number { $i }";
				var query = session.query(input);

				// bind variable with type
				query.bind("max", 50, "xs:integer");

				// print results
				query.execute(function(e, r) {
					reply = r;
					err = e;
					done();
				});
			});

			it('It should not error', function() {
				should.not.exist(err);
			});
			it('It should return a string', function() {
				reply.result.should.be.a.String
			});
		});
Thank. below is an example to add in the test-commands.js file. ``` describe( 'create query and bind with type ', function() { var reply, err; before(function(done) { var input = "declare variable $max external := 20; for $i in 1 to $max return element Number { $i }"; var query = session.query(input); // bind variable with type query.bind("max", 50, "xs:integer"); // print results query.execute(function(e, r) { reply = r; err = e; done(); }); }); it('It should not error', function() { should.not.exist(err); }); it('It should return a string', function() { reply.result.should.be.a.String }); }); ```
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quodatum/basex-node!26
No description provided.