Hello,
For file variable names, is there anyreason not to use dashes (-) ?
Awhile ago I heard that underscores ( _ )
should be used for Oracle access...
Rob

DASHES or Underscore
Started by Rob Fantini, Oct 29 2001 03:38 PM
5 replies to this topic
#2
Posted 29 October 2001 - 03:49 PM
SQL code handles various characters in different ways, depending on the relational database being used. In Sequel Server 7 for instance, adding a field to a table like this
my-field ; would cause the variable to be saved as [my-field], indicating that Sequel does not prefer the dash.
Similarly, naming field like this
my field ; will caus Sequel to assign the field as [my field], since spaces are in and of itself invalid in a field name. sequel overcomes this by parenthesis.
I would suggest that you be carefull in this regard, because ProIV will accept a field name that could be invalid in say Sequel or Oracle - and may cause some weird effects. Perhaps some trial and error is called for.
Regards
Brendon Koch.
my-field ; would cause the variable to be saved as [my-field], indicating that Sequel does not prefer the dash.
Similarly, naming field like this
my field ; will caus Sequel to assign the field as [my field], since spaces are in and of itself invalid in a field name. sequel overcomes this by parenthesis.
I would suggest that you be carefull in this regard, because ProIV will accept a field name that could be invalid in say Sequel or Oracle - and may cause some weird effects. Perhaps some trial and error is called for.
Regards
Brendon Koch.
#3
Posted 29 October 2001 - 04:27 PM
Brendon
re: my-field ; would cause the variable to be saved as [my-field], indicating that Sequel does not prefer the dash.
That did not make sense to me.. Maybe a typo or browser problem..
If my-field is uses as my-field then that is not a problem?
To those using Oracle , Sql etc, what are the rules for using dashes and or underscores?
re: my-field ; would cause the variable to be saved as [my-field], indicating that Sequel does not prefer the dash.
That did not make sense to me.. Maybe a typo or browser problem..
If my-field is uses as my-field then that is not a problem?
To those using Oracle , Sql etc, what are the rules for using dashes and or underscores?
#4
Posted 29 October 2001 - 07:33 PM
It's better generally for universal portability to start names with a letter and use only letters, digits and underscore. Then you're pretty safe with most of the world's programming languages and linkers, never mind databases.
Oracle allows # and $ (not as the first char), which is handy for the conventions a lot of ProIV people seem to use but is not supported by all databases.
BUT - you don't have to worry too much in advance because you can always use the ProIV alternate field name (expand mode in trad. bootstrap I think) to override a file variable name which turns out not to be a valid column name.
Oracle allows # and $ (not as the first char), which is handy for the conventions a lot of ProIV people seem to use but is not supported by all databases.
BUT - you don't have to worry too much in advance because you can always use the ProIV alternate field name (expand mode in trad. bootstrap I think) to override a file variable name which turns out not to be a valid column name.
Nothing's as simple as you think
#6
Posted 30 October 2001 - 03:54 AM
Rob
To add to Richards post, it would be advisable not to use any characters in a field/column name which can be construed as numeric operators within an SQL statement. So, the example of my-field could be parsed as column MY minus column FIELD as a numeric expression. I use this as an example as I suspect that the '-' would probably be trapped when creating the table in the first place. Also, Oracle uses '%' (LIKE statement) and '&' (Keyboard Input) so avoid them.
To quote the Oracle SQL manual, 'The names of Oracle identifiers, such as tables and columns, must not exceed 30 chars in length. The first char must be a letter, but the rest can be any combination of letters, numerals, dollar signs, pound signs and underscores.'
Also, if you use Oracle 8i, query the view V$RESERVED_WORDS to see words which should not be used for tables/columns or keywords(An example of a keyword would be a variable name within a PL/SQL block).
Doug
To add to Richards post, it would be advisable not to use any characters in a field/column name which can be construed as numeric operators within an SQL statement. So, the example of my-field could be parsed as column MY minus column FIELD as a numeric expression. I use this as an example as I suspect that the '-' would probably be trapped when creating the table in the first place. Also, Oracle uses '%' (LIKE statement) and '&' (Keyboard Input) so avoid them.
To quote the Oracle SQL manual, 'The names of Oracle identifiers, such as tables and columns, must not exceed 30 chars in length. The first char must be a letter, but the rest can be any combination of letters, numerals, dollar signs, pound signs and underscores.'
Also, if you use Oracle 8i, query the view V$RESERVED_WORDS to see words which should not be used for tables/columns or keywords(An example of a keyword would be a variable name within a PL/SQL block).
Doug
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users