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!

0
12 comments

Hi,

Change user parameters in settings as you like:


Also, could you specify DataGrip version you use?

Thank you.

0

I tried to turn off all of the user parameters, but it's still asking for them when I run the script.

0

0

Can I get a follow up response? 

0

Me too - I have this exact same problem - would love to get some follow up on it. 

 

0

@ Alamendola Hi,

You need to enable parameter injecting by checking checkboxes above Parameter Patterns:

Thank you.

-1

I'm having the same issue.

declare
result sys_refcursor;
begin
result := PCONFIRMACAOATENDIMENTOWAPP.LISTARMENSAGEM;
? := result;
end;


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.

0

Hi, was this incident addressed? I am facing same issue. Could anyway point me to the solution?

0

Hello,

Do you mean that IDE asks for parameters but shouldn't?

0

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;

$$

;

0

Please sign in to leave a comment.