Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVP for non stored procedure queries throws error #1307

Closed
atomusr opened this issue Sep 22, 2021 · 4 comments
Closed

TVP for non stored procedure queries throws error #1307

atomusr opened this issue Sep 22, 2021 · 4 comments

Comments

@atomusr
Copy link

atomusr commented Sep 22, 2021

Hello,

Do you know if TVP feature supports non stored procedure queries? I tried the beta 5.10 driver and it fails for a non stored procedure query.

Below is the details:
CREATE TYPE id_table AS TABLE(id INT PRIMARY KEY);

CREATE TABLE test_table (id INT PRIMARY KEY);

MERGE INTO test_table t
USING ? s ON s.id = t.id
WHEN NOT MATCHED THEN
INSERT (id) VALUES(s.id);

The 5.1 beta driver throws the following error:
Fatal error: sqlsrv_params_container::get_next_parameter - The parameter requested is missing!

Following are my parameters in PHP:

$params = [
[['id_table' => [[1], [2], [3]]]],
];

@yitam
Copy link
Contributor

yitam commented Sep 22, 2021

Hi @atomusr, we will investigate and get back to you on this.

@yitam
Copy link
Contributor

yitam commented Sep 29, 2021

Hi @atomusr , FYI, this will be fixed in the upcoming beta release.

@yitam yitam added the resolved label Nov 1, 2021
@yitam
Copy link
Contributor

yitam commented Dec 2, 2021

5.10.0-beta 2 is just released. Please give it a try, @atomusr

@yitam
Copy link
Contributor

yitam commented Dec 7, 2021

Closing this now please feel free to ask us to reopen.

@yitam yitam closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants