How to use dynamic sql...?? in ECPG..... - Mailing list pgsql-general

From Ki won, Song
Subject How to use dynamic sql...?? in ECPG.....
Date
Msg-id 000701be1755$8fdc6fc0$4157fbcb@m2000.www.m2000.co.kr
Whole thread Raw
List pgsql-general
In C programming... with ECPG tool...
I have some problem!!
How to use dynamic sql cursor??

void main()
{
      char sqlsentence[255];
      int flag;

        ....... Db Connection.....

     switch(flag) {
        case 1: {
                      sprintf(sqlsentence,"select id , name from testa where id = 1");
                      break;
                    }
        case 2: {
                      sprintf(sqlsentece," select tel, address from testb where key=22");
                       break;
                    }
    }

    EXEC SQL DECLARE cur1 CURSOR FOR :sqlsentence;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ==> ecpg pre compile error "parse error"!!!
        ==> How to use Dynamic sql with ECPG??

    ....... some process.....

}







pgsql-general by date:

Previous
From: Peter T Mount
Date:
Subject: Re: [GENERAL] Converting Other DBes to Postgres & JDBC
Next
From: The Hermit Hacker
Date:
Subject: Re: [GENERAL] User Gallery and Third Party pages merged and rebuilt...