dongqiang4986 2014-02-11 15:39
浏览 29

从双重中选择如何处理分号;

Ive been tasked to write a simple php+oracle web reprting tool and I happen to have chanced a pretty complex query that perfectly works in SQL Developer:

SELECT 'LASTNAME, FIRSTNAME, STATUS' from dual;

with user as

(
...
..
..
..

(very long query)

and then it gives me this:

PHP Warning:  oci_execute(): ORA-00911: invalid character

based on my initial investigation, it looks like PHP complains about the ';' after first line (where it says select from ... dual ;)

On the PHP side, it looks like this:

$stid = oci_parse($conn, $query);
oci_execute($stid);

where $query is the very long query:

$query = "SELECT 'LASTNAME, FIRSTNAME, STATUS' from dual;

with user as

(
...
..
..
..

I want to know if there is a way to rewrite the entire query without using the 'dual' part?

  • 写回答

1条回答 默认 最新

  • dongmi19720408 2014-02-11 16:44
    关注

    Dual table is a dummy table with an single row, single column, only data is X.

    You can create you own dual table, it is just a dummy table. may be you want to repeat the result twice and create a dual2 table with two row in it. the content doesn't matter.

    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探