How to update/save oracle synonyms in database with Python/Django - sql

I am writing a web in Python, I would like to save or update oracle synonyms as select * from synonyms into local database, so the local python program can use those values at regular intervals, I was trapped, is there anyone who tell some ideas? Thanks so much!

You should either fetch that data, as mentioned in another answer, or make your backend write the data part of the vue script, probably using a template engine, when rendering the page.

Related

How to upload a table and run sql on it?

I want to practice some SQL locally on specific tables that I have.
What I need is simply to take a table, upload it to a software I can run SQL on and work with it. nothing more. no servers, no other users.
I tried a few different products but just can't find one that allows this option without creating a server and setting up connections.
Please help :)
Thanks!
I think something like SQLite would work well for your purpose. SQLite is serverless
You can then use a shell or DOS prompt to create a db for it, create your table(s) for the db, and then upload your data to the table(s).
https://www.sqlite.org/quickstart.html
sql fiddle, maybe this is what are you looking for.

How should I store SQL queries in my API server?

I'm making an API server that require SQL queries that has something like 20-40 lines.
I want it to be a simple server so I'm using NodeJS, express, body-parser and a database connector.
In other environments, I understand that you either use final constants or import SQL files but I don't know what's the best method in Node.
I think reading in individual SQL file for every query will be slow and since JavaScript does not support multiline string, saving them in a json object would seem tedious.
(I know ES6/Babel exists but it seems like an overkill for just one functionality).
So the question is what's the best and the most common way to store SQL queries in the context of node/express?
20-40 lines seems like a lot... Have you considered making those queries views or stored procedures?
The other thing is that if you are using at least NodeJS 4.6.1 you can use template literals out of the box

Remote MSSQL/ODBC Syncing With Rails

I am working with a client that has data in an MSSQL database. I only have read access to a remote ODBC connection and cannot modify the database in any form.
I'd like to replicate a subset of the data locally in an open-source alternative, syncing once per day or so. This is largely to eliminate reads against the data during peak hours. The local data will be used in a Rails 4 application. Note that syncing only needs to be one-way, as I don't have write access.
How can I best accomplish this?
FreeTDS?
Are there any libraries that will help with the syncing, or can I expect to write all the glue code myself?
I would advise you to create a ruby script that can be scheduled to do the data retrieving.
In order to connect to the MSSQL database, please take a look at this simple project I've created.
Then you only need to code the data you want to retrieve and the way you store it.
I prefer the approach of being decoupled from your rails application, although you can use a scheduler like rufus-scheduler or sidekiq and run it with your application.

How can I copy from Oracle to Sybase using SQL*Plus?

I have an application that stores data in an Oracle database. I want to copy selected rows from a table in this database to a table in a Sybase database (archiving records). Can I do this directly (i.e. without storing and loading results from a file)?
I've mostly looked into SQL*Plus
SQL*Plus COPY Command (http://docs.oracle.com/cd/B19306_01/server.102/b14357/apb.htm)
Copying Data from the Oracle Database Server to Sybase (http://docs.oracle.com/cd/A95432_01/a80982/ch5.htm#153526)
Copy Command (http://www.oracleutilities.com/SQLPLus/copy.html)
Oracle® Database Gateway for Sybase User's Guide (http://docs.oracle.com/cd/B28359_01/gateways.111/b31048/toc.htm)
I also understand the following: "However, INSERT is the only option supported when copying to Sybase. The SQL*Plus COPY command does not support copying to tables with lowercase table names." However, I haven't been able to do this in SQL*Plus. I'll keep trying, but if anyone has an example of how to do it here, I'd very much appreciate it.
If this is not possible, is Oracle Data Pump (http://www.oracle.com/technetwork/database/enterprise-edition/index-093639.html) my best alternative?
Thank you!
Sincerely,
Deepyaman
Your best bet may be to use some form of ETL tool to handle this if the size of your data is reasonable, rather than getting into the details of setting up the gateways, etc, between systems.
There are many options - Talend Open Studio (free), Informatica, or Microsoft SSIS all should be able to handle this.
The robust way to do this is create a flat file(txt,csv) or an INSERT sql from your "COPY_FROM_DATABASE". And then load it into corresponding table. You might have to do a bit of formatting in this sql in order to run it on a different server. I personally like INSERT sql better.

Sql Server Full Text Search - Getting word occurances/location in text?

Suppose I have Sql Server (2005/2008) create an index from one of my tables.
I wish to use my own custom search engine (a little more tuned to my needs than Full Text Search).
In order to use it however, I need Sql Server to provide me the word positions and other data required by the search engine.
Is there anyway to query the "index" for this data instead of just getting search results?
Thanks
Roey
No. And if you could, what happens if Microsoft decide to change their internal data structures? Your code would break.
What are you trying to achieve?
You shouldnt rely on SQL servers internal data structures - they are tailored specifically for SQL servers use and aren't acessible for querying anyway.
If you want a fast indexer then you will probably have more success using a pre-written one rather than trying to write your own. Give Lucene.Net a try.