View SQL before execution?

I'm a newbie to CF, so I apologize in advance as I've searched everywhere and cannot find the answer to the following.  I have a .html forms page that submits user-entered data to a .cfc for insertion into a MySQL db (insert code is below.)  The insert statement isn't working, and I don't get an error returned, so I'd like to view what the compiled SQL INSERT statement looks like before it actually attempts to hit the database.  This way I can copy and paste the SQL into my DB and see if I can debug.  I can confirm I am capturing all data from the .html page before submission to the .cfc.  Any and all assistance is greatly appreciated.  Thanks!
<cfquery name="qInsertEvent" datasource="dsnMySQL">
              INSERT INTO
                  tblEvents
                   (event_type, event_status, event_category, event_name, event_date, event_stateCode
<!--Optional fields: NULL-->
<cfif isDefined("arguments.event_city")>,event_city</cfif>
<cfif isDefined("arguments.event_venue")>,event_venue</cfif> 
<cfif isDefined("arguments.event_timeStr")>,event_time</cfif>) 
                  VALUES
                    (2, 'A',
<cfqueryparam value="#arguments.event_category#" cfsqltype="cf_sql_varchar"/>,
<cfqueryparam value="#arguments.event_name#" cfsqltype="cf_sql_varchar"/>,
                    <cfqueryparam value="#arguments.event_dateStr#" cfsqltype="cf_sql_varchar"/>,
<cfqueryparam value="#arguments.event_stateCode#" cfsqltype="cf_sql_varchar"/>,
<!--Optional fields: NULL-->
<cfif isDefined("arguments.event_city")>
                          <cfqueryparam value="#arguments.event_city#" cfsqltype="cf_sql_varchar"/>,
                    </cfif>
<cfif isDefined("arguments.event_venue")>
  <cfqueryparam value="#arguments.event_venue#" cfsqltype="cf_sql_varchar"/>,
                    </cfif>
                    <cfif isDefined("arguments.event_timeStr")>
                          <cfqueryparam value="#arguments.event_timeStr#" cfsqltype="cf_sql_varchar"/>
                    </cfif>)
          </cfquery>

Thanks.  The combo of answers has helped me get to a point where I can display the query.  Problem I'm experiencing now is my parameters aren't getting passed into the query.
This is what I get:
INSERT INTO tblEvents (event_type, event_status, event_category, event_name, event_date, event_stateCode ,event_city ,event_venue ,event_time) VALUES (2, 'A', ?, ?, ?, ? ,? ,? ,? )
Above the query, I have the following:
<cfargument name="event_category"     type="string"  required="true"/>
<cfargument name="event_name"   type="string"  required="true"/>
<cfargument name="event_venue"  type="string"  required="false"/>....
I know the parameters are being captured from the input screen as I've manually appended them to the URL for the CFC, and ran it only to get an error on any missing required parameters.
Any thoughts?  Thanks again!

Similar Messages

  • View SQL before i commit

    Hey gang, just say i'm using SQL Developer to delete some rowes out of a table. I've selected my rowes and i chose delete, before i commit is there any way to see the SQL statement that is going to be applied? I know that once i commit it, i do see it in the data editor log, but i want to see this before i commit. Possible?
    -Scott

    Yes: Preferences - Database - ObjectViewer Parameters - Post edits on row change (and obviously don't Set Auto Commit On ).
    Have fun,
    K.

  • Can we capture SQL Queries before execution?

    Hi Everyone,
    I would like to know that is there any way to capture SQL queries before execution?
    please advise.
    thanks
    kv

    Hi!
    You could capture the querys and use them as a payload for the "Database Engine Tuning Advisor".
    Maybe it gives you some indexes which raise the performance.
    But:
    I only would add indexes to user tables.
    Cheers,
    Roland
    PS.:
    Indexes which are created directly through SQL could be lost after a B1 Upgrade. So saving the creation-statements in a warm and secure place is recommended
    PPS.:
    ...and maybe such indexes are not supported by SAP...
    Edited by: Roland Toschek on Dec 1, 2008 6:23 PM

  • Size of SQL query before execution and after execution

    hi all
    I need help on how can i find out the size of SQL query before execution and after execution in java
    The query can be any query select / insert / update
    Can anyone help me if any system tables help to find out the required size i mentioned
    Urgent help is required
    Thanking in advance

    I need the size in terms of bytes
    like the rquirement is stated as below
    select ................: 10 B , return 250 B
    so i need size before and after execution in terms of bytes

  • Cannot View SQL button in XI 3.1 edit query mode

    Hi All,
    I am using Webi XI 3.1.
    I dragged the objects into results pane and want to view the SQL for the query. But I don't find the SQL button at all.
    Please help me where to get that!

    Hi George Pertea,
    Thanks for the reply.
    I am in the edit query mode and also the query tool bar is enabled.
    But my "view sql" button is disabled,I cannot click on it.
    I am logged in as "Admin" , so what is the problem.
    I was able to do that in XI R2 before.
    Please help me!
    Thanks

  • Unable to view SQL Server Agent while logged in as user

    Hello Everyone,
    I have granted SQLAgentUserRole permission to one of the user and using enterprise edition of SSMS. still user is not able to view SQL Server Agent. Any help will be greatly appriciated.

    There is no Enterprise Edition of SSMS. There is SSMS Basic and SSMS Complete. Prior to 2012 sp1, only SSMS Basic were available with Express Edition - but as of 2012 sp1 Expredd also offers SSMS Complete. SSMS Complete is selected bu default when you install
    SSMS (unless you are prior to 2012 sp1 and are using Express, of course).
    However, even SSMS Basic *should* show Agent assuming you have permissions for that. This is hearsay, but from trusted sources. Here is what to do:
    Check what is installed for the machine from where you are running SSMS. You can do that using SQL Server Installation Center - see this blog post: http://sqlblog.com/blogs/tibor_karaszi/archive/2011/02/10/what-does-this-express-edition-look-like-anyhow.aspx
     (towards the end).
    On that machine try both this problematic account as well as an account which is sysadmin. Does the sysadmin account see Agent? If so, you know permissions aren't granted properly. If not, then you know the tool is the problme.
    Also try the problematic account from a machine where you know you see Agent normally. Again, this will help you assess whether the problem is the tool (SSMS) or permissions for the account.
    Tibor Karaszi, SQL Server MVP |
    web | blog

  • How to view SQL for a materialized view in SQL Developer (Oracle 11g R2)

    Good Morning,
    I am new to SQL Developer 3.1.07 and just installed it on a Windows 7 PC yesterday.
    There's a materialized view for which I need to view (and eventually update) the SQL. The mat'lized view is in another schema, but my Oracle user does have access to the schema and to this particular mat'lized view. My user also has SELECT, INSERT, UPDATE, DELETE, DEBUG, and ALTER permissions. When I select (click on) the matl'ized view in the object tree on the left, a multi-tab window opens with information in the Columns, Indexes, Grants, Dependencies and Details tabs, but the SQL pane is blank. I don't know if there's some other GRANT that I need in Oracle, or if there's something else I need to do in SQL Developer to see the matl'ized view SQL.
    Thanks
    Bob Gardner
    [email protected]

    1007420 wrote:
    There's a materialized view for which I need to view (and eventually update) the SQL. The mat'lized view is in another schema, but my Oracle user does have access to the schema and to this particular mat'lized view. My user also has SELECT, INSERT, UPDATE, DELETE, DEBUG, and ALTER permissions. When I select (click on) the matl'ized view in the object tree on the left, a multi-tab window opens with information in the Columns, Indexes, Grants, Dependencies and Details tabs, but the SQL pane is blank. I don't know if there's some other GRANT that I need in Oracle, or if there's something else I need to do in SQL Developer to see the matl'ized view SQL.SQL*Developer can be tricky regarding what it shows for other schemas. I'm not sure what privileges you might need besides the one you listed except RESOURCE on the MV, or maybe CREATE ANY MATERIALIZED VIEW.
    Can you use DBMS_METADATA.GET_DDL to get the data you want (may/may not work due to privileges)?

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • Can anyone tell me if you can select to view your podcasts in  TILE VIEW like before. thanks

    can anyone tell me if you can select to view your podcasts in  TILE VIEW like before. thanks

    I am having the same problems.  Firstly found out that I had a duplicate email address on two apple ids so I fixed that but now it wont let me verify the email address.  When I click on "verify email address" nothing happens.  So frustrating cos cant set up Facetime or iMessage on my iPad.

  • Current running SQL stms execution plan?

    Hi,
    Is it any ways to findout the current running SQL stms execution plan?
    without using Explain plan & autotrace.
    Thanks in advance,
    Thomas.

    I'm using this code. You just have to give the Session Identifier (&SID ):SELECT     '| Operation                                     |  Objet   | Lignes| Bytes|  Cout  | Pstart| Pstop |' as "Plan Table"  FROM DUAL
    UNION ALL
    SELECT     '----------------------------------------------------------------------------------------------------' FROM DUAL
    UNION ALL
    SELECT * FROM
             (SELECT /*+ NO_MERGE */
              RPAD('| '||
                   SUBSTR(
                        LPAD(' ',1*(LEVEL-1)) || OPERATION || DECODE(OPTIONS, NULL,'',' '||OPTIONS), 1, 47
                         ), 48, ' '
              )||'|'||
              RPAD(
                   SUBSTR(OBJECT_NAME||' ',1, 9), 10, ' '
              )||'|'||
              LPAD(
                   DECODE(CARDINALITY,
                        NULL,'  ',
                        DECODE(SIGN(CARDINALITY-1000),
                              -1, CARDINALITY||' ',
                             DECODE(SIGN(CARDINALITY-1000000),
                                   -1,TRUNC(CARDINALITY/1000)||'K',
                                  DECODE(SIGN(CARDINALITY-1000000000),
                                       -1,TRUNC(CARDINALITY/1000000)||'M',
                                       TRUNC(CARDINALITY/1000000000)||'G')
                        ), 7, ' '
              )||'|'||
              LPAD(
                   DECODE(BYTES,
                        NULL,' ',
                        DECODE(SIGN(BYTES-1024),
                             -1, BYTES||' ',
                             DECODE(SIGN(BYTES-1048576),
                                  -1, TRUNC(BYTES/1024)||'K',
                                  DECODE(SIGN(BYTES-1073741824),
                                       -1,TRUNC(BYTES/1048576)||'M',
                                       TRUNC(BYTES/1073741824)||'G')
                        ), 6, ' '
              )||'|'||
              LPAD(
                   DECODE(COST,
                        NULL,' ',
                        DECODE(SIGN(COST-10000000),
                             -1, COST||' ',
                             DECODE(SIGN(COST-1000000000),
                                  -1, TRUNC(COST/1000000)||'M',
                                  TRUNC(COST/1000000000)||'G')
                        ), 8, ' '
              )||'|'||
              LPAD(
                   DECODE(PARTITION_START,
                        'ROW LOCATION', 'ROWID',
                        DECODE(PARTITION_START,
                             'KEY', 'KEY',
                             DECODE(PARTITION_START,
                                  'KEY(INLIST)', 'KEY(I)',
                                  DECODE(SUBSTR(PARTITION_START, 1, 6),
                                       'NUMBER', SUBSTR(SUBSTR(PARTITION_START, 8, 10), 1,LENGTH(SUBSTR(PARTITION_START, 8, 10))-1),
                                       DECODE(PARTITION_START,
                                            NULL,' ',
                                            PARTITION_START)
                        )||' ', 7, ' '
              )||'|'||
              LPAD(
                   DECODE(PARTITION_STOP,
                        'ROW LOCATION', 'ROW L',
                        DECODE(PARTITION_STOP,
                             'KEY', 'KEY',
                             DECODE(PARTITION_STOP,
                                  'KEY(INLIST)', 'KEY(I)',
                                  DECODE(SUBSTR(PARTITION_STOP, 1, 6),
                                  'NUMBER', SUBSTR(SUBSTR(PARTITION_STOP, 8, 10), 1,LENGTH(SUBSTR(PARTITION_STOP, 8, 10))-1),
                                  DECODE(PARTITION_STOP,
                                       NULL,' ',
                                       PARTITION_STOP)
                   )||' ', 7, ' '
              )||'|' AS "Explain plan"
         FROM V$SQL_PLAN
         START WITH (ADDRESS = (SELECT SQL_ADDRESS FROM V$SESSION WHERE SID=&SID)
                   AND HASH_VALUE = (SELECT SQL_HASH_VALUE FROM V$SESSION WHERE SID=&SID)
                   AND CHILD_NUMBER = 0
                   AND ID=0 )
         CONNECT BY PRIOR ID = PARENT_ID
                        AND PRIOR ADDRESS = ADDRESS
                        AND PRIOR HASH_VALUE = HASH_VALUE
                        AND PRIOR CHILD_NUMBER = CHILD_NUMBER
         ORDER BY ID, POSITION)
    UNION ALL
    SELECT '----------------------------------------------------------------------------------------------------' FROM DUAL;Regards,
    Yoann.

  • Seeing the final SQL before it is executed

    Hi,
    What is the best way to take a peek at the SQL in a model right before
    it is run?
    I am getting a
    "[java.sql.SQLException: ORA-00923: FROM keyword not found where
    expected"
    error, and I would like to track it down.
    Thanks,
    John
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Never mind.
    What I meant was, I had seen discussions about QueryModelBase in the
    forums, but couldn't find it in the Javadoc. Of course this morning I
    go looking again, and it pops right up. Guess the error is in the chair.
    BTW, I found another way to peek at the SQL before it executes.
    In the beforeExecute(..., String sql) of the Model, I can just spit
    out the sql. I don't think I would want to try and manipulate it
    there. I want to alter it based on which TiledView I'm calling the
    model from.
    Thanks,
    John
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
    What do you mean you see references in QueryModelBase, but don'tfind it
    in "JATO". QueryModelBase is part of JATO.
    Can you clarify what you mean?
    c
    jhoskins wrote:
    I have seen references to this QueryModelBase, but can't seem to find
    it in JATO. Am I looking in the wrong place?
    John Hoskins
    --- In SunONE-JATO@y..., Matthew Stevens <matthew.stevens@E...> wrote:
    Also, check out the <QueryModelBase> JavaDocs for
    setTraceSQL()
    getSQL()
    beforeExecute()
    jhoskins wrote:
    Hi,
    What is the best way to take a peek at the SQL in a model right
    before
    it is run?
    I am getting a
    "[java.sql.SQLException: ORA-00923: FROM keyword not found where
    expected"
    error, and I would like to track it down.
    Thanks,
    John
    To download the latest version of JATO, please visit:
    <a href="http://www.sun.com/software/download/developer/5102.html">http://www.sun.com/software/download/developer/5102.html</a>
    For more information about JATO, please visit:
    <a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http://developer.iplanet.com/tech/appserver/framework/index.jsp</a>
    > >>>> >> >> >> >To download the latest version of JATO, please visit:> ><a href="http://www.sun.com/software/download/developer/5102.html">http://www.sun.com/software/download/developer/5102.html</a>> >> >For more information about JATO, please visit:> ><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http://developer.iplanet.com/tech/appserver/framework/index.jsp</a>> >> >> >> >                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Calculate elapse time of a Java thread  before execution

    Hi,
    I would like to enquire how can I calculate the elapse time of a Java thread BEFORE this thread is executiing or running.?
    I wish to estimate the elapsed time of each Java thread before execution to better schedule these threads to run on multiple processors for load balancing testing.
    Please help
    -meileng-[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can grab the system time in the initiating thread immediately before calling start(), and as the first step in run() in the new thread.
    However, this measurement is utterly meaningless, as it can vary between architectures or even between consecutive runs on the same box. Furthermore, even once a thread starts, it may do nothing more than that one grab-the-system-time instruction before it get swapped out for a theoretically unbounded amount of time.
    By definition, if you spawn multiple threads in Java, you don't know or care which one get CPU time when, except as you control by syncing, sleep, wait, notify, notifyAll, and whatever control priorities give you. Additionally, you don't know when the OS will give your VM cycles, and on multi-CPU machines, you don't know how many CPUs it will get when it does get cycles.

  • Viewing SQL Audit Logs

    I am new at the SQL auditing feature. I have played around with it, and I have one problem that I hope someone can help me with. When I first turn on the SQL audit and the audit file is small I can view the log on my local machine with the log viewer in
    SSMS. However, as the log files continue to be created and grow, the log file viewer no longer works. It sits there for several minutes saying "initializing log file #1", then just comes back 0 records processed. Sometimes it comes back with an OutOfMemoryException.
    I have the SQL audit set to go to files, and the files are set to be 250 MB each.
    Is there some better way to look at the SQL audit log files generated, or is there some way to make the log file viewer actually work once the log files begin to grow? I know I can use Transact-SQL statements, but I was hoping to use the log file viewer
    or some other GUI viewer. Another issue I'm concerned about is being able to archive the log files to another location and having the ability to look at them.
    Thank you.

    Its looks like bug.
    http://connect.microsoft.com/SQLServer/feedback/details/709364/sql-server-audit-logs-do-not-display
    http://thomaslarock.com/2012/10/viewing-sql-server-2008-r2-audit-logs-using-ssms-2012/
    Use sys.fn_get_audit_file() system function to see the data that you already doing.
     http://msdn.microsoft.com/en-us/library/cc280765.aspx
    -Prashanth

  • HT4759 I was able to view "gallery" before this move.  What am I looking for now to view my photos?

    I was able to view gallery before the move.  What am I looking for now to post and view photos?

    iCloud provides a very basic photo gallery in Photo Journal, though it is populated only from iPhoto for iOS, not from a Mac. Otherwise you will need to find a third-party solution - this page examines some options:
    http://rfwilmut.net/missing4

  • Do Not Generate SQL before running

    Post Author: beginner~~
    CA Forum: WebIntelligence Reporting
    Dear all,
    Does anyone know where I could find the corresponding option in Web Intelligence for "Do Not Generate SQL before running" (in Desktop Intelligence)? Thanks.
    Best Regards,

    Post Author: James MacDonald
    CA Forum: WebIntelligence Reporting
    Go to the 'Edit Query' panel and press the 'SQL' button.  There is a 'Use Custom SQL' check box that allows you to change the SQL manaully and if you 'Save' the results will work the same as 'Do Not Generate SQL ...'

Maybe you are looking for

  • How to find my ipod ?

    Hello, I dont remember where to go to find my ipod which is somewhere in my house, can someone indicate me how to do it ?

  • How to view devices connected to m20

    I opened up Cisco Connect  for my m20 router via the desktop and it cites there are 2 devices that are currently connected to the valet.  The citation is in the upper left box titled:  Computers and Devices. However, i am having a dickens of a time t

  • Different font colors in landscape not possible - SERIOUSLY??

    Hi Ive just been checking my portrait versions of a textbook and wow... there seems NO way to have different font colors in portrait and landscape?? Thats totally insane. I'll explain why... IN landscape you can (and should) have full bleed photos an

  • Regarding calculation of uom(unit of measurment)

    i want to display uom(unit of measure) field in dis format: - UOM IS KG -> SO QTY TO  -> (SALES ODER QTY * 1000) G -> (SALES ODR QTY / 1000) I making d report of sales order and i have to display it according to it...plzzz help me its urgent...

  • Permissions on Bookmarks

    Hello all, I wanted to know if there is any way to place permissions on user’s bookmarks. Scenario: In the portal, a user creates a Bookmark to a BI Report using the “Bookmark” command available in the BEx Web Analyzer.  A URL similar to the followin