Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oracle sprocs/packages
Message
 
 
À
06/11/2001 04:09:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00577823
Message ID:
00578126
Vues:
12
Maybe adding the parens at the end will help -- MYSCHEME.MYPACKAGE.MYFUNCTION(). Here is one of my examples of calling a proc in a package:
*!* What this demonstrates is executing a stored procedure
*!* in an Oracle Package to create records in a temp table,
*!* TEMP_TABLE. Then you can issue another SQLExec() to
*!* retrieve those records.


SQLEXEC(nHandle, 'delete from temp_table')

lcSQL = "DECLARE " ;
      + "  v_HistoryStudents ClassPackage.t_StudentIDTable; " ;
      + "  v_NumStudents     BINARY_INTEGER := 20; " ;
      + "  BEGIN " ;
      + "  ClassPackage.ClassList('HIS', 101," ;
      + "  v_HistoryStudents, v_NumStudents);" ;
      + "  FOR v_LoopCounter IN 1..v_NumStudents LOOP " ;
      + "  INSERT INTO temp_table (num_col, char_col) " ;
      + "  VALUES (v_HistoryStudents(v_LoopCounter), " ;
      + "  'In History 101'); " ;
      + "  END LOOP; " ;
      + "  END;"

? SQLEXEC(nHandle, lcSQL)

? SQLEXEC(nHandle, 'select * from temp_table', 'crsTest')
Maybe you could use something much simplier than the above. Just a SWAG:
lcSQL = "DECLARE " ;
      + "  BEGIN " ;
      + "  MYSCHEME.MYPACKAGE.MYFUNCTION();" ;
      + "  END;"

? SQLEXEC(nHandle, lcSQL)
>I'm trying to run a Oracle 8i package that contains a function that returns as single numeric value. I can run SQL strings from SQLEXEC, but can't get these darned sprocs working. The package is compiled and I've tested it from SQL+, so it's not that..I've tried the following syntax:
>
>local rtn as integer
>
>rtn = sqlexec(cn,'MYSCHEME.MYPACKAGE.MYFUNCTION')
>
>and
>
>rtn = sqlexec(cn,'{CALL MYSCHEME.MYPACKAGE.MYFUNCTION}')
>
>Any ideas folks???
>
>Thanks in advance..
>
>Pablo
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform