Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Prabhas
Page 3 of 6
How can we fetch all the data from MySQL table by using mysql_fetch_array() function, returning an array with the numeric index, in PHP script?
The function mysql_fetch_array() returns an array with numeric indexes when you use the constant MYSQL_NUM as the second argument. This allows you to access fetched data using numeric indexes like $row[0], $row[1], etc. Syntax mysql_fetch_array($result, MYSQL_NUM) Parameters $result − The result resource returned by mysql_query() MYSQL_NUM − Constant that specifies numeric index array Example In this example, we fetch all records from a table named 'tutorials_tbl' using mysql_fetch_array() with MYSQL_NUM to get numeric indexes − Output Tutorial ID :1 Title: Learn PHP ...
Read MoreUsing Group by hour in SAP HANA table
When working with SAP HANA tables, grouping data by hour is a common requirement for time-based analysis. This can be achieved using different approaches depending on your specific needs. Method 1: Using DATE() and HOUR() Functions You can try this method to convert time to date and hour format − select to_varchar(time, 'YYYY-MM-DD'), hour(time), sum(r_time) as r_time, sum(p_time) as p_time from t1 group by date(time), hour(time) order by to_varchar(time, 'YYYY-MM-DD'), hour(time); This approach extracts the date and hour components separately from the timestamp column. The DATE() function extracts the date part, while HOUR() extracts ...
Read MoreRead a date filter as input in WEBI report in SAP BO
Your requirement is one of its kinds but can be achieved. What you can try out is first create a brand new object in the context. Let's say you provided the date as first input and 5 as a weekly slice in the second input. Example Here's how you can create a date filter formula using DATEADD function with prompts − [Date+5]=DATEADD(@prompt('Slice', 'X'{'Day', 'Month', 'Year'}, mono, constrained, persistent), 5, @prompt('Date', 'date', mono, free, persistent)) In this formula: X refers to your slice type (Day, Month, or Year) ...
Read MoreUsing SAP JCO to connect SAP server to JAVA application
When connecting SAP server to JAVA applications using SAP JCO, it is recommended to use load balancing parameters instead of direct server connection parameters for better reliability and performance. Recommended Connection Parameters Instead of using JCO_AHOST and JCO_SYSNR for direct server connection, use the following load balancing parameters − JCO_R3NAME − Use this with the system ID of the target host JCO_MSHOST − Use this with the message server host name or IP address JCO_MSSERV − Use this with the message server port number ...
Read MoreField not getting save from table to transparent table in SAP
When working with SAP tables and transparent tables, you may encounter issues where fields are not getting saved properly. What can be understood from this problem is not a type mismatch but rather a mismatch in field size, as defaults are different for each table type. Understanding the Size Mismatch Issue In SAP, when you create fields in different table types, the system assigns default sizes that may not always match. This discrepancy can prevent data from being saved correctly when transferring information between a regular table and a ...
Read MoreFetch the modified date of table in SAP HANA
In SAP HANA database, you can fetch the modified date of a table using the system view SYS.M_TABLE_STATISTICS. This view provides statistical information about tables, including their last modification timestamps. Using M_TABLE_STATISTICS System View The M_TABLE_STATISTICS system view contains metadata about tables in your SAP HANA database. You can query this table to find information about when a specific table was last modified by ordering the results based on the last modified date. Example Here's how to query the ...
Read MoreSpecified cast not valid for datetime while using SAP RFC
When working with SAP RFC connections in .NET applications, you may encounter the "Specified cast not valid for datetime" error. This typically occurs when trying to convert SAP date/time formats to .NET DateTime objects due to format mismatches. Understanding the Issue SAP systems often use different date and time formats than what .NET expects by default. The most common SAP date format is dd.mm.yyyy or variations with time components. When .NET tries to automatically parse these values, it fails because it cannot recognize the format. Solution Using ParseExact Method The best approach is to use the ...
Read MoreApply filtering on Model to fetch filtered data in ABAP
When working with ABAP models, a simple change can sort the filtering problem out. Just replace the read call with an object notation rather than the current one which is based on position. Understanding Object Notation vs Position-Based Reading In ABAP, when fetching filtered data from models, using object notation provides better performance and clearer code structure compared to position-based reading. Object notation allows you to specify field names directly, making your code more maintainable and less prone to errors. Position-Based Reading (Avoid This) The traditional position-based approach relies on field positions − READ ...
Read MoreWhat are method local inner classes in Java?
In Java, we can write a class within a method and this will be a local type. Like local variables, the scope of the inner class is restricted to the method.A method-local inner class can be instantiated only within the method where the inner class is defined. The following program shows how to use a method-local inner class.Examplepublic class OuterClass { public void display(){ int num = 23; class Inner{ public void print() { System.out.println("This is method inner class "+num); ...
Read MoreCan you have a method in Java with varying number of arguments?
Yes, we can write a method using variable arguments once you use variable arguments as a parameter method while calling you can pass as many numbers of arguments to this method (variable number of arguments) or, you can simply call this method without passing any arguments.Examplepublic class Sample{ void demoMethod(String... args) { for (String arg : args) { System.out.println(arg); } } public static void main(String args[] ){ new Sample().demoMethod("ram", "rahim", "robert"); new Sample().demoMethod("krishna", "kasyap"); new Sample().demoMethod(); } }Outputram rahim robert krishna kasyap
Read More