postgresql – Create dynamic sql query to select all related data in DB based on entry table and ID

Hope all is well. I am hoping you can help me.

Problem Statement – I’m tasked to create a dynamic SQL statement which will select all related data from a given table where the Identifier is passed. For each table where the relevant data is found i would like the data to be exported onto a separate tab of within excel

If i was doing this manually done this i would perform the following queries and export the data onto each tab;

Select * from  Mason where id = 12345
Select * from  MasonContacts where Companyid= 12345 
Select * from  MasonOpportunities  where Comid = 12345 

However given the sheer volume of tables this isn’t viable.

Step 1 : Type in my identifier (in this case my identifier is a field called “Id” in the Table “Mason”) The query will always start from this table.

Table Name : Mason
Field : Id = “12345”

Step 2 : Search against table “MasonContacts”, search against the field “Companyid”. Return all columns & records where the field “Companyid = 12345”

Table Name : MasonContacts
Field : Companyid

Step 3 : Search against table “Mason Opportunities “, search against the field “Comid”. Return all columns & records where the field “Company = 12345”

Table Name : MasonOpportunities
Field : Comid

Looking forward to your help

passports – Why does multiple entry visa take longer to process than single entry visa?

Generally, long term visas and multi-entry visas do receive greater scrutiny, as the country would need to assess not only your trustworthiness for one trip but also the future ones. A multi-entry visa also requires additional justification.

In particular, I believe in general Indonesia requires a specific purpose and an Indonesian sponsor for multi-entry visas, which is an additional check that needs to be performed. The checking of sponsors can be better done in Indonesia than by representations abroad.

magento2.3 – Integrity constraint violation: 1062 Duplicate entry for key ‘EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME’

I’ve created a custom module that includes a script (InstallData.php) that adds a new attribute to an existing attribute group (Product Label):

'group' => 'Product Label'

However, when I enable the module and run setup:upgrade, I receive the following error:

Installing data... SQLSTATE(23000): Integrity constraint violation: 1062 Duplicate entry '10-Product Label' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME', query was: INSERT INTO `eav_attribute_group` (`attribute_set_id`, `attribute_group_name`, `sort_order`, `attribute_group_code`) VALUES (?, ?, ?, ?)

If I run the following database query I can see that there are two records with the group name ‘Product Label’, however I don’t see these
as duplicates as they belong to attribute set 10, and 4 respectively.

MariaDB (max)> select attribute_group_name, attribute_set_id from eav_attribute_group where attribute_group_name = 'Product Label';
+----------------------+------------------+
| attribute_group_name | attribute_set_id |
+----------------------+------------------+
| Product Label        |                4 |
| Product Label        |               10 |
+----------------------+------------------+
2 rows in set (0.00 sec)

Furthermore, I’m unable to delete these records as it will cause the attributes that are currently under those attribute labels to lose their current values.

Does anyone know what may be causing this issue? I have verified that the InstallData.php script works, by adding the attribute to the default group, this issue only occurs when adding the attribute to the attribute group ‘Product Label’.

I usually work on any data Including data entry, data collection, excel, MS Word for $5

I usually work on any data Including data entry, data collection, excel, MS Word

Are You need a virtual assistant for data entry? if so, then you are in the right place. I will do any kind of data entry or data Entry Related job For You With Complete Satisfaction.


Data Entry

MS Word

Copy Paste Tasks

Data Capturing from the Websites

Virtual Assistant Tasks

JPEG to Excel

PDF to Excel

Email Marketing Lists

Email Searching

Contact me anytime If you need data entry work

.

I will do total Data Entry work for $5

I will do total Data Entry work

My goal is to work with you as a remarkable, dependable and expedient Data Entry Clerk. I am ready to work under tension and hence I have no issues with unanticipated difficulties that may go along the way. Whatever my venture involves I will likewise have the option to use my initiative and authoritative aptitudes.

Tasks that i can do:

  • Online Data Entry
  • Offline Data Entry
  • Copy/Paste Work
  • PDF to Word,Excel or PowerPoint
  • Images to Word,Excel or PowerPoint
  • Scan documents to Word,Excel or PowerPoint
  • Website to excel or Word
  • Web Research
  • Edit PDF (any type, with exact font match).
  • Manually Typing Work to Excel or Word Document.

Why choose me?

  • 100% accuracy.
  • High Quality Documents.
  • fast delivery time.
  • 100% Money back guarantee.

    In the event that your work is confounded or need exceptional consideration please get in touch with me first before submitting a request. It must assistance the two of us to ensure great working quality. Thanks.

.(tagsToTranslate)Data(t)Entry(t)Webresearch(t)excel(t)typing(t)Virtual

visas – The definition of 6 months in the UK entry stamp

I am a Brazilian citizen currently working in a university in the Netherlands. Me and my girlfriend, who is British had a 20 day trip planned back in April. As I came to visit her (for us to go together), our flight was cancelled due to the covid-19 crisis. Moreover, my flight back to the Netherlands was also cancelled, therefore I was not able to leave the UK on the date I planned. I have been doing home office from her house since, now that things seem to be going back to normal, I want to book my flight back to the Netherlands, however, if possible, I would like to avoid for a bit longer to enter in a plane as corona is still a risk.

In the stamp they put on my passport when I arrived it says I can stay for 6 months. I never had to worry about this definition before now, however, how does the 6 months limit work?

  1. Are the 6 months renewed every time I come in? Which I find very unlikely, as I mean, seems far too easy to exploit.
  2. Are the 6 months renewed on a calendar year basis?
  3. Are the 6 months renewed on a 12 month rolling basis?
  4. Something else?

I specifically remember that, a couple years ago, a immigration officer at passport control telling me option 2 was the correct. I wanted to confirm this information now, so I called both covid-19 helpline for immigration, and the “general immigration advice” at 0300 123 2241, however, they told me the correct option was 1.

The email I found for immigration queries specific for covid-19 specific did not answer this question, as is not directly related to covid. But I did not manage to find a general email for immigration queries, does anyone know one?

I would be okay with that if I had managed to have it written, but I am worried whether this was just a bad luck of having two officers who did not have the right information. What if later this year I come back to visit her and another officer at passport control also claims option 2 is correct, I would not be able to use the calls as proof that I got the information from an official source.

Should I just assume a worst case scenario and go back as soon as possible?

mysql – Help with Many to Many Table Data Entry

I’ve got a question on how to “prettify” data entry and removal for a many to many relationship.

Imagine if you will a DB with 3 tables. Tables called Users, Roles, and RoleAssignment.

-- `Users`    
CREATE TABLE `Users`
(
 `userID`   int NOT NULL AUTO_INCREMENT ,
 `userName` varchar(40) NOT NULL ,
 `realName` varchar(40) NOT NULL ,

PRIMARY KEY (`userID`),
UNIQUE KEY `username` (`username`)
) AUTO_INCREMENT=1;


-- `Roles`
CREATE TABLE `Roles`
(
 `roleID`       int AUTO_INCREMENT NOT NULL ,
 `roleName`     VARCHAR(40) NOT NULL ,

PRIMARY KEY (`roleID`)
);


-- `RoleAssignment`

CREATE TABLE `RoleAssignment`
(
 roleAssignID int NOT NULL AUTO_INCREMENT ,
 roleID       int NOT NULL ,
 userID       int NOT NULL ,

PRIMARY KEY (roleAssignID),
FOREIGN KEY (userID) REFERENCES Users(userID),
FOREIGN KEY (roleID) REFERENCES Roles(roleID)
) AUTO_INCREMENT=1;

This is a database where RoleAssignment is essentially a child table only meant to connect two Parent tables together. I made them this way because the user<->role relationship is many to many.

I found a way of getting this to output just relationships between users and their roles… Both queries output the same data but query 2 is better organized.

SELECT
    Users.userName,
    Users.realName,
    Roles.roleName
FROM Users
JOIN RoleAssignment ON Users.userID = RoleAssignment.userID
JOIN Roles ON Roles.roleID = RoleAssignment.roleID;

SELECT
Users.userName,
Users.realName,
GROUP_CONCAT(Roles.roleName)
FROM Users
JOIN RoleAssignment ON Users.userID = RoleAssignment.userID
JOIN Roles ON Roles.roleID = RoleAssignment.roleID
GROUP BY Users.userID;

Is there an easy way to add an entry to the RoleAssignment table by name instead of ID in a single query? i.e. “Add user jack to role moderator”? Or would I need to write a script to find the ID of the user, then the ID of the role, and finally add an entry to RoleAssignment?

Any help or guidance would be appreciated!

usa – Entry quarantine for entering the United States

Entry screening only applies to travellers arriving from certain high-risk countries:

Currently, travel restrictions and entry screening apply only to travelers arriving from some countries or regions with widespread ongoing spread of COVID-19. (Note: U.S. policies are subject to change as the COVID-19 pandemic evolves.)

(source)

So if you are coming from a high-risk country and have COVID-19 symptoms, you may be put into mandatory quarantine.

Other than that, the US still advises self-quarantine for 14-days after arrival but this is not enforced:

You may be screened when you arrive in the United States. After your arrival, take the following steps to protect yourself and others:

  1. Stay at home and avoid contact with others.
    Do not go to work or school for 14 days.

  2. Monitor your health for 14 days. Take your
    temperature with a thermometer two times a day and monitor for fever.
    Also watch for cough or trouble breathing.

  3. Keep your distance from others (at least 6 feet or 2 meters). This is referred to as “social distancing.”

Keep your distance from

Do not go to work or

Is some remote work now permitted for travelers admitted to the UK on a tourist entry?

Users at Travel:SE have for years accepted the idea that a visitor to the UK may not use a tourist entry to “live” in the UK, and may not work remotely in the UK while visiting. The first issue seems settled, and is not the focus of this question. This question addresses only the second issue: whether a visitor to the UK may work remotely while in the UK.

Previous questions addressing this are legion, a few on Travel.StackExchange are this one and this one ; others on Expatriates.StackExchange are this one and this one. Yesterday, the question My girlfriend lives in the UK and I want to be able to come and leave as I please for next 3 years—which visa should I get? was posted on Travel:SE, and the answers and comments took the usual you-can’t-work-remotely-while-visiting track. No surprises there.

Then user @ZenJ posted an interesting comment. Here’s the comment:

Actually I just found this: Immigration Rules Appendix V: visitor
rules (gov.uk/guidance/immigration-rules/…) and sections 4.5-4.7
prohibit work in UK for UK company, but allow remote work (at least
how I understand it). In addition, where the applicant is already paid
and employed outside of the UK, they must remain so. Next paragraph
4.7 prohibits payment only from UK sources

The actual Guidance text in Sections 4.5, 4.6, and 4.7 reads as follows:

Prohibited activities

Work

V 4.5 The applicant must not intend to work in the UK, which includes the following:

(a) taking employment in the UK;

(b) doing work for an organisation or business in the UK;

(c) establishing or running a business as a self-employed person;

(d) doing a work placement or internship;

(e) direct selling to the public;

(f) providing goods and services;
unless expressly allowed by the permitted activities in Appendices 3, 4 or 5.

V 4.6 Permitted activities must not amount to the applicant taking
employment, or doing work which amounts to them filling a role or
providing short-term cover for a role within a UK based
organisation. In addition, where the applicant is already paid and
employed outside of the UK, they must remain so. Payment may only be
allowed in specific circumstances set out in V 4.7.

Payment V 4.7 The applicant must not receive payment from a UK source
for any activities undertaken in the UK, except for the following:

(a) reasonable expenses to cover the cost of their travel and subsistence,
including fees for directors attending board-level meetings; or

(b) prize money; or

(c) billing a UK client for their time in the UK,
where the applicant’s overseas employer is contracted to provide
services to a UK company, and the majority of the contract work is
carried out overseas. Payment must be lower than the amount of the
applicant’s salary; or

(d) multi-national companies who, for
administrative reasons, handle payment of their employees’ salaries
from the UK; or

(e) where the applicant is engaged in Permitted Paid
Engagements (PPE) as listed at Appendix 4, provided the applicant
holds a visa or leave to enter as a PPE visitor; or

(f) paid performances at a permit free festival as listed in Appendix 5.

I’m a retired lawyer in the US, and familiar with reading statutes and rules. While the See All Updates link shows the Guidance’s amendment history, its format is unfamiliar to me and hard to read. This text, however, seems to have been in place for at least a year.

The text in these three sections seems to contradicts the common knowledge we’ve shared here for years. § 4.5 contains work prohibitions, but it’s not difficult to define remote work that would not foul them. For example, a traveler employed by a non-UK firm, which firm doesn’t have a presence in the UK, sell product in the UK, or meet clients in the UK, appears to escape this section’s prohibitions.

§ 4.6 is more of the same, and even contains this tidbit:

In addition, where the applicant is already paid and employed outside
of the UK, they must remain so.

§ 4.7 simply prohibits payment from UK sources.

All told, this looks like remote work is permitted on a tourist entry, provided the remote work doesn’t violate any of the no-nos set forth in these three sections.

For another example, consider a foreign academic, normally resident in a home country and not in the UK, employed by a home country institution in the home country, and paid in home-country currency by that non-UK institution into a home-country bank account. It appears that this individual could work remotely while a visitor in the UK without violating any of these prohibitions, provided the work consisted only (for example) of leading online classes of students who themselves all remain in the home country.

Thus, my question: Is some remote work now permitted for travelers admitted to the UK on a tourist entry?

customs and immigration – Macau/China visa – Being an Indian resident, can i travel Macau on Chinese single entry visa?

So, I am travelling to China this month and I had applied for a 2 entry visa to the consulate which they denied for some reasons. This alters my plans to travel to Hongkong and Macau. I just need a small information about visa regulations if anyone is aware of. So, it goes like this, “I want to visit Macau, but turns out I have been awarded single entry visa . Although, I had checked that Indians do not require any visa to visit Macau but does it mean that even if I am allowed free entry to Macau or on arrival entry to Macau, coming back to China means second entry? Because if it’s so then I might get caught up in immigration issues. I would like to mention that my flights are back and forth from China and I can’t alter that travel route. Which means I cannot leave China, but the main confusion I am into is relating if Macau doesn’t need visa does it mean that Chinese visa would suffice?”

I would be very glad if I can get some answers along with some references to either official websites or someone’s experiences.

Kindly, help as I am finding this visa stuff in China a little confusing.

Regards,
Pratik