Re: how to display / get that query ?



mike hengins wrote:
I would like to display the full SQL insert request so I can run it in Toad.
Does anyone know how to display / get that query ?

Well, you do have the query in your local String variable "sql".

I don't see any method in the javadocs for java.sql.Statement or PreparedStatement to return the SQL string.

But typicaly you can't get a SQL string populated with values from the query parameters you've supplied; those values are usually combined with the statement after the SQL has been parsed into some internal format in the RDBMS.

Regards,
Bill K.
.



Relevant Pages

  • Re: Escape character weirdness
    ... The problem of course is that you can't return brackets from the ... Sql Server uses brackets '' to escape. ... I tried a 'LIKE ' query, ... PreparedStatement p = c.prepareStatement("insert into #foo ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Translation of SQL for VBA
    ... Not knowing what the criteria are in the SQL string, ... > Append Query. ... >> Dim strSQL as String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Retrieving data from user input.
    ... I ran the query by itself to test ... "Carl Rapson" wrote: ... What does your SQL string look like in the Immediate window? ... I used my control name instead of the 'txtPro_ID' but still nothing ...
    (microsoft.public.access.formscoding)
  • Re: Cascading combo boxes
    ... >> is the Parameter in the Query / SQL String which doesn't have a value until ... >>> RowSource should be set to Alpha field in Table ... >>> the ConstituentsForm and select the dropdown list I have ... >>> The query would have fields LastName, FirstName,and ...
    (microsoft.public.access.forms)
  • Re: dynamic query help
    ... Write a query that does what you want. ... rstOpen function. ... SQL string in a variable, like strSQL I showed you, and check that it is ...
    (microsoft.public.access.queries)