Oracle插入段落

时间:2017-04-06 15:25:45

标签: oracle

您好,我有这个oracle php代码。

$stmt_write_news = OCIParse($conn,
 "INSERT INTO ".$db_schema_name."news_header (id_news,title)
 VALUES (".$db_schema_name."id_news.NEXTVAL, 'some text')"
 RETURNING id_news INTO :id_news");

OCIBindByName($stmt_write_news, ':id_news', $id_news, 32);

$stmt_write_paragraph = OCIParse($conn, 
 "INSERT INTO ".$db_schema_name."news_paragraph (id_paragraph,id_news,text)
 VALUES (".$db_schema_name."id_paragraph.NEXTVAL, '**problem here**', 'some text')");

所以我有两个表,我存储ID,TITLE(和其他列) 还有一个表存储Paragraphs(parahraph的id,新闻标题的id和文本)。

我的问题是我不知道如何让这段代码从第一段代码中插入id_news.NEXTVAL ...任何想法?

0 个答案:

没有答案