Visual FoxPro - Tables Count - visual-foxpro

I am using Visual Fox Pro 9.0 and new to it.
Please help with how to get no of tables present in a fox pro database ?
Thanks in advance.

There is ADbObjects() function to get various database objects. For getting tables set its second parameter to 'TABLE'. ie:
* Assuming database is open and current database
Local Array laTables[1]
Local ix
For ix = 1 To Adbobjects(laTables,"TABLE")
? laTables[m.ix]
Endfor

A Klutzy way to get that info, (if you have the Fox IDE - and can get to the command window) is:
CLOSE theDatabase (that's the database you want to see - checking if it's open)
USE theDatabase Exclusive
BROWSE
You'll then get a list of the tables in the database. Not pretty, but effective

this will print number of tables in database
?ADBOBJECTS(databaseName, "TABLE")

Related

VS SSRS 2017 automated DAX bringing no results but fetching results in query designer

Today I had to upgrade my developer edition of SQL Server, going from 2014 to 2017.
With this I also had to upgrade our reports using SSDT 2017. Our old report datasets where in MDX format, and it had no measures defined, which 2017 really kicked off about when we tried running them.
Unfortunately we could not remove them using Query designer, so had to delete the DS and we create it. The MDX didn't bring back any data in query designer, but DAX did, so we went with that option.
However, every time we run it in previewer and on our server, no data is returned. Below is the code that was created by Query Designer.
DEFINE VAR ArchiveArchiveId1 = IF(PATHLENGTH(#ArchiveArchiveId) = 1,
IF(#ArchiveArchiveId <> "", #ArchiveArchiveId, BLANK()),
IF(PATHITEM(#ArchiveArchiveId, 2) <> "", PATHITEM(#ArchiveArchiveId, 2),
BLANK()))
VAR ArchiveArchiveId1ALL = PATHLENGTH(#ArchiveArchiveId) > 1 &&
PATHITEM(#ArchiveArchiveId, 1, 1) < 1
EVALUATE SUMMARIZECOLUMNS('Archive'[ArchiveId], 'Archive'[Block Name],
'Archive'[Comments], 'Archive'[Condition], 'Archive'[Consequence],
'Archive'[Element], 'Archive'[Facet], 'Archive'[HasPhoto],
'Archive'[Likelihood], 'Archive'[Local Department Name Whole Block],
'Archive'[Photo Filename], 'Archive'[Remaining Life Yrs], 'Archive'[Remedial
Action], 'Archive'[Risk], 'Archive'[SiteName], 'Archive'[Sub Element],
'Archive'[Year], FILTER(VALUES('Archive'[ArchiveId]), ((ArchiveArchiveId1ALL || 'Archive'[ArchiveId] = ArchiveArchiveId1))))
If anybody has any suggestions on how to manually change that to get it to actually work live and not just in query designer that would be great (taking out the parameter works but we need it in as we have a lot of archive ids).
Thanks in advance

OBIEE 12.2.1.2 COPY data from dashboard - PASTE in excel: wrong order

when copy pasting data from dashboards (pivot tables; no interactions), sometimes the order in excel is wrong:
I.e.: Dashboard: I have marked a - b ( 1 2 4 5) of a pivot table from left to right and copied them.
Pasting them into Excel sometimes results in:
Marking C B A (from right to left) and pasting into excel would sometimes result in:
Using the regular obiee export button works fine (always).
Ideas and suggestions are much appreciated - this happens with all browsers.
That is so not what you are supposed to do anyways it's not funny anymore. Copy+paste into Excel? Pray tell me why you try to use an analytical system in the first place.
tl;dr : Totally wrong usage of the tool.
Edit: By the way in 11g you couldn't even copy the data that way for security reasons because it's an action that isn't logged anywhere.

SSRS - Parameter - SELECT ALL vs ALL - How to remove ALL option

Please look at this ss
I am using SSRS 2008 + pulling data from a cube and made Country my parameter.
I want to keep "Select ALL" option but remove "ALL" option.
How would I go about doing that?
Thank you
You need to replace the ALLMEMBERS function with the CHILDREN function.
http://www.bidn.com/blogs/ChrisAlbrektson/bidn-blog/1452/mdx-ssrs-how-to-remove-the-all-member-from-your-parameter <-- will show you what I mean

Linq equivalent of SQL LEFT function?

We have a database with some fields that are varchar(max) which could contain lots of text however I have a situation where I only want to select the first for example 300 characters from the field for a paginated table of results on a MVC web site for a "preview" of the field.
for a simplified example query where I want to get all locations to display in the table
(this would be paginated, so I don't just get everything - I get maybe 10 results at a time):
return db.locations;
However this gives me a location object with all the fields containing the massive amounts of text which is very time consuming to execute.
So what I resorted to before was using SQL stored procedures with the:
LEFT(field, 300)
to resolve this issue and then in the Linq to SQL .dbml file included the stored procedure to return a "location" object for the result.
However I have many queries and I don't want to have to do this for every query.
This maybe a simple solution, but I am not sure how I can phrase this on a search engine, I would appreciate anyone who can help me with this problem.
You can use functions that directly translate to those functions too, this is useful when you need to translate code that functionally works just fine in SQL at no risk in LINQ.
Have a look at System.Data.Objects.EntityFunctions
Locations.Select(loc=>System.Data.Objects.EntityFunctions.Left(loc.Field,300))
This will get directly translated into a LEFT on the server side.
EDIT: I misread LEFT for LTRIM. Here's all the String functions that can't be used in LINQ to SQL. Have you tried String.Substring()?
Your best option is to map the stored procedure and continue using it. Here is an excellent article with screen shots showing you how to do so.
If you're not using the designer tool you can also call ExecuteCommand against the DataContext. It isn't pretty, but it's what we have for now.
I found something like this worked for me:
return from locationPart in db.locations
select new LocationPart
{
Description = locationPart.description,
Text = locationPart.text.Substring(0,300)
};
Not ideal because I have to use "select new" to return a a different object, but it seems to work.

How to put a parameter into an query in SSRS 2008 R2 connected to an Oracle Database 11g

Putting a parameter into the query gets the following error:
"ORA-01036: illegal variable name/number"
The query is:
select * from t_accounts where account_number = #ReportParamter1
Without the where clause, the query runs fine
Any ideas?
thanx!
Abraham
Oracle wants its bound parameters to be denoted with colons, not # signs.
So you want
...where account_number = :ReportParamter1
O. Jones highlighted the root but didn't go into as much detail as I needed to address this same issue/question. I had created the parameter in Visual Studio and as noted it has the '#' in the format of the parameter so when applied to the Dataset I got the error message. Unfortunately in the construct of the parameter in VS (I'm using 12) there isn't anything in the various options that allows designating a : in place of the #. What I discovered was after manually adding the parameter to my query in the Dataset, I then found it listed in the parameters area of the Dataset Properties - the parameter entered in query was set to the parameter made in VS. I removed the original and preview processed without issue.

Resources