Skip to main content
New Participant
Dec 2, 2022 4:47 PM UTC

UOPY SQL statement fails, but works at TCL prompt.

Hoping this is the correct forum for a UOPY/U2 question.

Using U2 11.3.4 and UOPY 

I'm having an issue with UOPY sending an SQL select statement that works @ TCLprompt.

Retrieve command:
This works from Python using BOTH UOPY and TCL prompt:   
      SELECT TABLE1 WITH ORDER.NO = 177
This only returns the index value, but it works

SQL command:
This works at TCL prompt, but fails going thru Python/UOPY:
     SELECT CITY FROM TABLE1 WHERE ORDER.NO = 177;

I have tried with "177"    double quotes or single quotes  '177'.  Also with/out  ; at the end
I have tried sending the command as both uppercase and lowercase.


What am I missing?
Thanks for your time.




​

------------------------------
Dave Evans
Programmer
Combined Transport Inc
central point OR US
------------------------------

    1 reply

    New Participant
    Dec 2, 2022 6:26 PM UTC
    Hoping this is the correct forum for a UOPY/U2 question.

    Using U2 11.3.4 and UOPY 

    I'm having an issue with UOPY sending an SQL select statement that works @ TCLprompt.

    Retrieve command:
    This works from Python using BOTH UOPY and TCL prompt:   
          SELECT TABLE1 WITH ORDER.NO = 177
    This only returns the index value, but it works

    SQL command:
    This works at TCL prompt, but fails going thru Python/UOPY:
         SELECT CITY FROM TABLE1 WHERE ORDER.NO = 177;

    I have tried with "177"    double quotes or single quotes  '177'.  Also with/out  ; at the end
    I have tried sending the command as both uppercase and lowercase.


    What am I missing?
    Thanks for your time.




    ​

    ------------------------------
    Dave Evans
    Programmer
    Combined Transport Inc
    central point OR US
    ------------------------------
    UPDATE from Dave.

    I replaced my  cmd.command_text = ' the select  statement'
    with cmd = uopy.Command('the select statement')
    then 
    cmd.run()
    looked at "cmd.response" returned value  I now have the value I expect.

    Dave

    ------------------------------
    Dave Evans
    Programmer
    Combined Transport Inc
    central point OR US
    ------------------------------