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

OUT parameters are not converted in EXECUTE command #1855

Open
okbob opened this issue Jan 17, 2025 · 4 comments
Open

OUT parameters are not converted in EXECUTE command #1855

okbob opened this issue Jan 17, 2025 · 4 comments

Comments

@okbob
Copy link
Contributor

okbob commented Jan 17, 2025

I got error report related to usage OUT parameters inside EXECUTE statement.

   mLIDENT, mID_VALUE, mID_CISFOTO, mORIGINAL, mCESTAK, mVELIKOST, mNAZEV, clock_timestamp(), mID_ASPRAVCE, mID_APROVOZNA, mID_SKUP_CISEL, 'N', 'W', 'A', mVYBOR,  out mID_OBPDOCUM;

This should be converted to EXECUTE USING INTO

@darold
Copy link
Owner

darold commented Jan 17, 2025

Hi Pavel, can you provide a full code example please?

@okbob
Copy link
Contributor Author

okbob commented Jan 17, 2025

I have only fragments:

Oracle:

 pINS := 'INSERT INTO OBPDOCUM (LIDENT, ' || mID_NAME || ', ID_CISFOTO, NAZEV_OBPDOCUM, CESTAK, VELIKOST_DOCUM, POZNAMKA, PLATNOST_OD'
  || ', ID_ASPRAVCE, ID_APROVOZNA, ID_SKUP_CISEL, DRUHAK, CVZNIKRADK, VIDI_NAJEMNIK, VYBOR ) VALUES ('
  || ':LIDENT, :ID_VALUE, :ID_CISFOTO, :ORIGINAL, :CESTAK, :VELIKOST, :NAZEV, :PLATNOST_OD'
  || ', :ID_ASPRAVCE, :ID_APROVOZNA, :ID_SKUP_CISEL, :DRUHAK, :CVZNIKRADK, :VIDI_NAJEMNIK, :VYBOR) returning ID_OBPDOCUM into :ID_OBPDOCUM';

  EXECUTE pINS USING
    mLIDENT, mID_VALUE, mID_CISFOTO, mORIGINAL, mCESTAK, mVELIKOST, mNAZEV, clock_timestamp(), mID_ASPRAVCE, mID_APROVOZNA, mID_SKUP_CISEL, 'N', 'W', 'A', mVYBOR,  out mID_OBPDOCUM;

Translated to Postgres:

  pINS := 'INSERT INTO OBPDOCUM (LIDENT, ' || mID_NAME || ', ID_CISFOTO, NAZEV_OBPDOCUM, CESTAK, VELIKOST_DOCUM, POZNAMKA, PLATNOST_OD'
  || ', ID_ASPRAVCE, ID_APROVOZNA, ID_SKUP_CISEL, DRUHAK, CVZNIKRADK, VIDI_NAJEMNIK, VYBOR ) VALUES ('
  || ':LIDENT, :ID_VALUE, :ID_CISFOTO, :ORIGINAL, :CESTAK, :VELIKOST, :NAZEV, :PLATNOST_OD'
  || ', :ID_ASPRAVCE, :ID_APROVOZNA, :ID_SKUP_CISEL, :DRUHAK, :CVZNIKRADK, :VIDI_NAJEMNIK, :VYBOR) returning ID_OBPDOCUM into :ID_OBPDOCUM';

  EXECUTE pINS USING
    mLIDENT, mID_VALUE, mID_CISFOTO, mORIGINAL, mCESTAK, mVELIKOST, mNAZEV, clock_timestamp(), mID_ASPRAVCE, mID_APROVOZNA, mID_SKUP_CISEL, 'N', 'W', 'A', mVYBOR, out mID_OBPDOCUM;

But there is error 42703:15:EXECUTE:column "out" does not exist

@darold
Copy link
Owner

darold commented Jan 17, 2025

ok, I have never met this syntax so conversion it is not implemented. I will try to do something.

@okbob
Copy link
Contributor Author

okbob commented Jan 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants