I am unable to find a way to escape a single quote inside a select statement. For example, the following works perfectly:
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joes Desk'"
However, I can't find a way to perform the select with an apostrophe inside "Joe's Desk". I have tried the following without success:
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joe\'s Desk'"
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joe''s Desk'"
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location=\"Joe's Desk\""
... and others, without success. I've got to be missing something simple and/or obvious, but I'm stumped. The q drmedia command handles the apostrophe just fine, but the requirement (as far as I can tell) that the right hand side of the select where predicate be single-quoted is the source of the problem. I realize I can work around this in a number of ways (don't use apostrophies, use q drm instead of select, etc)... however, I'd really like to make the select work.
Any help would be MUCH appreciated!
-- Rob
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joes Desk'"
However, I can't find a way to perform the select with an apostrophe inside "Joe's Desk". I have tried the following without success:
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joe\'s Desk'"
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location='Joe''s Desk'"
dsmadmc -id=admin -password={pw} "select VOLUME_NAME from DRMEDIA where STATE='NOTMOUNTABLE' and location=\"Joe's Desk\""
... and others, without success. I've got to be missing something simple and/or obvious, but I'm stumped. The q drmedia command handles the apostrophe just fine, but the requirement (as far as I can tell) that the right hand side of the select where predicate be single-quoted is the source of the problem. I realize I can work around this in a number of ways (don't use apostrophies, use q drm instead of select, etc)... however, I'd really like to make the select work.
Any help would be MUCH appreciated!
-- Rob