Re: [Nolug] python

From: Devin Villegas <dvillega_at_gmail.com>
Date: Thu, 11 Sep 2014 19:35:34 -0500
Message-ID: <CAHy3XzjEScsExaEvBe5iwQuyez3yhn2OMOd0BRn6axapVTRHCQ@mail.gmail.com>

If you write much python that constructs SQL, i've found a lot of use in raw
strings <https://docs.python.org/2/tutorial/introduction.html#strings> as
well as string formatting <http://mkaz.com/2012/10/10/python-string-format/>
.

( also incredibly useful for logging modules )

-Devin

On Thu, Sep 11, 2014 at 3:34 PM, Diann Smith <diann170@gmail.com> wrote:

> thanks a lot for your help I think I got it
>
> 'AND plan_submittals.PLAN_SUB_CODE = ' " 'I' ' " ' + sde_conn
>
> Thanks for your help
>
> On Wed, Sep 10, 2014 at 3:16 PM, Cruz Molina <freethinkingaway@gmail.com>
> wrote:
>
>> Looks like your code should be:
>>
>> holder += ' -w \"PLAN_WELL_SITES_BOTM_SDE_VIEW.SN_PLAN_SUB_FK =
>> plan_submittals.sn_plan_sub '
>> holder += 'AND plan_submittals.PLAN_SUB_CODE = \'l\'\"' + sde_conn
>>
>>
>> If holder = ""
>> and then both of the lines above are executed, minus the + sde_conn at
>> the end of the second line,
>> print(holder) should output:
>>
>> -w "PLAN_WELL_SITES_BOTM_SDE_VIEW.SN_PLAN_SUB_FK = plan_submittals.sn_plan_sub AND plan_submittals.PLAN_SUB_CODE = 'l'"
>>
>>
>> And if that's what you're going for, that should be it [?]
>>
>>
>>
>>
>> On Wed, Sep 10, 2014 at 2:01 PM, joe johannesburg <jdj2005@gmail.com>
>> wrote:
>>
>>> what is the error returned and do a print of holder after the last line
>>> and paste the result.
>>> On Wed, Sep 10, 2014 at 1:47 PM, Diann Smith <diann170@gmail.com>
>>> wrote:
>>>
>>>> can someone help me with this python script?
>>>>
>>>> #WHERE CLAUSE
>>>> holder += ' -w "PLAN_WELL_SITES_BOTM_SDE_VIEW.SN_PLAN_SUB_FK =
>>>> plan_submittals.sn_plan_sub '
>>>> holder += 'AND plan_submittals.PLAN_SUB_CODE = 'I'" + sde_conn
>>>>
>>>> I says the offending problem is the : = 'I ' "
>>>>
>>>> Can someone let me know how to change this
>>>>
>>>> Thanks
>>>> Barbara
>>>>
>>>
>>>
>>
>

___________________
Nolug mailing list
nolug@nolug.org

Received on 09/11/14

This archive was generated by hypermail 2.2.0 : 09/24/14 CDT