Getting a dbid by table name - quickbase

As far as I know, all QuickBase API calls are called using the following syntax: http://<quickbase>/db/<dbid>?
Is there a way to get the dbid field without navigating to that database table within QuickBase?
If the above is not possible, would anyone recommend anything other than creating another table that stores the IDs of the tables you want?
With the latter method, I believe I would only need to store one dbid and could pull down the rest (which I believe would still need to be user entered, but would be better than requiring them to change the code).
Thanks for the help!

API_GetSchema will return the list of dbids.
https://www.quickbase.com/db/<yourApplicationId>?act=API_GetSchema&apptoken=<yourApplicationTokenId>&fmt=flat

Related

servicenow getting value from extended table

Good Evening, I am sure this is a very simple question. But I am having no luck finding a correct answer.
I have onLoad client script on a request form. The form has a variable that I need to auto populate, the value is on a sys_user extended table.
I am not sure how to pull that value from the sys_user extended table.
I know to use a GlideRecord to get the current user on the sys_user, but after that is were I am having the issue.
Thanks for any help or suggestions you may have.
James
As you mentioned, GlideRecord should be what you need to use. The exact script will vary based off of what field you are trying to query on your extended table.
var gr = new GlideRecord("extended_table_name");
gr.addQuery("field_name", "query");
gr.query();
if (gr.next()) {//action you want to take}
You can add as many addQuery() methods as needed to build the query as specific as you require. The query() method then runs the query and return a new GlideRecord object. The .next() method checks to see if there is another record in the GlideRecord object and advances to the next record if so. After running the script above, you can access any properties on the GlideRecord you may need by simply dotwalking to them. i.e:
sys_id = gr.sys_id;
name = gr.getDisplayValue();

Entity Framework returns different result with AsNoTracking

I use Entity Framework in combination with an Oracle database. If I create a query like
myLinqStatement.ToListAsync()
I get wrong data returned as a result. If I change the statement to
myLinqStatement.AsNoTracking.ToListAsync()
I get the correct data.
I also checked the native SQL query, which is generated by myLinqStatement.ToListAsync(). The generated SQL query is correct, because I get the correct data.
So is there a problem in the mapping? And why is it working with AsNoTracking?
Thanks!
What AsNoTracking does is to retrieve the data without attaching it to the context, hence any changes you apply over the data do not take effect unless you attach it again so that EF knows it should track its changes.
The code snippets you've provided do not show the whole picture, from the moment a context is created, but is it possible that other parts of your code mutate data before you call myLinqStatement.ToListAsync()?
As you mention that myLinqStatement.AsNoTracking.ToListAsync() returns expected data, makes me assume that there are some side effects in your code that AsNoTracking simply is not aware so just returns whatever it finds in your db
I came across this question because I had a similar issue with Entity Framework Core querying a DB view, the issue was cause because view didn't have a key defined, after defining a key for the entity that map to that DB view, the query returned the same result in both cases (using AsNoTracking or without using it).
In T-SQL a key for a DB view can be defined this way:
CREATE UNIQUE CLUSTERED INDEX UQ_MyDBViewName_ColumnKey
ON dbo.MyDBViewName (ColumnKey);
And in code, you can map the key using the [Key] attribute in the corresponding property of the entity or using the EF fluent API. It will depend of what the project is using.
Either way, using AsNoTracking on a query that goes directly to a DB view makes a lot of sense. Also, if for some reason the query of the view does not allow us to define a key for that view, then the option is to use AsNoTracking.
Hope it helps anyone else having the same issue.

Creating report in Microsoft Access

I am working for a hospital and must create a form which MDs can use to submit accounts of child abuse. I must use Microsoft Access.
I have created the form itself, but I must now create a way which information can be harvested from the form. For example, if the doctor inputs the age, where can I store this?
I know access works through fields, but not how to create them. Is it useful here to use excel?
Thank you.
Condolences on having to use Access :-) Been there, done that.
Access stores the data in "tables". A "form" is just a front end for entering or displaying table data. When a doctor enters the age, that field in the form needs to be linked to a column in the underlying table.
When you want to create a "report", you will first need to create a "query" that selects and sorts the data from one or more "tables". You can see the query results in a spreadsheet format while you are designing the query. Then you can create a "report" which is a formatted layout for the query results.
I would recommend a book like Access 2010: The Missing Manual to help you get up to speed on Access quicker.

mutual exclusion in joomla

I created an extension for joomla using:
$id=$database->insertid();
I just covered that if two users are logged on to the site will fit together perform two records in the database and then this statement will return in both cases the same value.
in php you can solve this problem with the transactions.
In joomla how do I solve this problem?
If you have a table you are working with that extends JTable then make sure that you included the check out functionality that is optionally a part of that. THis must means adding a couple of fields like what is in the content table. This will prevent two people from editing the same row at the same time which creates a race condition in which one of the other will lose their data.
Please note that both php and joomla functions to return the last insert id rely on the mysql implementation, and mysql returns the last id inserted on the currently open connection so concurrency is not an issue
#iacoposk8 Your are right it might possible that in very rear case. Such time try to add current logged in user id in your sql query or any where so that it doesn't make any confict. I hope you get it what i want to say. Thanks

table alias in linq edmx

I am trying to replicate something that would be simple with a stored procedure.
I have a set of tables like so:
acem__main
acem__child
beta__main
beta_child
xyz__main
xyz__child
In my edmx, I have the acem_main and acem_child linked via a primary/secondary key.
However depending on who logs in I would like to utilise the data of either acem, beta or xyz.
I cannot imagine how to fit this into linq - can anyone help please?
Create a method that returns an IEnumerable and take a user as arguments. In the method, create three Linq queries for acem, beta or xyz and return the result from the query that correspond to the given user.

Resources