can I get the real sql ebase apps execute before send to db?

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

can I get the real sql ebase apps execute before send to db?

#1

Postby t4nu » Fri Mar 04, 2016 4:08 pm

Hi,
I want to know if I can get the real sql that sent by ebase app to the database. What I mean is something like this:
suppose the in the database resource I have sql like this:

INSERT INTO myTable (field1, field2) VALUES (&&field1, &&field2)

In the script I put the value 'abc' to the field1 and 'def' to the field2.

Can I get: INSERT INTO myTable(field1, field2) VALUES ('abc', 'def') before ebase send it to the database?

Thanks in advance for the help.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Mar 04, 2016 4:16 pm

Click debug on the Database Resource and the SQL is logged. If the database has the Use Prepared Statements option checked (which is recommended) it isn't quite so simple as a single visible statement as it just doesn't work that way, but you should be able to see all the information. If you uncheck Use Prepared Statements you will see a single insert statement logged.
0 x

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

#3

Postby t4nu » Fri Mar 04, 2016 4:47 pm

First, thanks for the respond.

Where can I see the log? From execution log?
If so, all see is something like this:
23:41:37.023 Debug: Start execution of command - updatetable: 23:41:37.023
23:41:37.023 Debug: End execution of command - updatetable : 23:41:37.023

Jon wrote:Click debug on the Database Resource and the SQL is logged. If the database has the Use Prepared Statements option checked (which is recommended) it isn't quite so simple as a single visible statement as it just doesn't work that way, but you should be able to see all the information. If you uncheck Use Prepared Statements you will see a single insert statement logged.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Mar 04, 2016 5:15 pm

Yes, the execution log. If you don't see any SQL statements logged, there were no changes to the table.
0 x

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

#5

Postby t4nu » Fri Mar 04, 2016 5:23 pm

IC.
What can make there is no changes to the table while I do issue the updatetable command?

here is what I do:

1. issue the fetchtable to position the first record as the current row
2. assign the field with new value
3. issue the updatetable

am I doing something wrong, so the table is not updated?

Jon wrote:Yes, the execution log. If you don't see any SQL statements logged, there were no changes to the table.
0 x

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

#6

Postby t4nu » Fri Mar 04, 2016 5:47 pm

Hi,
Just manage to solve the problem, actually the problem is not in the insert but in the update command.
I still not fully grasp the concept in ebase, but I think now I move a bit in it.

But still, the info how to get the real sql command send from ebase app to the database is a great information for debuging.

Thanks for the help, Jon.
0 x


Who is online

Users browsing this forum: No registered users and 17 guests