Joining table with Command - Crystal Reports - sql

I need to make a report where I need to combine Command and another table together.
How can I integrate a table in the SQL query in Command so I can have all fields and formulas from that table in Command?
The query for Command is really long and complicated and it's used in another report. I'm trying to use this Command with another table called mCallEnd because I need couple of fields from mCallEnd table to make my report.
How can I do that in SQL query?
Command is on this link: http://www.docdroid.net/13pis/command1.txt.html
Report that I need to make looks like this: http://i.imgur.com/2boSrzJ.jpg?1

Try joining command and table in crystal report database expert. Which should work... if that is not possible for you.. try below.
Create a view with that command and join the view and table in crystal reports database expert.
Above solution provided assuming command and table are in same database.

Related

how do I view tables that I have created using azure query editor?

I created a sql database using azure. And also I created some tables in that database. Now I want to view those tables. I tried "show tables" command using query editor. But It doesn't work.what is the correct way to do that?
Try this,
SELECT name FROM sys.tables

how to create a view using a command or results of a command in Crystal Reports

I have SQL query which I can use as a 'command' to add data to my existing table in SAP Crystal Reports 2013. However I am looking to use the command to create a View which I will like to join to my original table rather. It makes the report run faster than the former.
Therefore please can someone guide me on how to create a view in SAP 2013 either by using a SQL command or the results of an existing report?

generate create table from existing table

I have a few large tables in a oracle DB (lots of columns and data types) that I need to move to another oracle database (say from my DEV region to UAT region). Is there anyway I can get sql developer or sql plus to output a create table statement that is exactly the structure of the existing table?
thanks
If you want to get it through SQL statement then you can try the below query
SELECT dbms_metadata.get_ddl('TABLE', 'Your_Table_Name') FROM dual;
See DBMS_METADATA for more information.
You can generate the script using Toad software as well (In case you have Toad installed)
If you are making use of the SQL Developer you can right click the table that you want to generate a script for.
From there select Quick DDL and then click on Save To File. This will then generate the create table script to an external sql file. You can do this for multiple tables as well by selecting more than one table at a time.
Hope this helps!!
Another option is to create a database link between the two schemas and then do a
create table table_name AS SELECT * from table_name#original_server

FORM on a SQL Query APEX

I am working in Oracle APEX 4.2. I have created Form on Table, Tabular Form and Form on Table with Report. I have tried a lot to create form on a SQL Query but i can't.
I have two Question related of Form on a SQL Query !
First i want to make Form on SQL Query on Two Tables i-e `
Patient_Registration
Pat_Id(Pk),Name,Address,Gender ,Age,Contact
and Patient_Charges
P_Ch_Id(Pk),Patient_Id(Fk),P_Doc_Charges,P_Extra_Charges
Second is that if the from is made then we will be able to make insertions on two tables in one form ?
I *think * I understand your question.
Create a view with your SQL query and then add a Before Insert trigger which does the necessary DML.
Check out some of the sample apps for ideas in this respect.

Add exsiting query to report

My report calculates the stock of inks in my stores. I built a SQL statement in VB.NET and got the correct results. How can I display these results in my Crystal Report? Or design a report such that same results will be retrieved?
I tried to use SQL Expression builder but failed.
Usually you will link Data Tables to your report using Database Expert. Do the same in Database Expert, select the Database and you can see Add Command. Select that and click the > button. You will get a Window, write your SQL Query there and press OK.
After finishing this you can see Command in Database Fields which contains all your records got from the SQL Query as result.
In Database Manager choose Add Command and then type your SQL Statement there.