Comment puis-je savoir à crapauder quelle est la valeur de retour d'une fonction est?
Je cours comme ce code: p>
declare r number; begin r:= packagename.functionname(paraname); end;
3 Réponses :
Que diriez-vous de:
select packagename.functionname(paraname) from dual;
Essayé mais obtenir: "ORA-14552 ne peut pas effectuer de DDL, de commettre ou de restauration dans une requête ou une DML." Publier édité pour fournir plus d'informations.
begin dbms_output.put_line(packagename.functionname(paraname)); end; You'll need to turn output on before running this. To do that, select the "DBMS Output" tab at the bottom of the editor, then click the leftmost button under the tab (it should depict a red circle, with the tooltip "Turn Output On" (if it's a green circle, output is already on)).The results of the query will be written to the "DBMS Output" window, not the "Data Grid" (you may have to wait a few seconds for the polling to pick up the results). If you use a user-defined type or a ref cursor, this will be insufficient and you'll need to process the results in the anonymous block before writing them out.
Vous pouvez également activer "Sondage automatiquement pour la sortie après exécution" dans la même zone en bas.
La réponse de Klaus de P>
Sélectionnez Packagename.FonctionName (Paraname) à partir de Dual; P> blockQuote>
a travaillé pour moi mais cela n'a renvoyé qu'un curseur. Ceci affiché comme (curseur) dans la grille de données dans TOAD. Une fois que j'ai cliqué sur cela, il a ouvert une nouvelle fenêtre avec une grille de données pour ce curseur et j'ai vu mes résultats. P>
Cela ressemble plus à un commentaire qu'une nouvelle réponse à la question