2010-11-29 24 views
2

SQL ServerのストアドプロシージャをOracleに変換しています。 SQL Serverでは、関数呼び出しからテーブルに挿入することができます。Oracle insert from function

INSERT INTO t_tmpl(rel_class_code, rel_side, template_id, template_name, template_desc) 
SELECT rel_class_code, ls_rel_side, obj_id, name, description 
FROM etmf_get_templates_for_rel(ps_rel_class_code, ls_rel_side, pi_called_by) 

Oracleにこれを変換するときに私が取得エラーメッセージは、 "PL/SQL:ORA-00933:SQLコマンドが正常に終了しない" である。ここでは

は、SQL Serverです。

誰でもこの文がOracleでどのように見えるはずですか?

ありがとうございました!

+1

あなたの関数が定義されている方法は? – kurosch

答えて

3

あなたの関数が設定され、パイプラインの結果を返す場合は、単に次のように表内の機能を配置する必要があります:

INSERT INTO t_tmpl 
    (rel_class_code, rel_side, template_id, template_name, template_desc) 
    SELECT rel_class_code, ls_rel_side, obj_id, name, description 
    FROM TABLE(
     etmf_get_templates_for_rel(ps_rel_class_code, ls_rel_side, pi_called_by) 
    ) 
関連する問題