SQL statement asks for parameters and won't run in Datagrip but will run in other SQL clients
Answered
Hi,
I'm trying to use the syntax fieldname::datatype in order to cast a field as a new datatype, in this case casting it to text and then to date. This doesn't seem to work in datagrip and when I run it, it asks for parameters. However, when I copy the same script into say DBeaver, the script is able to run perfectly. How do I go about fixing this? For example:
SELECT ui.InvDate::text::date
FROM tablename ui
Thanks!
Please sign in to leave a comment.
Hi,
Change user parameters in settings as you like:
Also, could you specify DataGrip version you use?
Thank you.
I tried to turn off all of the user parameters, but it's still asking for them when I run the script.
Can I get a follow up response?
Me too - I have this exact same problem - would love to get some follow up on it.
@ Alamendola Hi,
You need to enable parameter injecting by checking checkboxes above Parameter Patterns:
Thank you.
I'm having the same issue.
The program keeps asking for the result parameter, it seems that it shouldn't.
If I run the query directly in the Execute Routine window, without opening in query console, it runs fine.
Rubensszm,
Could you file an issue in DataGrip bug tracker?
Hi, was this incident addressed? I am facing same issue. Could anyway point me to the solution?
Hello,
Do you mean that IDE asks for parameters but shouldn't?
Yes. I am compiling the stored procedure that uses language SQL but instead, it prompts and ask to input values on all the variables I declared in the program. Something like this.
create or replace procedure sp_sample_proc()
language sql
as
$$
declare
var1 string := 'LOG MESSAGE';
begin
insert into table (col1 ) values ( :var1 );
end;
$$
;
Let's continue in https://youtrack.jetbrains.com/issue/DBE-18188