0

I like to pass to "QueryRun" a View. if I put this line I have error in visual studio :

ProjPostTransView = queryRun.get(tablenum(ProjPostTransView));

but if I put this line I don't have any error :

custTable = qeuryRun.get(tablenum(CustTable));

this last line don't generate error because I feel "table" to "queryrun". and now I need to past a "View" not table.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
jawhar_m
  • 145
  • 5
  • 13
  • the error is not good type for function ! queryRun.get(x); => type of x must be TableId (tableid is an EDT) if i put tablenum(custtable) im sure i will return an table id. but tablenum(custtableView) don't return an tableId – jawhar_m Jan 23 '13 at 12:18
  • Passing a view to the `tablenum` function does return an `int`. I think @JanB.Kjeldsen is right, the problem may be that the view does not exist in the query. – SShaheen Jan 23 '13 at 14:21
  • my query contain only one think and that is the view – jawhar_m Jan 23 '13 at 15:13

3 Answers3

2

Well, the table or view you want to get must be one of tables or views that is defined on the "static" query: queryRun.query().

queryRun = new QueryRun(queryStr(CustTableQuery));

Here it would be unreasonable to expect the queryRun to get anything but CustTable.

To see the SQL (including the FROM tables) use:

info(queryRun.query().dataSourceNo(1).toString());   
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
  • static void QueryRun_View(Args _args) { QueryRun queryRun; queryRun = new QueryRun(queryStr(ProjTransQuery)); while(queryRun.next()) { info(strFmt("%1",queryRun.query().dataSourceNo(1)));//.toString());// dateSourceNo(1).toString()); } } i try to do it in a JOP but in the execution it generate error : wrong type argument – jawhar_m Jan 23 '13 at 12:59
  • You can copy/paste now: dataSourceNo was misspelled dateSourceNo. – Jan B. Kjeldsen Jan 23 '13 at 13:50
  • yes I saw it and I corrected .. you can see the code of the job I had in the pit words comment – jawhar_m Jan 23 '13 at 13:55
2

If you are trying to get ProjPostTransView view from ProjTransQuery, that will not work. ProjPostTransView is not a data source on that query. It is a Dependent Object. This means that the view references the query. Not the other way around. (Reference: http://msdn.microsoft.com/en-us/library/bb278121(v=ax.50).aspx)

SShaheen
  • 1,012
  • 7
  • 21
  • OMG :(((( ProjTransQuery is composed from union of different other view.. and in my SSRSreport i need different methode implemented in those view ! so now i must make an other query composed from table and not view.. i can not do else !!! :'( – jawhar_m Jan 23 '13 at 15:42
  • It would be helpful if you would tell us exactly from what query you are trying to get the view. The problem is NOT that it is a view instead of a table. – SShaheen Jan 23 '13 at 16:06
0

this one work very well but its not what i need

this one work very well but its not what i need

if i work with table and not view i will make this code for exemple :

if i work with table and not view i will make this code for exemple

jawhar_m
  • 145
  • 5
  • 13