[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Problem with StrToDate function



I am using SQR 4.0.1 and Oracle 8.0.6 on the server
side and Workbench 4.1.2 on the client side (Win95)
for testing purposes. Workbench connects to the
databasevia SQR ODBC Drive for Oracle 7.

I recently encountered a problem with a report that
usually works fine except when evaluating StrToDate
functions.

My report retrieves input parameters from the database
(These parameters can optionally be hardcoded within
the report as well for testing purposes, the problem
occurs in both cases) and there are ten or so possible
input parameters but for this scenario I will examine
three of them: start date, end date, and entity ID.

The possible combinations of these three input
parameters are start date and end date, entity ID, or
entity ID and start date and end date.

The datatype of the start and end date input
parameters is always text. If the dates are entered
they are converted from text datatype to date datatype
using the StrToDate function. The converted values are
later used in where clauses to filter the result set.
An example is provided below:

    IF $inputStartDate <> ''
        LET $convertedStartDate =
STRTODATE($inputStartDate, 'MM/DD/YYYY')
    END-IF

where $convertedStartDate is declared as a global DATE
variable.

If I run the report and only supply the entity ID the
report runs fine. If I supply a start and end date the
report fails at the line above with the following
error message:

    Error on line 1089:
       (SQR 4038) Out of space while processing
expression; Use -Mfile to
       increase EXPRESSIONSPACE.

I have tried setting EXPRESSIONSPACE to 65535 with no
success. The odd thing is when I add the following
lines:

    LET $someDateStr = '01/01/2001'
    LET $convertedStartDate = STRTODATE($someDateStr,
'MM/DD/YYYY')

as the first lines executed in the begin-program block
I get the same error. The above lines will not execute
until I delete most of the procedures from the report.
I tried setting the following limits:

    DYNAMICARGS=500
    EXPRESSIONSPACE=65535
    FORWARDREFS=1000
    NUMVARIABLES=1000
    ONBREAKS=75
    POSITIONS=5000
    PROGLINEPARS=65535
    PROGLINES=10000
    QUERIES=400
    QUERYARGS=2000
    SQLSIZE=10000
    STRINGSPACE=60000
    SUBVARS=2000
    VARIABLES=5000
    WHENS=1000

thinking this would help but it did not.

Does anyone have an idea of what is causing this
error?


Samer Kanjo
Eli Lilly and Company



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! 
http://auctions.yahoo.com/