I have a SQL query which is using CONTAINS and is not finding recently created records that it should be finding, for example...
SELECT Id, Title
FROM Books
WHERE CONTAINS(Title, 'Frankenstein')
...should find...
Id_____Title
321____Frankenstein
Older records are being found.
I believe this may be related to a full text catalog, (present in SSMS under DB > Storage > Full Text Catalogs), which has the table as an object, and has the Title column ticked as an eligible column. "Track changes" is set to automatic. The "Last Population Date" is over a year ago. The "Population Status" is "Idle".
My understanding so far, (which may well be wrong), is that the CONTAINS searchable terms are being controlled by the full text catalog, therefore perhaps if I rebuild, or repopulate it, the record will be found? Could I even schedule this to happen automatically to prevent this problem in the future?
The "Repopulate catalog" option on the full text catalog is greyed out. The "Rebuild catalog" option is not greyed out. I am concerned about attempting to perform either operation without fully understanding what they do... could you explain? I have already read the material around this subject on MSDN.
Thanks.
Related
I'm new into AS400 and I got a job where I'm using AS400 and Powerlink (XA) to access and manage big ERP data. And I found a way to access the data through Excel VBA and SQL using the System I Nagivator tables.
My problem is that I can't find the correct Schemas>Tables in Navigator to feed the excel VBA that matches the data that I want in AS400.
Question: let's say I want to find the price for an item, and I want to find the price table in Navigator. Is there a way in AS400 to get the price table name that matches the same table in Navigator ?
This is my first question please let me know if more information is needed.
Please help, thank you!
First a little terminology, AS/400 is an old term, the current name for the Platform and OS that used to be called AS/400 is now IBM i on Power Systems. IBM i is the OS. (that is until IBM changes the name again)
If You Know the Table Name but not the IBM i Object Name
On IBM i, the database is built into the OS and many of the OS objects are in fact database objects. Here is how some of the SQL concepts map to IBM i terms.
SQL IBM i
-------------- ------------------
Schema Library
Table Physical file
Index Logical file
View Logical file
Row Record
Column Field
Unfortunately in IBM i, object names are limited to 10 characters. SQL names on the other hand can be up to 128 characters. You won't find a Physical file named CustomerMaster. DB2 maps that long name to a system name. You can find the system name by querying the catalog like this:
select system_schema_name, system_table_name
from qsys2.systables
where table_name = 'Navigator name'
The column TABLE_NAME will hold the long SQL name of the table, SYSTEM_TABLE_NAME will hold the IBM i object name. Note that long schema names can be mapped to system names as well. The column SCHEMA_NAME holds the long SQL name of the schema while SYSTEM_SCHEMA_NAME holds the IBM i library name. It is uncommon for schema names to be longer than 10 characters, so the two schema name columns are typically the same.
If You Know the Program Name, and Have Access to the Source
This may be obvious to you, but I am putting it here just for completeness. You can look in the source for the files being used, and back track from the screen field to the file.
If You Only Have A Green Screen
You can retrieve the open files for the current job if you have the appropriate authority. If this doesn't work for you, you will have to get help from your system administrator, or someone who does have authority. This will only get you candidate files though, and likely they are logical files. To do this, you are going to have to have authority to view your job, and you will have to know how the system request key is mapped to your keyboard (that is implementation specific, and may be customized, so you will have to check with someone inside your company or your emulator to determine that).
With that behind us, start the green screen program that shows the price field you are looking for. Then press the system request key. If you are configured to allow this, you will get an input line on the bottom of your screen, and the cursor will be positioned to it.
Press Enter.
You should now be in the System Request menu.
Select option 3 and press enter again. You should be in the Display Job screen for your current job.
If this all worked correctly for you, then option 12 will show you the files that your job currently has a lock on. That is, the files that are open for your job. The price field should be in one of them.
I've successfully migrated 1,000s of news items and other content from Sitefinity 5 to Wordpress after hours of excruciating analysis and sheer luck with guessing but have a few items that are still left over. Specifically the pages. I know a lot of the content is stored in very obscure ways but there has to be somebody who has done this before and can steer me in the right direction.
My research (and text-search against the DB) has found the page titles etc but when I search the content I get nothing. My gut tells me that the content is being stored in binary form, can anyone confirm if this is the case?
Sitefinity documentation is only helpful if you're a .net developer who has a site set up in Visual Studio (as far as I've seen).
This is probably the most obfuscated manner of storing content that I've ever encountered. After performing text searches against the database I've finally found where the content is stored but it's not a simple process to get it out.
Pages' master record appears to be sf_page_node, there are related tables:
sf_object_data (page_id is related to sf_page_node.content_id)
sf_draft_pages (page_id is related to sf_page_node.content_id)
sf_page_data (content_id is related to sf_page_node.content_id)
sf_control_properties (control_id is related to sf_object_data.id)
So you could get the info you need with a query like this:
select * from
[sf_page_node]
join sf_object_data on sf_page_node.content_id = sf_object_data.page_id
join sf_control_properties on sf_object_data.id = sf_control_properties.control_id
Other things to consider:
the parent_id field is related to the sf_page_node table, so if you're writing a script, be sure to query this as well
the page may have a banner image, you will pick up the "place_holder" value as 'BannerHolder' with a caption of "Image" The image may be stored as blobs in sf_media_content, you should handle this separately. The "nme" value of 'ImageId' will have a GUID in the "val" column. You can query sf_media_content with this value as "content_id" the actual binary data is stored in sf_chunks, they relate on "file_id"
My revised query taking into account what I'll need to migrate content is below:
select
original.content_id,
original.url_name_,
original.title_,
parent.id,
parent.url_name_,
parent.title_,
place_holder,
sf_object_data.caption_,
sf_control_properties.nme,
val
from [sf_page_node] original
join sf_object_data on original.content_id = sf_object_data.page_id
join sf_control_properties on sf_object_data.id = sf_control_properties.control_id
join sf_page_node parent on original.parent_id = parent.id
I hope this helps someone!
You don't need the version items in this case - as you already found out, it stores the previous version of the pages in binary format.
The current live pages' data is available in sf_control_properties and sf_object_data tables. You need to join these together with sf_page_data and sf_page_node and you will get the full picture.
Depending on your requirements, it may be easier to do a GET request to each page and parse the returned html response.
I am trying to write a query that 1) works and 2) shows meaningful information.
However, I can't seem to complete both scenarios. Both bits of code do work to a degree. My SQL query does work by showing all the useful information a user wants but when you click the edit button it doesn't link properly so it won't allow the user to update that row. The other shows only keys and rowid but when you click edit does show the information and allows it to be updated.
So as not to get another down-voted question, I have taken pictures of each scenario to show the problem, but, ultimately, I need to show meaningful information: an id or key isn't meaningful to the vast majority of users.
Here is my code
SELECT APPLICATIONS.APP_ID, APPLICATIONS.SRN, STUDENTS.SURNAME, STUDENTS.FORENAME, APP_STATUS.STATUS, METHODS.METHOD, JOBS.JOB_TITLE, APPLICATIONS.APP_DATE
FROM APPLICATIONS
JOIN STUDENTS
ON APPLICATIONS.SRN = STUDENTS.SRN
JOIN APP_STATUS
ON APPLICATIONS.STATUS_ID = APP_STATUS.STATUS_ID
JOIN METHODS
ON APPLICATIONS.METHOD_ID = METHODS.METHOD_ID
JOIN JOBS
ON APPLICATIONS.JOB_ID = JOBS.JOB_ID;
and here are the pictures of it in action
below is the code that does not show meaningful information but does work.
select "ROWID",
"APP_ID",
"SRN",
"STATUS_ID",
"METHOD_ID",
"JOB_ID",
"APP_DATE"
from "#OWNER#"."APPLICATIONS"
If i knew how to properly use rowid i am sure this is a simple feat but i dont so if i could get any help it would be useful
//edit
who ever renamed this to Application Expression why? what i am using is Apex Application Express it was relevant information that got changed to something wrong which might make it hard for someone with a similar problem to find later.
In the second, simple query, apex can determine which table (and record) you are trying to edit.
In the first query, with the joins, it can't tell which of the five tables in query you want to edit. You probably want to have the edit link pass the primary key of the row from APPLICATIONS to the child page. You would need to build into that page any logic (lists of values etc) that map lookup tables (such as status) to the values needed in the APPLICATIONS table.
"meta/background about the use of code and person using it"
1.site built by professional that left company,
2.I am inexperienced but trying/ want to learn,
3.Customer support site for service reps,
................................................
What im trying to do exactly per stackoverflows parameters.
We have a drop down box listing issues that the customer had in a column labeled "issue_type". I can export via csv entire table load onto excel then give to boss for overall review of what the issues were. However data base has a "hide" column. Its function is that when the row is updated the record is kept but the same "job or call" has only one viewable report on site (the most recently updated one). Hide is a boolean. In conclusion I want to export rows that only has the "hide" column Boolean status at 0, AND to only export the columns "customer", and "issue_type". I can seem to only do one or the other. and have researched a minimum of 4 hours to find answer myself and cannot find a syntax to do both at the same time with phpmyadmin.
I dont want an enormous data that is mostly useless but for issue type and customer but i will have to manually delete all the rows with hide = 1?
Thanks anyone 1st attempt question sorry if not correct for stackflow.
SELECT Customer,Issue_type FROM tickets where hide =0;
Elaborating on what is above for anyone that may be looking for a similar answer, SQL supports the "where" clause of which you can when properly syntaxed select many of your columns and their associated strings, booleans, and numbers to = what your looking for. Wildcards I found later for other uses work as well.
Sorry about the self answer but hopefully someone finds this usefull
I am reviewing a coworkers sqlgen job and I am unable to figure out what this means in the table generation settings.
Specify number of rows by: "Same as mapped data"
My coworker has this selected on each table, I just need to know what is meant by this I have looked through documentation and been unable to find a definition for this.
I am on version 2 at the moment. Probably not the best question but I need an answer and he is gone for a long period of time and our data is not working correctly with this tool.
The "Same as mapped data" option is only available when you're using an existing table or view as a data source - it just means that the generator will insert all the rows from the source table or view. The other options are:
Numeric value - a set number of rows
Proportion of table - a proportion of the source table/view
Generation time - as much data as the tool can generate in a set time
There's a little more about using an existing table/view as a data source here on the website, but it doesn't have much else useful in it.