Here em 2017, I'm within the same problem...

*Local variable/parameter ':your-param-name' can only be used within a 
database procedure.*
In MSSQL, the param character is @. In INGRES Database, really is *:* ? I 
cannot find official documentation for that...

*"SELECT * FROM MyIngresTable WHERE MyColumn = :poorParam"*

IDbParametersBuilder builder = CreateDbParametersBuilder();
 
builder.Create().Name("*poorParam*").Type(DbType.Int32).Value(1);


Any help?


Em quarta-feira, 18 de agosto de 2010 12:10:21 UTC-3, Paul escreveu:
>
> I keep receiving the following error when using DbLinq with Ingres: 
>
>  Ingres.Client.IngresException: Local variable/parameter ':????' can 
> only be used within a database procedure. 
>
> Two examples are shown below: 
>
> 1. 
>         public CuST GetSingleCustomer(int id) 
>         { 
>             return _db.CuST.SingleOrDefault(c => c.CuSTId == id); 
>         } 
>
> In this case local variable parameter is "id" 
>
> 2. 
>         public CustomerDetailModel GetCustomerRecord(string custTag) 
>         { 
>             var custRecord = ( 
>                 from c in _db.GetTable<CuST>() 
>                 join s in _db.Segment on c.SegmentNo equals 
> s.SegmentNo 
>                 join ci in _db.CuSTInfo on c.CuSTCode equals 
> ci.CuSTCode 
>                 join co in _db.Coverage on ci.CoverageNo equals 
> co.CoverageNo 
>                 where c.CuSTTag == custTag 
>                 select new CustomerDetailModel 
>                 { 
>                     custAccountNo = c.CuSTTag, 
>                     custName = c.CuSTName, 
>                     custCreditRate = c.CuSTCreditRate, 
>                     custMarket = s.SegmentName, 
>                     custSize = ci.CuSTInfoCuSTTurnover, 
>                     custCoverage = co.CoverageName 
>                 }).FirstOrDefault<CustomerDetailModel>(); 
>
>             return custRecord; 
>         } 
>
> In this case the local variable is "custTag" 
>
> Does anyone know how to get around this with Ingres, it appears to 
> work fine with SQL Server. 
>
> If I replace custTag with "AA01102" for example the query works fine, 
> however I need this to work with a variable name as its a bit of a 
> nuisance pulling back the same record all the time :) 
>
> Thanks, 
> Paul 
>

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dblinq.
For more options, visit https://groups.google.com/d/optout.

Reply via email to