Well, the law has two main ideas about plug-in power cords:
First: Basically, anything that plugs in is not considered premises wiring, so it's important to avoid using rubber cords in lieu of fixed wiring methods.
In other words, don't penetrate walls, floors, or ceilings. Cords aren't 'installed'. There are rules that govern their use, which I can post excerpts of when I retrieve my N.E.C. book. (It's at a job; I always keep it where I'm working)
Second, In a properly-wired room, you should never need a cord over 6 feet long. However, in a case such as mine, with a ceiling-mounted projector, the proper thing to do is have a receptacle installed in the ceiling within the cord length of the projector.
ICIM, if you mean, by "permanently attaching it with something like an open "D" style of cable clamp", you mean something like draping the wire from the center of the ceiling to a wall, and down to a receptacle, that's not something you would have inspected (and certainly never do for a customer).
That would be, in my opinion, a temporary wiring method, and since it plugs in, you could get away with it. However, it would never pass inspection as a method of wiring a ceiling light or other fixture.
Larry
www.fineelectricco.com