php
  • post
  • 2016-10-29 6 views 0 likes 
    0

    このコードは機能しますが、すべてを( "timestamp8"、 "Last"、 "TradePrice"、 "TradeFlags")をfilnameカラムに入れます。 filnameへの "ゲル"(ケース$表inthis =ゲル)フィールドに定数を挿入する(selectから)Postgres

    私はそれがパースエラーが言う 'ゲル' を試してみてください。

    で構文エラー、予期しない 'ゲル'(T_STRING)

    $sql ='INSERT INTO pong8_maintable ("filname","timestamp8","Last","TradePrice", "TradeFlags" 
    
    ) 
    
    SELECT 
    "gel" , 
    cast(public.'.$table.'."Timestamp" as timestamp) , 
    cast(public.'.$table.'."Last" as numeric) , 
    cast(public.'.$table.'."Trade Flags"as varchar) 
    
    
    FROM Public.'.$table; 
    
    
    sc_exec_sql($sql); 
    

    答えて

    0
    を提案して下さい

    私はこれを試してみてください

    SELECT 
    (\''.$table.'\') , 
    cast(public.'.$table.'."Timestamp" as timestamp) , 
    cast(public.'.$table.'."Last" as numeric) , 
    cast(public.'.$table.'."Trade Price" as numeric) , 
    

    または

    SELECT 
        (\'gel\') , 
        cast(public.'.$table.'."Timestamp" as timestamp) , 
        cast(public.'.$table.'."Last" as numeric) , 
        cast(public.'.$table.'."Trade Price" as numeric) , 
    
    関連する問題