FabulousCode Blog

Wednesday, May 13, 2026

Download ODBC Driver for SQL Server

May 13, 2026 0
Download ODBC Driver for SQL Server

 




Applies to:  SQL Server  Azure SQL Database  Azure SQL Managed Instance  Azure Synapse Analytics  Analytics Platform System (PDW)  SQL analytics endpoint in Microsoft Fabric  Warehouse in Microsoft Fabric  SQL database in Microsoft Fabric

Microsoft ODBC Driver for SQL Server is a single dynamic-link library (DLL) containing run-time support for applications using native-code APIs to connect to SQL Server. Use Microsoft ODBC Driver 18 for SQL Server to create new applications or enhance existing applications that need to take advantage of newer SQL Server features.

Prerequisites

Before you install the ODBC driver on Windows, make sure you have the following prerequisites:

  • Visual C++ Redistributable: The ODBC Driver for SQL Server requires the Microsoft Visual C++ Redistributable. If this component isn't already installed on your system, download and install it before installing the ODBC driver. Download the version that matches your system architecture (x64, x86, or ARM64) from Microsoft Visual C++ Redistributable latest supported downloads.

 Note

Most Windows systems already have the Visual C++ Redistributable installed. If the ODBC driver installation fails or the driver doesn't load correctly, verify that the Visual C++ Redistributable is installed on your system.

Linux and macOS don't require this component. For Linux and macOS prerequisites, see the installation guides linked in the Download for Linux and macOS section.

Download for Windows

The redistributable installer for Microsoft ODBC Driver 18 for SQL Server installs the client components, which are required during run time to take advantage of newer SQL Server features. It optionally installs the header files needed to develop an application that uses the ODBC API. Starting with version 17.4.2, the installer also includes and installs the Microsoft Active Directory Authentication Library (ADAL.dll).

Version 18.6.2.1 is the latest general availability (GA) version. If you have a previous version of Microsoft ODBC Driver 18 for SQL Server installed, installing 18.6.2.1 upgrades it to 18.6.2.1. The Microsoft ODBC Driver 18 for SQL Server can be installed side by side with Microsoft ODBC Driver 17 for SQL Server.

 Download Microsoft ODBC Driver 18 for SQL Server (x64)
 Download Microsoft ODBC Driver 18 for SQL Server (x86)
 Download Microsoft ODBC Driver 18 for SQL Server (ARM64)

 Note

Use the x86 installer on 32-bit machines, the x64 installer on x64 machines, or the arm64 installer on ARM64 machines. The x64 and arm64 installers install both 64-bit and 32-bit drivers.

Version information

  • Release number: 18.6.2.1
  • Released: March 31, 2026

 Note

If you're accessing this page from a non-English language version, and want to see the most up-to-date content, select Read in English at the top of this page. You can download different languages from the US-English version site by selecting available languages.




Wednesday, September 17, 2025

ORACLE DATABASE ALL DATA INSERT STATEMENT

September 17, 2025 0
ORACLE DATABASE ALL DATA INSERT STATEMENT

 



আপনি যেটা লিখেছেন সেটা PL/SQL block এর মতো, কিন্তু সেখানে প্রতিটি INSERT শেষে semicolon (;) দিতে হবে। আর COMMIT;-ও শেষে থাকবে।

BEGIN

    INSERT INTO XX_ITEM_MASTER_TEST (INVENTORY_ITEM_ID, ITEM_CODE, DEPARTMENT)
    VALUES (1242897,'TTSF0000000000000117','Physical Test');

 

    INSERT INTO XX_ITEM_MASTER_TEST (INVENTORY_ITEM_ID, ITEM_CODE, DEPARTMENT)
    VALUES (1242799,'TTSG0000000000000157','Physical Test');

 

    COMMIT;
END;
/

Sunday, August 24, 2025

Install IIS (Internet Information Services) For PHP

August 24, 2025 0
 Install IIS (Internet Information Services) For PHP


 Install IIS (Internet Information Services) For PHP



Download Link  IIS Manager


Step 1 — Install IIS (Internet Information Services)

First, we need to enable IIS on your machine.

For Windows 10/11 / Windows Server:

  1. Press Win + R, type:

    appwiz.cpl

    and press Enter.

  2. On the left side, click Turn Windows features on or off.

  3. In the list, find and check:

    • Internet Information Services

    • Expand IISWorld Wide Web ServicesApplication Development Features
      Enable:

      • ASP.NET (Both 3.5 & 4.8 if available)

      • ISAPI Extensions

      • ISAPI Filters

      • CGI

    • Under Web Management Tools, enable IIS Management Console.

  4. Click OK.

  5. Wait until IIS installs.

Check IIS is installed:
Open a browser and go to:

http://localhost

If you see the IIS Welcome Page, IIS is installed successfully.


Step 2 — Download and Install PHP

We'll use the PHP for Windows (Thread Safe) version for IIS.

Steps:

  1. Go to the official PHP website:
    https://windows.php.net/download/

  2. Choose the latest Thread Safe version of PHP (e.g., PHP 8.2 / 8.3).

  3. Download the .zip file (not the installer).

  4. Extract the ZIP file to a folder, e.g.:

    C:\PHP

Step 3 — Install PHP Manager for IIS (Optional but Recommended)

PHP Manager is a tool that makes managing PHP inside IIS much easier.

  1. Download PHP Manager for IIS:
    https://github.com/phpmanager/phpmanager/releases

  2. Run the installer.

  3. After installation, open IIS Manager → You'll see PHP Manager under the IIS section.


Step 4 — Configure PHP in IIS

Option 1: Using PHP Manager (Recommended)

  1. Open IIS Manager.

  2. Click on your server name in the left panel.

  3. Double-click PHP Manager.

  4. Click Register new PHP version.

  5. Browse to:

    C:\PHP\php-cgi.exe
  6. Click OK.


Option 2: Manual Configuration

If you don't want to install PHP Manager, do it manually.

Steps:

  1. Open IIS Manager.

  2. Click on your server name → Double-click Handler Mappings.

  3. Click Add Module Mapping on the right.

  4. Fill in the details:

    • Request Path*.php

    • ModuleFastCgiModule

    • ExecutableC:\PHP\php-cgi.exe

    • NamePHP via FastCGI

  5. Click OK → When prompted, click Yes to create the FastCGI handler.


Step 5 — Configure php.ini

  1. Go to:

    C:\PHP
  2. Copy:

    php.ini-development

    Rename it to:

    php.ini
  3. Open php.ini in Notepad.

  4. Search for:

    ;extension_dir

    Update it:

    extension_dir = "C:\PHP\ext"
  5. Enable required extensions by removing the ; before them. For example:

    extension=mysqli extension=pdo_mysql extension=gd extension=curl
  6. Save the file.


Step 6 — Add PHP to System Environment Variables

  1. Right-click This PCProperties.

  2. Go to Advanced system settings.

  3. Click Environment Variables.

  4. Under System variables, find Path → Click Edit.

  5. Add:

    C:\PHP
  6. Click OK.


Step 7 — Configure IIS Default Document

  1. Open IIS Manager.

  2. Select your website → Double-click Default Document.

  3. Click Add.

  4. Enter:

    index.php
  5. Move index.php to the top of the list.


Step 8 — Test PHP Configuration

  1. Go to your IIS root folder:

    C:\inetpub\wwwroot
  2. Create a file named:

    info.php
  3. Paste the following code:

    <?php phpinfo(); ?>
  4. Open your browser and visit:

    http://localhost/info.php
  5. If you see the PHP Information Page, PHP is successfully configured.


Step 9 — Configure PHP with SQL Server (Optional)

If you want to connect PHP with SQL Server:

  1. Download the SQLSRV drivers from Microsoft:
    https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server

  2. Extract and copy the php_sqlsrv.dll & php_pdo_sqlsrv.dll files into:

    C:\PHP\ext
  3. Open php.ini and enable:

    extension=php_sqlsrv.dll extension=php_pdo_sqlsrv.dll
  4. Restart IIS:

    iisreset

Step 10 — Restart IIS

Wednesday, July 16, 2025

Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

July 16, 2025 0
Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

 

Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

Oracle ডাটাবেসে যখন আমরা কোনো টেবিলে নতুন রেকর্ড যোগ করার সময় ইউনিক আইডি অটো জেনারেট করতে চাই, তখন সাধারণত Sequence ব্যবহার করা হয়। তবে অনেক সময় টেবিলে আগে থেকেই ডাটা থাকায় নতুন সিকোয়েন্স তৈরি করার সময় শুরু করার মানটা হতে হবে টেবিলের সর্বোচ্চ আইডির পরবর্তী সংখ্যা।

এখানে দেখানো হবে কিভাবে PL/SQL ব্লক ব্যবহার করে টেবিলের সর্বোচ্চ SAMPLE_ID বের করে সেই মান থেকে সিকোয়েন্স তৈরি করবেন।


সমস্যা

ধরা যাক, আপনার টেবিলের নাম XXPWC.PWC_OM_TEST_REQUEST_DEPT_SEND এবং এতে একটি কলাম আছে SAMPLE_ID যেখানে ইউনিক আইডি রাখা হয়।
আপনি একটি সিকোয়েন্স তৈরি করতে চান যা সর্বোচ্চ SAMPLE_ID থেকে ১ বাড়িয়ে শুরু হবে।


সমাধান

আমরা নিচের স্টেপগুলো অনুসরণ করব:

  1. টেবিল থেকে MAX(SAMPLE_ID) বের করব

  2. পুরানো সিকোয়েন্স থাকলে সেটি ড্রপ করব

  3. নতুন সিকোয়েন্স তৈরি করব যা MAX(SAMPLE_ID) + 1 থেকে শুরু হবে


PL/SQL ব্লক কোড

plsql

DECLARE v_max_id NUMBER; BEGIN -- ১. টেবিল থেকে সর্বোচ্চ SAMPLE_ID বের করা SELECT NVL(MAX(SAMPLE_ID), 0) INTO v_max_id FROM XXPWC.PWC_OM_TEST_REQUEST_DEPT_SEND; -- ২. যদি পুরানো সিকোয়েন্স থাকে, সেটি ড্রপ করা হবে BEGIN EXECUTE IMMEDIATE 'DROP SEQUENCE SAMPLE_ID_SEQ'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -2289 THEN -- ORA-02289: sequence does not exist, তখন এড়িয়ে যাব RAISE; END IF; END; -- ৩. নতুন সিকোয়েন্স তৈরি করা হবে সর্বোচ্চ SAMPLE_ID + 1 থেকে শুরু করে EXECUTE IMMEDIATE 'CREATE SEQUENCE SAMPLE_ID_SEQ START WITH ' || (v_max_id + 1) || ' INCREMENT BY 1 NOCACHE NOCYCLE'; DBMS_OUTPUT.PUT_LINE('Sequence SAMPLE_ID_SEQ created starting at ' || (v_max_id + 1)); END; /

কিভাবে ব্যবহার করবেন?

  • উপরের কোডটি Oracle SQL Developer বা আপনার পছন্দের SQL টুলে রান করুন।

  • এটি পুরানো সিকোয়েন্স থাকলে তা ড্রপ করবে এবং নতুন সিকোয়েন্স তৈরি করবে।

  • নতুন সিকোয়েন্স নাম হবে SAMPLE_ID_SEQ এবং এটি সর্বোচ্চ SAMPLE_ID থেকে পরবর্তী মান দিয়ে শুরু হবে।


কেন এটি প্রয়োজন?

  • অনেক সময় ডাটাবেস মাইগ্রেশন বা ম্যানুয়াল ডাটা ইনসার্টের কারণে টেবিলে ইতিমধ্যেই ডাটা থাকে।

  • সিকোয়েন্স যদি সর্বদা 1 থেকে শুরু করে, তাহলে নতুন ইনসার্টে ডুপ্লিকেট কী এরর হবে।

  • তাই MAX(ID) + 1 থেকে সিকোয়েন্স শুরু করা জরুরি।


অতিরিক্ত টিপস

  • যদি Multi-user environment এ concurrency issue থেকে বাঁচতে চান, তাহলে Sequence ব্যবহার করাই সেরা উপায়।

  • সরাসরি MAX(ID)+1 ব্যবহার না করে সিকোয়েন্স দিয়ে অটো ইনক্রিমেন্ট করুন।

  • আপনার ডাটাবেসে সিকোয়েন্স তৈরি ও ড্রপ করার পারমিশন থাকতে হবে।

Friday, July 11, 2025

How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By PL/SQL Function

July 11, 2025 0
How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By  PL/SQL Function

 



✅ লক্ষ্য:

  • TEST_CODE একটি LOV ফিল্ড

  • TEST_DESCRIPTION একটি Display-Only ফিল্ড

  • TEST_CODE নির্বাচন করলে TEST_DESCRIPTION অটোফিল হবে

  • Backend query ব্যবহার করে description fetch হবে


🔷 Step-by-Step Guide


🟠 Step 1: Create a PL/SQL Function

Oracle DB তে নিচের function টি তৈরি করুন:

plsql
CREATE OR REPLACE FUNCTION get_item_description ( p_inventory_item_id IN NUMBER ) RETURN VARCHAR2 IS l_description VARCHAR2(1000); BEGIN SELECT description INTO l_description FROM ( SELECT msib.inventory_item_id, msib.description FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') ) WHERE inventory_item_id = p_inventory_item_id; RETURN l_description; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; END;

🟠 Step 2: Go to APEX Page → Select Interactive Grid

  1. Go to Page Designer

  2. Click on your Interactive Grid (IG) region


🟠 Step 3: Configure TEST_CODE Column

  1. Select TEST_CODE column

  2. Type: Select List

  3. List of Values:

    sql
    SELECT msib.segment1 || ' - ' || msib.description AS display_value, msib.inventory_item_id AS return_value FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') ORDER BY msib.segment1

🟠 Step 4: Create Dynamic Action

  1. Select the Interactive Grid region

  2. In the right pane, go to Dynamic Actions

  3. Click Create → Choose:

    • Event: Change

    • Selection Type: Column

    • Column: TEST_CODE

  4. Name the DA: Set Test Description


🟠 Step 5: Add True Action → PL/SQL Code

  1. Under the Dynamic Action, add a True Action

  2. Action Type: Execute PL/SQL Code

  3. Code:

plsql

:P_TEST_DESCRIPTION := get_item_description(:P_TEST_CODE);

⚠️ Replace :P_TEST_CODE with the selected value of TEST_CODE column. Since this is Interactive Grid, we need to use Row context.

  1. In Items to Submit: add the column TEST_CODE

  2. In Page Items to Return: add the column TEST_DESCRIPTION


🟠 Step 6: Assign Returned Value to TEST_DESCRIPTION

Still under the same Dynamic Action:

  1. Add another True Action → Choose Set Value

  2. Set type to: PL/SQL Function Body

  3. Code:

plsql

return get_item_description(:TEST_CODE);
  1. Set Affected ElementsSelection Type: ColumnColumn: TEST_DESCRIPTION


🟠 Step 7: Set TEST_DESCRIPTION Column

  1. Select TEST_DESCRIPTION column in grid

  2. Type: Display Only

  3. Optionally set Read-Only, Escape special characters = Off


✅ Done! Test It:

  • Run the page

  • Select a value in TEST_CODE

  • TEST_DESCRIPTION will auto-populate using your function