SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Works in Toad but not in VBScript

    I have some SQL which works fine in Oracle but when I prep it for execution in VBScript I get a ORA-00911 Invalid Character message.

    I have gone over this a number of times and cannot see an issue, anyone see something I am missing?

    '=============================== SQL ===========================================
    sql = " select "&_
    "etp_audit.prescribing_organisation Prescribing_Org, "&_
    "count(etp_audit.prescribing_organisation) Count_ "&_
    "from "&_
    "ers_etp_audit etp_audit, "&_
    "ers_etp_audit_subject etp_audit_subject "&_
    "where "&_
    "etp_audit.guid = etp_audit_subject.guid "&_
    "and "&_
    "etp_audit.time_stamp = etp_audit_subject.time_stamp "&_
    "and "&_
    "etp_audit.prescribing_organisation is not null "&_
    "and "&_
    "etp_audit.prescribing_organisation = 'A81001' "&_
    "and "&_
    "etp_audit.time_stamp >= to_date('01/06/2008 00:00:00','DD/MM/YYYY HH24:MI:SS') "&_
    "and "&_
    "etp_audit.time_stamp <= to_date('14/07/2008 23:59:59','DD/MM/YYYY HH24:MI:SS') "&_
    "and "&_
    "etp_audit.bus_msg_type in ('PORX_IN020101UK04','PORX_IN020102UK04','PORX_IN0 20101UK31', 'PORX_IN020102UK31','PORX_IN020101UK32','PORX_IN02 0102UK32') "&_
    "and "&_
    "etp_audit_subject.treatment_type = '0001' "&_
    "and "&_
    "etp_audit_subject.prescription_create_date >= to_date('01/06/2008 00:00:00','DD/MM/YYYY HH24:MI:SS') "&_
    "and "&_
    "etp_audit_subject.prescription_create_date <= to_date('14/07/2008 23:59:59','DD/MM/YYYY HH24:MI:SS') "&_
    "group by "&_
    "etp_audit.prescribing_organisation; "
    '================================================= ========================

    ' Executeion statement:

    Set rs = Connect.Execute (sql,,adcmdtext)


    Mark Smith.

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Works in Toad but not in VBScript

    Finally solved it, VBScript doesn't like the ; on the last line of the SQL.

    Mark Smith.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 13.64%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:47 PM.

Copyright BetaSoft Inc.