I am quite new to pro c and wanted to know wether the below is possible.
char car[11];
strcpy(car,""); /* default value*/
if this variable has a value it should be used within the sql below : So run for given car value only.
select *
from vehicles
where car = :car;
However if car is null then do the following sql: So run for all cars.
select *
from vehicles;
Is there a way to merge these two without needing to create duplicate sql queries where ones searches for a given car value and another for all cars.
Any Help would be appreciated.
As of SQL, that would be
Example from SQL*Plus (don't worry about
&&carsubstitution variable; you'll use:car):Passing variable value:
No value: