MrTV
asked on
put constant from select to insert into field Posgresql
In code line 14 i want to put table name into field filname but this code put all column in each row to filed filname how cani fixit
sc_lookup(Dataset, "SELECT tablename FROM pg_catalog.pg_tables
where schemaname = 'public'and tablename not like 'pong8%' order by tablename") ;
{TabName} = {Dataset[33][0]};
$table = {TabName} ;
echo "$table";
$sql ='INSERT INTO pong8_maintable ("filname","timestamp8","Last","TradePrice", "TradeVolume" , "BestBid", "BidSize", "BestAsk","AskSize" ,"Turnover" ,"CalcVWAP" ,"Flow" ,"TradeFlags"
)
SELECT
'.$table.' ,
cast(public.'.$table.'."Timestamp" as timestamp) ,
cast(public.'.$table.'."Last" as numeric) ,
cast(public.'.$table.'."Trade Price" as numeric) ,
cast(public.'.$table.'."Trade Volume" as numeric),
cast(public.'.$table.'."Best Bid" as numeric),
cast(public.'.$table.'."Bid Size"as numeric),
cast(public.'.$table.'."Best Ask"as numeric),
cast(public.'.$table.'."Ask Size"as numeric),
cast(public.'.$table.'."Turnover"as numeric),
cast(public.'.$table.'."Calc VWAP"as numeric),
cast(public.'.$table.'."Flow"as numeric),
cast(public.'.$table.'."Trade Flags"as varchar)
FROM Public.'.{TabName};
sc_exec_sql($sql);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.