Begin forwarded message:
> From: Medhavi Mahansaria <[email protected]>
> Date: 2 January 2015 2:02:35 pm IST
> To: "[email protected]"
> <[email protected]>
> Subject: Dynamic query use
>
> Hi,
>
> I am using the below program in SOCI for executing a dynamic query.
>
> But it is giving me ORA-24333 : zero iteration count
>
> Please let me know where i am going wrong or should i use another approach?
>
> Sent from my iPhone.
> Brevity may be excused.
> Thank You.
>
> Regards,
> Medhavi Mahansaria.
>
> Begin forwarded
>>
>> int main()
>> {
>> int id_flag=1;
>> int h_id=333;
>> int k,j;
>> string query,query1,query2;
>> session sql(oracle, "service=orcl user=TEST_POC password=TEST_POC");
>>
>> try
>> {
>> query1="select id,points from test where 1=1 ";
>> if (id_flag == 1)
>> {
>> query2=" AND id = :h_id";
>> }
>> else
>> {
>> query2+=" AND points = :h_id";
>> }
>> query= query1+query2;
>> query="\""+query+"\"";
>> query+=",into(k),into(j),use(h_id)";
>>
>> cout<<query<<endl;
>> statement stmt=(sql.prepare<<query);
>> stmt.execute();
>> while(stmt.fetch())
>> {
>> cout <<"the value points = "<<j<<" and id ="<<k<<endl;
>> }
>>
>> }
>> catch (exception const &e)
>> {
>> cerr << "Error: " << e.what() << '\n';
>> }
>>
>> return 0;
>>
>> }
>>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users