Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RID to String conversion #4342

Closed
aleks-n opened this issue Jun 10, 2015 · 2 comments
Closed

RID to String conversion #4342

aleks-n opened this issue Jun 10, 2015 · 2 comments
Labels

Comments

@aleks-n
Copy link

aleks-n commented Jun 10, 2015

Hi all,

Could you please suggest a proper way to convert RID of existing Vertex to String?
Getting following error message:
"java.lang.IllegalArgumentException: Argument '?' is not a RecordId in form of string. Format must be: : [ONetworkProtocolHttpDb]".

Code:

var cmdCreateRel = "create edge Child from ? to (select from Site where code='" + code +"')";
print("3:::cmdCreateRel: " + cmdCreateRel);
var cityRidAsString = "" + cities[ci].getRecord().field('@Rid');
print("3:::c rid: " + cityRidAsString);
gdb.command("sql", cmdCreateRel, [cityRidAsString]);

Server console:

3:::
3:::cmdCreateRel: create edge Child from ? to (select from Site where code='County-0_City-99_Site-0')
3:::c rid: #15:2001

2015-06-10 09:19:15:309 SEVERE Internal server error:
java.lang.IllegalArgumentException: Argument '?' is not a RecordId in form of string. Format must be: : [ONetworkProtocolHttpDb]

But following statement works in Studio:

create edge Child from #15:2001 to (select from Site where code='County-0_City-99_Site-0')

@luigidellaquila
Copy link
Member

Hi @aleks-n

which OrientDB version? Input parameters as query target are supported since 2.1

@aleks-n
Copy link
Author

aleks-n commented Jun 12, 2015

Hi,

It is 2.0.10 Community Edition for Windows (orientdb-community-2.0.10.zip). And following test code works fine.

for (var i = firstFloorNumber; i < runNum; i++){
var floorName = "Floor-" + i;
var floorCode = buildingCode + "_" + floorName;
var cmdCreateFloor = "create vertex Floor set name=?, code=?";
var floor = gdb.command("sql", cmdCreateFloor, [floorName, floorCode]);
}

@laa laa closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants