[Zope-dev] Problem in Fetching values from the ZSQL method
joseph_ig
gladiatorg4 at gmail.com
Wed May 19 11:24:46 EDT 2010
Hi Charlie,
Let me thank you first for the help.
SELECT
SecID
,SUM(CASE WHEN txnType IN('pi') THEN quantity ELSE 0 END) AS InitPos
,SUM(CASE WHEN txnType IN('pe') THEN quantity ELSE 0 END) AS EndPos
FROM Txntemp
WHERE Txntemp.fileImportID = < dtml-sqlvar seqID type="int" >
GROUP BY SecID
Could you please explain how to make use of the src__=True parameter and
where can we view exactly what SQL is being sent to the database.
Please clarify in details.
Charlie Clark-6 wrote:
>
> Am 19.05.2010, 09:48 Uhr, schrieb joseph_ig <gladiatorg4 at gmail.com>:
>
>> Hi all,
>
> Hiya Joseph,
>
> zope-db is a better list for this discussion.
>
>> I have written a ZSQL method named ('getSummaryValue') for fetching the
>> summary result from a table. Please see the following query.
>> SELECT
>> SecID
>> ,SUM(CASE WHEN txnType IN('pi') THEN quantity ELSE 0 END) AS InitPos
>> ,SUM(CASE WHEN txnType IN('pe') THEN quantity ELSE 0 END) AS EndPos
>> FROM Txntemp
>> WHERE Txntemp.fileImportID =
>> GROUP BY SecID
>
>> This ZSQL method takes a single parameter "seqID" of type "int"
>> This ZSQL method script is called within a Python_script as follows
>> context.getSummaryValue(seqID = SequenceID)
>
>> the "SequenceID" is passed in as a request variable to the python
>> script. I
>> have two sites one testing and another Live.
>
>> In testing site the script does return value for the sequenceID passed
>> into it as a request variable.
>
>> But while running in Live environment it doesn't return any value for
>> the sequenceID passed into it as a request variable.
>> But when the sequeneceID is hardcoded into the python script it does
>> return
>> the details in LIVE.
>
> I don't see seqID being used in the statement.
>
> You can debug the call by passing in the src__=True parameter. This will
> allow you to see exactly what SQL is being sent to the database.
>
>> Please help to resolve the issue. All help are really appreciated. Its
>> really critical Please help.
>
> Charlie
> --
> Charlie Clark
> Managing Director
> Clark Consulting & Research
> German Office
> Helmholtzstr. 20
> Düsseldorf
> D- 40215
> Tel: +49-211-600-3657
> Mobile: +49-178-782-6226
> _______________________________________________
> Zope-Dev maillist - Zope-Dev at zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> https://mail.zope.org/mailman/listinfo/zope-announce
> https://mail.zope.org/mailman/listinfo/zope )
>
>
--
View this message in context: http://old.nabble.com/Problem-in-Fetching-values-from-the-ZSQL-method-tp28605115p28609879.html
Sent from the Zope - Dev mailing list archive at Nabble.com.
More information about the Zope-Dev
mailing list