Run Query scalar variable error

image
Hi everyone, can I please get assistance on this error here.

Here is how I declared the variable currentDate:

looks like SQL query is incorrect.
In your subquery table name is missing

Hi @adi.mehare , the table name is Respond.ComplaintCases_2

You are using select keywork in your query,

if you do not wish to select values from another table to insert into Respond.ComplaintCases_2, use below syntax.

INSERT INTO table_name (column1 , column2 , column3 , …)
VALUES (value1 , value2 , value3 , …);

@Anelisa_Bolosha1,

Try this approach:
Remove @ from the parameters and keep only the string like PartnerAdminRef

Hi @ashokkarale

I tried and got

@Anelisa_Bolosha1,

Which database are you using? Try prefixing : to parameters. I read it somewhere. Worth trying.

I’m using the
image
image

I want to insert to:

@Anelisa_Bolosha1

in the first screenshot that you provided in first question the only error is you need to use @RespondCapture_Date instead of @Currentdate

left side name is what you need to use

cheers

Hi @Anil_G yes I am using the left side name…the right side is the variable with the value

@Anelisa_Bolosha1

please check the last line you have used right side variable name instead of leftside argument name

cheers

Oh thank you, changed it but I now got this:

What type of data is PartnerAdminRef set to? varchar(20), int, etc?
The error message indicates that the field is not big enough to hold the data.
If it’s characters you could try to set PartnerAdminRef to varchar(max) instead of what you have now.

@Anelisa_Bolosha1

as per error the data you are sending in and the data that is required for tables are not matching or to be precise there is a size limitation

prticularly partneradminref

cheers

I saw on my select * query on the where- I did not put a value there

Thanks Anil This solved it

1 Like

Hi @pierre.aberg the data type is varchar(25) and the value of PartnerRef is always 18 characters, it was not the data type issue

Thank you all so much for your assistance :beating_heart:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.