[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reverse engineering SQL
[Thread Prev] | [Thread Next]
- Subject: Re: Reverse engineering SQL
- From: BB <adamnt42@xxxxxxxxx>
- Date: Wed, 26 Mar 2025 10:16:39 +1030
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On 24/3/25 2:08 am, T Lee Davidson wrote:
Nope, no such beast. Anyway I have worked out that this can't work as the Gambas component doesn't know what happens inside the database (see below).On 3/22/25 9:34 PM, BB wrote:(not so trivial) Summary: Can anyone suggest1) how to insert a string (of SQL) into an SQLRequest and have it parsed into an SQLRequest objectSomething like SQLRequest.FromSql() ?
That's what I want to do, yes. IOW I have a query string that involves a stored function in the database that may return a different set of fields due to some clever jiggery pokery by the DBA's. So at the end of the day I must execute the query to get the Result.Fields set.or2) have a Connection "compile" a string of SQL, not execute it just make the internals of a Result available for further use. Sort of likeSomething like, after executing the above, SQLRequest.Fields() ?
I think I have to manipulate the query string and eliminate the WHERE and ORDER BY clauses and add LIMIT=1 (to get a result back in my lifetime! several million records). Will reply if it works.The only (and I'm sure not very helpful) suggestion I have is to initially set up the grid with an arbitrary number of columns and then correct that after the query/queries is/are actually executed.I have some "fixed" query strings that I want to get into some structured object so I can do some manipulation of a grid I use to display the results. Like setting the column count and headers. The query string is "incomplete" in that it has substitutable WHERE clauses and ORDER BY clauses so I cant execute it at the time I am setting up the grid.
b
Re: Reverse engineering SQL | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Reverse engineering SQL | BB <adamnt42@xxxxxxxxx> |
Re: Reverse engineering SQL | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |