![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Would like to ask this as my starting point; the CALC QBE feature doesn't appear to have any way to combine a numeric field (in this case, Short) with an Alpha-defined field to create a new third field; is there a method outside of writing some OPAL code using STRVAL to combine the two aforementioned types? In PAL that's the approach I had to use. |
#3
| |||
| |||
|
|
Greetings - At long last have moved over to (or "up to"??) pdox 11 (in winXP) from a long-established DOS-based pdox DB application and so must rewrite a good number of PAL scripts into OPAL-based forms and/or stand-alone scripts; or perhaps, hopefully, use some of the expanded features of pdox. Would like to ask this as my starting point; the CALC QBE feature doesn't appear to have any way to combine a numeric field (in this case, Short) with an Alpha-defined field to create a new third field; is there a method outside of writing some OPAL code using STRVAL to combine the two aforementioned types? In PAL that's the approach I had to use. If there isn't some neat undocumented trick, I'll follow up w/ my specific example, as it involves doing QBEs on two different (but closely-related in structure) tables and combining the selected records into a third table in order to write a number of reports. The 3rd table structure is based on the table which doesn't require the combining of the previously mentioned fields. Thanks for any feedback, general or otherwise, on this. Mike |
#4
| |||
| |||
|
|
Would like to ask this as my starting point; the CALC QBE feature doesn't appear to have any way to combine a numeric field (in this case, Short) with an Alpha-defined field to create a new third field; |
#5
| |||
| |||
|
|
Mike wrote: Would like to ask this as my starting point; the CALC QBE feature doesn't appear to have any way to combine a numeric field (in this case, Short) with an Alpha-defined field to create a new third field; Not in QBE, but in Local SQL: SELECT YourShort, YourAlpha, CAST(YourShort AS CHAR(5)) || YourAlpha FROM MikesTable Works with any short because the final length of any short is 5 or less ( 32768) |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
SELECT YourShort, YourAlpha, CAST(YourShort AS CHAR(5)) || YourAlpha FROM MikesTable Thanks Larry; this approach would certainly be a "move up" as it were from rewriting a script, but when I start looking over what's available via pdox help I notice the words "the SQL driver" being installed. Is that required in order to do local SQL commands? BTW, my use is stricly standalone, on one PC. As a followup can you briefly explain or point to a source, on how one, after creating via the SQL editor the code as mentioned, "call" or execute that piece of SQL logic? Thanks again for the input. Mike |
#8
| |||
| |||
|
|
Mike, You can save SQL queries just like you can save QBE queries (as a file) and then just run the file manually. If you wanted to put the query in code, then it's rather like you do with QBE queries - check the ObjectPAL help for SQL, especially executeSQL(). To run SQL against Paradox tables, you do not need anything special/extra installed. I'm sure what you were reading is in relation to non-Paradox tables accessed via ODBC, etc. Liz Mike wrote: SELECT YourShort, YourAlpha, CAST(YourShort AS CHAR(5)) || YourAlpha FROM MikesTable Thanks Larry; this approach would certainly be a "move up" as it were from rewriting a script, but when I start looking over what's available via pdox help I notice the words "the SQL driver" being installed. Is that required in order to do local SQL commands? BTW, my use is stricly standalone, on one PC. As a followup can you briefly explain or point to a source, on how one, after creating via the SQL editor the code as mentioned, "call" or execute that piece of SQL logic? Thanks again for the input. Mike |
#9
| |||
| |||
|
|
One of my drawbacks is a lack of "current" pdox OPAL book documentation to read, so I'm using more of the pdox built-in Help for these "later" features which are mentioned. |
|
Liz - Ah, the light starts to get brighter; thanks. One of my drawbacks is a lack of "current" pdox OPAL book documentation to read, so I'm using more of the pdox built-in Help for these "later" features which are mentioned. Found the SQL query "expert", so now have a better understanding of what Larry meant in his code example. I do hope to make the old PAL procedures "hands-off" via OPAL, so will followup on the many suggestions that have been put forth. You know, a few using method "a", a few using "b", etc.etc Mike Liz McGuire wrote: Mike, You can save SQL queries just like you can save QBE queries (as a file) and then just run the file manually. If you wanted to put the query in code, then it's rather like you do with QBE queries - check the ObjectPAL help for SQL, especially executeSQL(). To run SQL against Paradox tables, you do not need anything special/extra installed. I'm sure what you were reading is in relation to non-Paradox tables accessed via ODBC, etc. Liz Mike wrote: SELECT YourShort, YourAlpha, CAST(YourShort AS CHAR(5)) || YourAlpha FROM MikesTable Thanks Larry; this approach would certainly be a "move up" as it were from rewriting a script, but when I start looking over what's available via pdox help I notice the words "the SQL driver" being installed. Is that required in order to do local SQL commands? BTW, my use is stricly standalone, on one PC. As a followup can you briefly explain or point to a source, on how one, after creating via the SQL editor the code as mentioned, "call" or execute that piece of SQL logic? Thanks again for the input. Mike |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |