Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDAC - Params DataTypes



Permlink Replies: 8 - Last Post: Jan 27, 2016 3:52 AM Last Post By: Victor Zanella
Victor Zanella

Posts: 9
Registered: 2/21/16
FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 21, 2016 12:04 PM
Problem: build an app that show params's name and datatypes, so Users could make their own generic selects

I use to use dbExpress to manipulate database, but this driver brings me unknow type for parameters.

So i tryed to use FireDAC, and it was successful for FireBird. But now i have to do this for PostgresSQL database, and if i use PG driver, it brings me this mesage:
"[FireDAC][Phys][PG]-335. Parameter [MOD] data type is unknown. Hint: specify TADParam.DataType or assign TADParam value before Prepare/Execute call."

I don't wanna specify params type, cus i need to get then.

Does anybothy know how can i solve this problem ?

Edited by: Victor Zanella on Jan 21, 2016 12:05 PM

Edited by: Victor Zanella on Jan 21, 2016 12:09 PM
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2016 11:10 PM   in response to: Victor Zanella in response to: Victor Zanella
I don't wanna specify params type, cus i need to get then.

With FireDAC PostgreSQL driver you must specify parameter types. You
can do that as it is sayd in the error message:

"[FireDAC][Phys][PG]-335. Parameter [MOD] data type is unknown. Hint: specify TADParam.DataType or assign TADParam value before Prepare/Execute call."

Anyway, if you application is an add-hoc SQL application, then there is no
sense to allow to use to enter a parameterized SQL command but do not
assign parameters. Either non-parameterized SQL commands, either
parameter values must be assigned.

Additionally, the parameter values must be assigned before first Prepare /
Open / ExecSQL call.

--
With best regards,
Dmitry
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 4:37 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
My application is a report generator, so if some user want to build a report that show sales from this month made by specific seller, it can.

There's a prototype, and with IB drivers its work like this:

http://imageshack.com/a/img907/5633/CdN3Ii.jpg

http://imageshack.com/a/img911/8804/coydGC.jpg

http://imageshack.com/a/img912/2665/17xaMr.jpg

Does FireDAC or another framework could do that for me, with PostgreSQL ?

PS: I just set command text and it brings me Params DataTypes automatically

Victor Zanella

Posts: 9
Registered: 2/21/16
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 4:59 AM   in response to: Victor Zanella in response to: Victor Zanella
The solution that i found is work with all params as string, it'll just be dificult to user set datetype values (or other complex types) for params

http://imageshack.com/a/img911/2325/se0jww.jpg
Robert Triest

Posts: 687
Registered: 3/24/05
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 6:24 AM   in response to: Victor Zanella in response to: Victor Zanella
it'll just be dificult to user set datetype value..

Not to speak about letting the user specify the SQL select statements... (Including inner/outer/full joins)
I've never seen general users that were able to do this and always ended up to add special search
dialogs where the user has to select checkboxes/radiobuttons.
On the other hand, maybe you are working with IT people knowing SQL..
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 6:35 AM   in response to: Robert Triest in response to: Robert Triest
Not to speak about letting the user specify the SQL select statements... (Including inner/outer/full joins)

Ok. But how you have got SQL parameters in the SQL command ?
Is that "result" of some check/radio box ? If yes, then probably you
application has an idea about this parameter marker data type ?

Anyway, my idea is that probably your application may have an
idea about parameter data type.

--
With best regards,
Dmitry
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 10:23 AM   in response to: Robert Triest in response to: Robert Triest
We have a lot of clients that ask us to make new reports. So we developed this program:

Here on right if User double click on Fields, we build the select automatically
http://imageshack.com/a/img903/6377/jVFll1.jpg

and here we show select results
http://imageshack.com/a/img911/3100/MeZpQg.jpg

Our support team and partners are able to build some reports for our clients.

PS: this is the main program
PS²: Today, Users hav to fix params value. example: ( Use current_time_stamp on Date params )

Edited by: Victor Zanella on Jan 26, 2016 10:25 AM

Edited by: Victor Zanella on Jan 26, 2016 10:35 AM
Robert Triest

Posts: 687
Registered: 3/24/05
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 11:53 PM   in response to: Victor Zanella in response to: Victor Zanella
Our support team and partners are able to build some reports for our clients.
Ah, good. I just wanted to warn about letting the end-users assemble the select statement.
Developers often try to do this and even some 3th party packages have the possibility
to "create" reports out of database tables and I experienced that only IT departments were able
to create these reports, not the end-user. Sometimes data tables have many fields
and its already difficult to remember what information is inside these fields.
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: FireDAC - Params DataTypes
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2016 3:52 AM   in response to: Victor Zanella in response to: Victor Zanella
I Analyzed a lot of PostgreSQL manager tools, and none of them, show params type at select's execute.
I guess i'll have to iterate the sqlcommand to find Params and theirs DataTypes in postgresql.

thanks.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02