doupin5408 2014-08-17 11:57
浏览 57
已采纳

Firebird PHP生成器用于自动增量

I have a key ID which would be an auto-incremented unique ID for a Firebird database, and I have a generator made in firebird, already working perfectly, and I want to write the ID in the db for new records. So basically I want to get the correct value with this incrementer generator, but I don't know how to call. PRODUCT_SORSZAM is the generator.

$q = ibase_query("SELECT * FROM PRODUCT_SORSZAM");
echo $q;
  • 写回答

4条回答 默认 最新

  • doujing9972 2014-08-17 13:08
    关注

    You can use following to get next generator value:

    SELECT GEN_ID(PRODUCT_SORSZAM,1) FROM RDB$DATABASE; Or 
    SELECT NEXT VALUE FOR PRODUCT_SORSZAM FROM RDB$DATABASE;
    

    I assume that PRODUCT_SORSZAM is name of generator, not the name of table.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 怎么把512还原为520格式
  • ¥15 MATLAB的动态模态分解出现错误,以CFX非定常模拟结果为快照
  • ¥15 求高通平台Softsim调试经验
  • ¥15 canal如何实现将mysql多张表(月表)采集入库到目标表中(一张表)?
  • ¥15 wpf ScrollViewer实现冻结左侧宽度w范围内的视图
  • ¥15 栅极驱动低侧烧毁MOSFET
  • ¥30 写segy数据时出错3
  • ¥100 linux下qt运行QCefView demo报错
  • ¥50 F1C100S下的红外解码IR_RX驱动问题
  • ¥20 基于matlab的航迹融合 航迹关联 航迹插补