Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass by Ref Error w/Oracle Package
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00621675
Message ID:
00621716
Vues:
13
I have tried both drivers. I get an error with both. This has nothing to do with a cursor being returned, right? I do not see any reason for that to matter.

>Hi Mark,
>Oracle ODBC Driver vs. MS ODBC Driver for Oracle
>
>The syntax looks right.
>
>>Anyone know why when I try passing variables by reference to an Oracle package using VFP SPT, this error is returned? --
>>
>>Connectivity error: [Oracle][ODBC][Ora]ORA-06550: line 1, column 7:
>>PLS-00306: wrong number or types of arguments in call to 'RETURNCURSOR'
>>ORA-06550: line 1, column 7:
>>PL/SQL: Statement ignored

>>
>>The VFP code I am using:
>>LOCAL lcSQL
>>PRIVATE pnCount
>>pnCount = 10  && get top N records
>>lcSQL = "begin ArticleGetMostPopular.ReturnCursor(nCount=>?pnCount); end;"
>>lnRetVal = SQLEXEC(lnHandle, lcSQL, 'crsMostPopular')
>>The Oracle package is:
>>CREATE OR REPLACE PACKAGE ArticleGetMostPopular AS
>> Type RetCursor Is Ref Cursor;
>> Procedure ReturnCursor(
>>    nCount  IN  number,
>>    pCursor OUT RetCursor);
>>END;
>>/
>>show error
>>CREATE OR REPLACE PACKAGE BODY ArticleGetMostPopular AS
>> Procedure ReturnCursor(
>>    nCount  IN  number,
>>    pCursor OUT RetCursor) is
>> Begin
>>  open pCursor for
>>    select * FROM
>>     (SELECT Article.ID, COUNT(*) AS Count
>>      FROM Article, ArticleKeyPhrase
>>      WHERE ArticleKeyPhrase.ArticleID = Article.ID
>>      GROUP BY Article.ID
>>      ORDER BY Count DESC)
>>      where ROWNUM <= nCount;
>> End;
>>END;
>>/
>>show error
>>--
>>
>>TIA!
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform