Hyphen (-) issue with SQL92

osmjimtsr

New Member
Dear all,

Currently I have an issue with Hyphen-ed Table/Field name.

With SQL89 we can use the -esqlnopad.

With SQL92 we can add \ or "" on the Table Name or Field.

My Problem:
There are too many of field/table name need to be prefixed with "\" or
enclosed with " ".

Is there any solution like the SQL89's -esqlnopad ?

Thank you.
Regards,
 

joey.jeremiah

ProgressTalk Moderator
Staff member
Not that it's really relevant to the original question but a common best practice is to use underscores as word separators with database fields.

Because reserved words use hyphens, never underscores and even a single underscore guarantees there will never be reserved word conflicts.
 

osmjimtsr

New Member
You must be kiddin', right?

I know we can use unix' - SED to search and replace,
but is there any other solution than this one?

Any Progress personnel info on this?

Thank you.

Regards,
 

tamhas

ProgressTalk.com Sponsor
No, I'm not kidding. This is a place where historical practice in naming standard for Progress databases comes into ugly conflict with naming standards in SQL. I don't think there is a magic bullet. Choices are:

1) Get used to adding the quotes ... doesn't mean you can't build a tool to help put them in for you in legacy code, but one way or another they need to get there.

2) Define a bunch of views which don't have this problem and use those instead. Of course, if you have a bunch of legacy SQL, that needs to be fixed to point at the views.

3) Do a name refactoring on your database to get rid of the problem. I suggest ProRefactor to do this. I think it is the best solution long term, although it tends to mean a fair amount of short term work.
 

osmjimtsr

New Member
Thanks a lot Tamhas,

I think you had saved my time of searching for a magic bullet.

I understand now that by using SQL92 we need to
remove this "road block".

You know sometimes the "fair amount of short-term work" needed to do this necessary things, does not easily translated to the approval
of your boss :confused: hehehehe.

I will try to look at the prorefactor and see how best it can help.

Really appreciated.

Regards,
 
Top