Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Query Drop View

    I have a programs that creates (and uses) 3 query VIEWs. Currently I have to go
    into the database and delete the views before I can re-run the program. Access
    supports the Query DROP VIEW <i>viewname</i> syntax.
    The code:
    <cfquery name="dropview" datasource=#dbsource# username=#dbuser#
    password=#dbpass#>
    DROP VIEW devsused
    </cfquery>
    The above results in the following error:
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
    Access Driver] Syntax error in DROP TABLE or DROP INDEX.

    Can somebody point me in the right direction?

    ftroute Guest

  2. Similar Questions and Discussions

    1. Rendering a derived drop down list in VS2005 designer view
      Hi I have a control derived from a drop down list written in VB.NET (ASP.NET 2.0) that dynamically displays listitems retrieved from an SQL...
    2. drop down db query error
      I am new to coldfusion so please bare with me. I found a tutorial on how to create dynamic drop down boxes. It almost works fine except the first dd...
    3. Query, view join question.
      Hi Tom, I could give you access to the database itself if needed. But these are the actual tables and view. I hope I will never make any tpo's...
    4. Drop view if it already exists
      What about something like IF (select COUNT(*) from information_schema.views WHERE TABLE_NAME = 'Your view') <> 0 Begin DROP VIEW 'Your view'...
    5. Access query Sql View
      I'm trying to create a sql view with sytax created in a microsoft access97 query The problem I'm having is with " IIf( Is Null,Null,"Yes") AS...
  3. #2

    Default Re: Query Drop View

    Don't think that using 3 queries and Q of Q is a viable option. Already doing Q
    of Q on the views. Will look at it again.

    Although Access supports the DROP VIEW syntax, it appears that CF does not. I
    have used DROP TABLE and DROP INDEX in the past with no problem.

    ftroute Guest

  4. #3

    Default Re: Query Drop View

    Regarding q of q from 3 queries. It takes a bit of work, but you can get
    results.

    3 real queries
    <cfquery name="a" datasource="dw">
    select event_code, event_name from event
    </cfquery>

    <cfquery name="b" datasource="dw">
    select event_code, event_name from event
    </cfquery>

    <cfquery name="c" datasource="dw">
    select event_code, event_name from event
    </cfquery>

    *****************************
    Q of Q
    <cfquery name="d" dbtype="query">
    select a.event_code as event_code, b.event_name as event_name
    from a, b
    where a.event_code = b.event_code
    </cfquery>

    <cfquery name="e" dbtype="query">
    select a.event_name as aa
    from a, d
    where a.event_code = d.event_code
    </cfquery>

    Notice in the 2nd one, that one of my queries, d, was a q of q.

    Dan Bracuk Guest

  5. #4

    Default Re: Query Drop View

    Got me really thinking and stepping back to look at the whole picture. Realized
    that what I was doing in the first place could be modified and eliminate a
    whole step deleted by doing so. My new approach will use 1 query and two Q of
    Q. Thanks for forcing me to open my eyes.

    ftroute Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139